Repository navigation
fix(sieve C9): pin the git abbreviation length t27c bakes in (Refs #8178) - #11792
Merged
Merged
Conversation
, Refs #6488) build.rs ran bare `git rev-parse --short HEAD`: git sizes the abbreviation by the clone's object count, so a depth-1 clone (actions/checkout) bakes 7 characters and a full clone 9, and two builds of one commit disagree (measured in #8148, builds A/C/D). Pinning -c core.abbrev=9 on the command makes the identity clone-independent, equal to the full clone's abbreviation. With the measured RUSTFLAGS --remap-path-prefix=$CARGO_HOME=/cargo (builds F, G, Z, specs/compiler/theory/reproducible.t27) both named C9 causes close. Foreign budget: bootstrap/build.rs +7/-7, net 0 lines (existing file, no label). Refs #8178 -- the two-lab rebuild and the sieve cell flip remain.
Contributor
This was referenced Oct 23, 2026
Summary by t27-beesThis change pins the git abbreviation length to 9 characters in Worth a look
Read: 1 files, +7 -7, the whole diff. Head |
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.
What
Pin the git abbreviation length that
bootstrap/build.rsbakes intoT27C_BUILD_GIT. A baregit rev-parse --short HEADsizes the abbreviation by the clone's object count, so a depth-1clone (what
actions/checkoutmakes) bakes 7 characters and a full clone 9, and two builds of onecommit disagree (sieve C9, measured in #8148, fix #8178).
The fix is one line of argument:
which pins the length to 9 — the same abbreviation the full clone already carries — and makes the
identity clone-independent. The measured
--remap-path-prefix=$CARGO_HOME=/cargohalf (#8148builds F, G, Z,
specs/compiler/theory/reproducible.t27) is the standing release/lab instruction.Refs #8178, Refs #6488.
Measured locally (this PR, rustc 1.99.0 (b940084d7 2026-09-28), cargo 1.99.0)
All three builds give one sha256:
fa51d1c15cadd5b2b9ea28e461f28ce3bde18433d85a6cd1f92ac8ec072c2151git clone --depth 1)fa51d1c15cadd5b2b9ea28e461f28ce3bde18433d85a6cd1f92ac8ec072c2151$HOME/.cargo($TMPDIR/cargo-home2)fa51d1c15cadd5b2b9ea28e461f28ce3bde18433d85a6cd1f92ac8ec072c2151RUSTFLAGS
--remap-path-prefix=$CARGO_HOME=/cargowas used for all three. Each binary carriest27c-bootstrap@0.5.2+9ab1b089e(nine characters, clone-independent), 21/cargo/registryreferences and 0 absolute
~/.cargoor build-directory references.Negative control (the unfixed path, measured on the same shallow clone before the fix): a bare
git rev-parse --short HEADprints9ab1b08(seven characters), and a build of that treegives
3fdd825fbd28c383c345bca6d9f9ba7373779f56d1fe90143b8f693a0d93475e— the disagreementbetween a depth-1 and a full clone that #8148 reported (
477efb0fagainstc661e5ec).Budget
bootstrap/build.rsis an existing foreign file. This PR is+7/-7, net 0 lines, within thecheck_budget()cap (40 added per file, 80 per PR, never more added than deleted); noowner-approved-foreignlabel is needed for an edit to an existing foreign file. No.t27specchanged, so no spec seal moves.
What remains (and why the issue stays open)
t27cbuilt on thet27candt27blabs with the newbuild.rsand the remap flag, both giving one sha256) is the closing condition of t27c build is not reproducible: git short-sha length and CARGO_HOME path are baked into the binary (sieve C9) #8178. It cannot be
performed from this checkout; it is requested in the issue's comment.
cell_t27c(C9)inspecs/compiler/theory/sieve.t27turn TRUE,fix_issue(T27C, C9)stops naming t27c build is not reproducible: git short-sha length and CARGO_HOME path are baked into the binary (sieve C9) #8178, andspecs/compiler/theory/reproducible.t27recordsthe new hashes.
Test plan
cargo build --release -p t27cin the full clone (RUSTFLAGS remap) — exit 0.cargo build --release -p t27cin a--depth 1clone (RUSTFLAGS remap) — exit 0, sha equal.cargo build --offline --release -p t27cin the depth-1 clone against a secondCARGO_HOME(750 MB copy) — exit 0, sha equal.