cargo: drop shared musl rustflags; each repo owns its rustflags#1
Merged
Conversation
The shared config defined the musl static-link rustflags for the whole workspace. That interacts badly with two things: - Reproducibility: CI checks out each sub-repo alone, with no workspace parent and CARGO_HOME redirected, so it never sees this file. A repo relying on the shared rustflags would build differently in CI than locally. - Cargo concatenates rustflags arrays across config files (a sub-repo's does NOT override the workspace's, despite the old comment here). So a musl repo that also defines its own rustflags (stage1, os402) got them doubled once the masking global ENV RUSTFLAGS in the repo Dockerfiles is removed, which changes every compiled binary's -Cmetadata and thus its bytes. Keep only the workspace-wide [env] (SOURCE_DATE_EPOCH). Rustflags now live in each repo's own .cargo/config.toml: stage0, stage1 and os402 are self-sufficient; the gnu-host repos (vaportpm, vaportpm-zk) build gnu by default and opt into musl per build if they ever need it. Verified: with the repo Dockerfiles dropping their global RUSTFLAGS and this change in place, stage0.efi / ena.efi / payload.efi / stage1 / stage2 / linux.efi all hash identically to before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Halve the header block, keeping the two non-obvious facts (CI checks each repo out alone, so each must be self-sufficient; cargo concatenates rustflags across config files, so do not duplicate) and the no-[build]-target reason. No config change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
What
Remove the musl
[target.*] rustflagsfrom the workspace-shared/src/.cargo/config.toml, leaving only the workspace-wide[env] SOURCE_DATE_EPOCH. Rustflags now live in each repo's own.cargo/config.toml.Why
The sibling repos (stage0 #8, stage1 #17) are dropping the global
ENV RUSTFLAGSfrom theirDockerfile.buildin favor of per-target.cargo/config.toml. That global env var was load-bearing: it overrode all configrustflagsuniformly, masking two problems that surface once it's gone:CARGO_HOMEredirected to an empty dir, so this shared file is never present in CI. A repo relying on it would build differently in CI than locally.rustflagsacross config files (a sub-repo's does not override the workspace's, contrary to the old comment here). A musl repo that also declares its own rustflags (stage1, os402) got them doubled, changing every binary's-Cmetadataand thus its bytes.Keeping only
[env]here, with each repo self-sufficient, makes dev and CI load an identical single flag set.Impact
stage0,stage1,os402— self-sufficient (own configs). stage0 gains one in its PR.vaportpm,vaportpm-zk— gnu-host by default; unaffected unless they manually--target musl, in which case they now add their own rustflags.Verification
With the repo Dockerfiles dropping their
RUSTFLAGSand this change in place, the measured binaries hash identically to before:stage0.efi,ena.efi,payload.efi,stage1,stage2, and thelinux.efiUKI. stage0smoke-boot5/5 and the stage1 chain (SIGN=1/MANIFEST=1/SIGN_ARGS=1) pass.Merge alongside lockboot/stage0#8 and lockboot/stage1#17.
🤖 Generated with Claude Code