mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-12 04:47:17 +04:00
The GitHub CI spends 10 to 18 minutes rebuilding all host tools in most
"Check Kernel patches" jobs, although the tools container ships them
prebuilt. Before, the "Build tools" step took about 10 seconds.
The refresh sets all stamps to one time given to touch -t, which has a
resolution of a full second, so the fraction is zero. The CI job runs the
refresh about 0.2 seconds after actions/checkout finished, and git writes
the tools directory last. Its files therefore often get a timestamp in
the same second as the stamps, but after the full second. Since
timestamp.pl compares the fraction of a second, these source files are
newer than the stamps and every tool gets cleaned and built again.
Take the time from a freshly created temporary file and set all stamps
to it with touch -r. They still share one timestamp, but it now includes
the fraction and is always later than the checkout.
Fixes: 3cf47c5c17 ("build: compare timestamps with a fraction of a second")
Assisted-by: Claude:claude-opus-5-5
Link: https://github.com/openwrt/openwrt/pull/25626
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>