Repository navigation
ci: single setup-rust composite — toolchain pin, mold, centralized build profiles (T1) #7821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
52b7e09
perf(build): codify CI's debug=0 policy as the workspace dev/test/rel…
henrypark133 84bc386
ci: add the setup-rust composite action (unused by any workflow yet)
henrypark133 0f8f7ac
ci(sccache-dist-smoke): install Rust via the setup-rust composite
henrypark133 46bdb2c
ci(reborn-playwright): install Rust via the setup-rust composite
henrypark133 a3d03dc
ci(release-plz): install Rust via the setup-rust composite
henrypark133 b71cca9
ci(nightly-deep-ci): install Rust via the setup-rust composite
henrypark133 68d4e16
ci(reborn-release-compile): install Rust via the setup-rust composite
henrypark133 80e576e
ci(ironclaw-stress): install Rust via the setup-rust composite
henrypark133 1f4bd5d
ci(code_style): install Rust via the setup-rust composite
henrypark133 ba1e730
ci(platform-and-compat): install Rust via the setup-rust composite
henrypark133 99d84e6
ci(reborn-e2e): install Rust and mold via the setup-rust composite
henrypark133 b98c2f0
ci(coverage): install the nightly toolchain via the setup-rust composite
henrypark133 050c0d2
ci(reborn-tests): install Rust and mold via the setup-rust composite
henrypark133 1af2b2b
ci(live-canary): install Rust via the setup-rust composite
henrypark133 020afb3
chore(qa): drop the now-redundant CARGO_PROFILE_DEV_DEBUG setdefault
henrypark133 b32e1fd
build: pin the local Rust toolchain via rust-toolchain.toml
henrypark133 daa5690
docs(agents): document the toolchain pin and bump process
henrypark133 d5d37e6
ci(gate): forbid direct dtolnay/rust-toolchain use; enforce the toolc…
henrypark133 5d3fe7c
fix(ci): let the composite own RUSTFLAGS so job env cannot shadow mold
henrypark133 29b073a
fix(ci): map .github/actions/setup-rust/ into the Reborn PR test planner
henrypark133 39498bd
fix(ci): let has_code see the toolchain pin and its own guard
henrypark133 fa3703a
fix(ci): pin the mold verify step's Linux guard in the setup-rust con…
henrypark133 2d125f5
fix(ci): anchor the toolchain-default regex to the toolchain input block
henrypark133 1ef72d8
fix(ci): catch workflow-level env RUSTFLAGS shadowing setup-rust too
henrypark133 3dc47cb
test(ci): assert every exhaustive-plan field for the setup-rust widen
henrypark133 d33e7f9
fix(ci): glob both .yml and .yaml when loading workflows
henrypark133 6a84103
fix(ci): guard every Rust bootstrap, not just the vendor action
henrypark133 36041d7
docs(toolchain): name the accepted release-workflow bootstrap in the …
henrypark133 cfb3761
fix(ci): migrate the release lane onto the composite and unbreak two …
henrypark133 ff4b4c6
fix(ci): catch step-level RUSTFLAGS, not just job- and workflow-level
henrypark133 edaf965
fix(ci): restore the release lane's Rust install and assert it is there
henrypark133 4cd3f10
refactor(ci): split the Rust toolchain contracts out of ws12_workflow…
henrypark133 463b029
docs(agents): point the toolchain pin at its owner instead of restati…
henrypark133 c35c70d
fix(ci): require every cargo job to reach the composite, not just the…
henrypark133 4a73f18
fix(ci): classify the cargo-dist fragment so the plan step stops fail…
henrypark133 cbe943f
refactor(ci): close the three open audit findings
henrypark133 3e0b5ce
Address PR review feedback (#7821)
henrypark133 6208df3
fix(ci): install Rust in the one hermetic lane that acquired it lazily
henrypark133 b628ab8
fix(ci): realign the assertion I broke by rewording the guard message
henrypark133 7fc365b
fix(ci): make the debug-policy guard see where the value was actually…
henrypark133 2d532b2
docs(agents): replace a universal claim with a verified, re-checkable…
henrypark133 89237f6
fix(ci): pin the release step's condition, and scope the coverage cla…
henrypark133 25aff16
fix(ci): close four review findings on the condition and debug-policy…
henrypark133 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| name: Setup Rust | ||
| description: >- | ||
| Install the Rust toolchain (pinned by default to the same version as | ||
| rust-toolchain.toml — see the `toolchain` input), optionally the mold | ||
| linker, and pin RUSTUP_TOOLCHAIN for the rest of this job so it can never | ||
| silently drift from what this step actually installed. | ||
|
|
||
| # Why RUSTUP_TOOLCHAIN: dtolnay/rust-toolchain only runs `rustup default`, | ||
| # which rust-toolchain.toml would otherwise outrank for every in-repo cargo | ||
| # invocation (rustup precedence: RUSTUP_TOOLCHAIN env > directory override > | ||
| # rust-toolchain.toml file > `rustup default`). Exporting the toolchain this | ||
| # step actually resolved — via the action's own `outputs.name`, not a | ||
| # second guess at it — makes that drift structurally impossible, for a | ||
| # pinned stable lane and a nightly lane alike. No lane needs special-casing. | ||
| # | ||
| # Why one place for mold: mold's apt-install/verify/RUSTFLAGS-export used to | ||
| # be copy-pasted per job (8 install sites, 2 "verify" blocks, 4 written-out | ||
| # copies of the linker RUSTFLAGS string across reborn-tests.yml and | ||
| # reborn-e2e.yml). One `mold: true` input replaces all of that. | ||
|
|
||
| inputs: | ||
| toolchain: | ||
| description: >- | ||
| Toolchain spec passed through to dtolnay/rust-toolchain. Defaults to | ||
| the same version pinned in rust-toolchain.toml — bump both together; | ||
| scripts/ci/ws12_workflow_contracts.py fails the build if they drift. | ||
|
henrypark133 marked this conversation as resolved.
|
||
| Pass an explicit value (e.g. nightly-2025-11-01) for a lane that | ||
| intentionally does not track the pinned stable toolchain. | ||
| required: false | ||
| default: "1.98.0" | ||
| components: | ||
| description: Comma-separated rustup components, passed through. | ||
| required: false | ||
| default: "" | ||
| targets: | ||
| description: Comma-separated target triples, passed through. | ||
| required: false | ||
| default: "" | ||
| mold: | ||
| description: >- | ||
| Install mold+clang, verify the linker actually links, and export the | ||
| canonical mold RUSTFLAGS prefix. Linux-only (a no-op elsewhere). | ||
| Defaults to false: most jobs in this repo do not link with mold; the | ||
| handful that do pass `mold: true` explicitly. | ||
| required: false | ||
| default: "false" | ||
| extra_rustflags: | ||
| description: >- | ||
| Extra RUSTFLAGS this job needs (e.g. the nightly `-Zcrate-attr=...` | ||
| the coverage and crate-bucket lanes compile with). Pass them HERE, not | ||
| as a job-level `env: RUSTFLAGS:` — a job-level env key is re-applied | ||
| to every step and therefore shadows what this action writes to | ||
| $GITHUB_ENV, silently dropping the mold linker flags. Routing them | ||
| through this input keeps one owner for the final value; | ||
| scripts/ci/ws12_workflow_contracts.py fails any job that pairs | ||
| setup-rust with its own RUSTFLAGS env key. | ||
| required: false | ||
| default: "" | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install Rust | ||
| id: install | ||
| uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | ||
| with: | ||
| toolchain: ${{ inputs.toolchain }} | ||
| components: ${{ inputs.components }} | ||
| targets: ${{ inputs.targets }} | ||
|
|
||
| - name: Pin the resolved toolchain for the rest of this job | ||
| shell: bash | ||
| run: | | ||
| echo "RUSTUP_TOOLCHAIN=${{ steps.install.outputs.name }}" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Install mold and clang | ||
| if: ${{ inputs.mold == 'true' && runner.os == 'Linux' }} | ||
| shell: bash | ||
| run: | | ||
| scripts/ci/install-ci-apt-packages.sh clang mold | ||
| test -x /usr/bin/mold | ||
|
|
||
| - name: Verify mold linker is active | ||
| if: ${{ inputs.mold == 'true' && runner.os == 'Linux' }} | ||
| shell: bash | ||
| run: | | ||
| clang_output=$(echo 'int main(void) { return 0; }' \ | ||
| | clang --ld-path=/usr/bin/mold -Wl,--version -x c - -o /tmp/clang-mold-check 2>&1) | ||
| grep -qi mold <<< "$clang_output" | ||
| printf 'fn main() { println!("mold-link-ok"); }\n' > /tmp/mold-link-check.rs | ||
| rustc /tmp/mold-link-check.rs \ | ||
| -C linker=clang \ | ||
| -C link-arg=--ld-path=/usr/bin/mold \ | ||
| -o /tmp/mold-link-check | ||
| test "$(/tmp/mold-link-check)" = "mold-link-ok" | ||
|
|
||
| - name: Export mold RUSTFLAGS | ||
| if: >- | ||
| ${{ (inputs.mold == 'true' && runner.os == 'Linux') | ||
| || inputs.extra_rustflags != '' }} | ||
| shell: bash | ||
| env: | ||
| MOLD_RUSTFLAGS: "-C linker=clang -C link-arg=--ld-path=/usr/bin/mold" | ||
| USE_MOLD: ${{ inputs.mold == 'true' && runner.os == 'Linux' }} | ||
| EXTRA_RUSTFLAGS: ${{ inputs.extra_rustflags }} | ||
| run: | | ||
| # Compose the whole value here so exactly one place owns it. Order: | ||
| # mold linker flags, then the job's extra flags, then anything an | ||
| # earlier step already exported. A job-level `env: RUSTFLAGS:` would | ||
| # shadow this write for every later step (job env is re-applied per | ||
| # step, on top of $GITHUB_ENV), which is why jobs pass their flags | ||
| # through `extra_rustflags` instead and ws12 enforces it. | ||
| flags="" | ||
| if [[ "${USE_MOLD}" == "true" ]]; then | ||
| flags="${MOLD_RUSTFLAGS}" | ||
| fi | ||
| if [[ -n "${EXTRA_RUSTFLAGS}" ]]; then | ||
| flags="${flags:+${flags} }${EXTRA_RUSTFLAGS}" | ||
| fi | ||
| echo "RUSTFLAGS=${flags}${RUSTFLAGS:+ ${RUSTFLAGS}}" >> "$GITHUB_ENV" | ||
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.