Repository navigation
Restore matching build-script input timestamps - #40
Merged
Merged
Conversation
zanieb
marked this pull request as ready for review
October 24, 2026 03:40
astral-automations-bot Bot
added a commit
to astral-sh/uv
that referenced
this pull request
Oct 24, 2026
Fresh checkouts can change build-script input timestamps and invalidate otherwise reusable workspace artifacts. Enable the shared cache action's timestamp restoration for the Linux test job and the Linux x86_64 development-binary job. Uses the timestamp restoration from astral-sh/github-actions#40. Twenty paired exact warm-cache hits per row. Times are means in seconds, excluding queue and pre-step runner waiting. In the table, parentheses give the 90% confidence interval for mean time saved. | Job | Before (s) | After (s) | Speedup | Saved (s; 90% CI) | | --- | ---: | ---: | ---: | ---: | | Linux tests | 256.5 | 212.6 | 1.21× | 43.9 (27.7 to 60.1) | | Linux development binary | 41.6 | 32.4 | 1.29× | 9.2 (7.0 to 11.5) | <details> <summary>Timing scope and runs</summary> uv source is pinned to [0eac269](astral-sh@0eac269). The baseline uses the merged cache action at `3c9fe5d`; the candidate enables timestamp restoration at `374b3d5`. Each pair uses the same runner class and workload. Times span the first job step through post steps, including setup, cache restoration, and the development binary upload. Speedup is the ratio of mean times. The paired t intervals estimate uncertainty in the mean saving under these conditions. Values are rounded independently. Cache creation is outside these warm-hit timings. The Linux breakdown below uses Cargo’s reported build time and `nextest`’s execution timer. Other job steps are outside this breakdown. Negative savings mean slower execution. | Job | Before (s) | After (s) | Speedup | Saved (s; 90% CI) | | --- | ---: | ---: | ---: | ---: | | Linux test compilation | 45.4 | 11.9 | 3.80× | 33.4 (30.0 to 36.9) | | Linux `nextest` execution | 136.1 | 126.9 | 1.07× | 9.2 (-3.3 to 21.6) | The `nextest` interval includes zero, so these runs do not establish a change in test execution time. Linux pairs: [1](https://github.com/astral-sh/uv-dev/actions/runs/39845565322), [2](https://github.com/astral-sh/uv-dev/actions/runs/39845570448), [3](https://github.com/astral-sh/uv-dev/actions/runs/39845575641), [4](https://github.com/astral-sh/uv-dev/actions/runs/39846271408), [5](https://github.com/astral-sh/uv-dev/actions/runs/39846430674), [6](https://github.com/astral-sh/uv-dev/actions/runs/39846516805), [7](https://github.com/astral-sh/uv-dev/actions/runs/39847137654), [8](https://github.com/astral-sh/uv-dev/actions/runs/39847303298), [9](https://github.com/astral-sh/uv-dev/actions/runs/39847390120), [10](https://github.com/astral-sh/uv-dev/actions/runs/39848003824), [11](https://github.com/astral-sh/uv-dev/actions/runs/39848163631), [12](https://github.com/astral-sh/uv-dev/actions/runs/39848250928), [13](https://github.com/astral-sh/uv-dev/actions/runs/39848718406), [14](https://github.com/astral-sh/uv-dev/actions/runs/39848950527), [15](https://github.com/astral-sh/uv-dev/actions/runs/39849111871), [16](https://github.com/astral-sh/uv-dev/actions/runs/39849342421), [17](https://github.com/astral-sh/uv-dev/actions/runs/39850043674), [18](https://github.com/astral-sh/uv-dev/actions/runs/39850206043), [19](https://github.com/astral-sh/uv-dev/actions/runs/39850289227), [20](https://github.com/astral-sh/uv-dev/actions/runs/39850807214). Development binary pairs: [1](https://github.com/astral-sh/uv-dev/actions/runs/39845559347), [2](https://github.com/astral-sh/uv-dev/actions/runs/39845565304), [3](https://github.com/astral-sh/uv-dev/actions/runs/39845570772), [4](https://github.com/astral-sh/uv-dev/actions/runs/39845812706), [5](https://github.com/astral-sh/uv-dev/actions/runs/39845981670), [6](https://github.com/astral-sh/uv-dev/actions/runs/39845987308), [7](https://github.com/astral-sh/uv-dev/actions/runs/39846074229), [8](https://github.com/astral-sh/uv-dev/actions/runs/39846238545), [9](https://github.com/astral-sh/uv-dev/actions/runs/39846241952), [10](https://github.com/astral-sh/uv-dev/actions/runs/39846245499), [11](https://github.com/astral-sh/uv-dev/actions/runs/39846412362), [12](https://github.com/astral-sh/uv-dev/actions/runs/39846417727), [13](https://github.com/astral-sh/uv-dev/actions/runs/39846423157), [14](https://github.com/astral-sh/uv-dev/actions/runs/39846596231), [15](https://github.com/astral-sh/uv-dev/actions/runs/39846602048), [16](https://github.com/astral-sh/uv-dev/actions/runs/39846607338), [17](https://github.com/astral-sh/uv-dev/actions/runs/39846771601), [18](https://github.com/astral-sh/uv-dev/actions/runs/39846775882), [19](https://github.com/astral-sh/uv-dev/actions/runs/39846863070), [20](https://github.com/astral-sh/uv-dev/actions/runs/39846953535). </details> --------- Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A warm workspace cache can still trigger substantial recompilation after a fresh CI checkout.
checksum-freshnessrecognizes unchanged Rust sources, but Cargo still uses timestamps for build-script input checks. New checkout timestamps can therefore rerun build scripts and rebuild dependent crates even when those inputs are unchanged. CI pays for both restoring the artifacts and rebuilding them.Cache hashes, modes, and timestamps for tracked files in workspace packages with build scripts alongside the artifacts, and restore timestamps for matching files and directories. Changes to tracked inputs or directory entries within a current build-script package invalidate that package's cached runs and their output directories in the selected profiles. Refresh Git's index metadata afterwards so subsequent checkouts can recognize unchanged files.
Timestamp restoration is part of the normal cache lifecycle. It requires Git and either
uvor Python before the action, and one artifact cache per workspace so the input snapshot corresponds to the restored outputs. Git metadata, symlinks, untracked files, and inputs outside these packages retain Cargo's usual freshness checks.