Repository navigation
ci: the Rust install and the wasm-bindgen steps are two composite actions (#1457) - #1491
Merged
Merged
Conversation
…ions (#1457) Thirty-two Rust installs, in ten workflows, were copies of one script that differed in the toolchain, one component, one target and whether the toolchain became rustup's default; they are .github/actions/setup-rust with those four inputs. The three copies of the locked wasm-bindgen version and the install of wasm-pack and that CLI are .github/actions/wasm-tools. The action sets what each copy set, because Swatinem/rust-cache hashes the default toolchain and every CARGO*/RUST* variable into its key: nothing here moves a key. The 1.88 check and the public API listing's nightly name their toolchain without making it the default (make-default false), as before. Refs #1457.
18 tasks done
DrunkOnJava
marked this pull request as ready for review
November 5, 2026 22:39
DrunkOnJava
enabled auto-merge (squash)
November 5, 2026 23:02
DrunkOnJava
added a commit
that referenced
this pull request
Nov 6, 2026
…not turn a job red (#1457) (#1506) ## Summary `rustup toolchain install` failed once on `full / build + real files / macos-26 / stable` on #1483 at 1811752 with "could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'", with nothing wrong in the code. rustup's own retries are over in seconds. #1491 put the install in one composite action, so one change now covers every job. The install is tried three times, 20 s and 40 s apart, each failure leaving a warning. A toolchain that really can't be installed still fails the job, with an error, about a minute later. The one other rustup download in CI, `rustup component add rustfmt` in `ifcopenshell-validate`, moves into that job's setup step as `component: rustfmt`, so it goes through the same retry. Cache keys don't move: no toolchain and no environment variable changes, and Swatinem/rust-cache v2.9.3 hashes neither the action file nor the installed components. Every rust-cache key on this PR's CI run 42134631531 equals the same job's on main's run 42131995046, the IfcOpenShell job's included (`v0-rust-ci-release-Linux-x64-cdee7d24-2ff012fc`). Refs #1457. ## Verification - The action's run block, run under `bash --noprofile --norc -eo pipefail` (as GitHub runs `shell: bash`) against a fake `rustup`, `rustc` and `sleep`: - 0 failures: exit 0, 1 install, no sleep. - 2 failures: exit 0, 3 installs, sleeps of 20 and 40, default set, 2 lines in `GITHUB_ENV`. - 3 and 9 failures: exit 1, 3 installs, the error annotation, no default set, nothing in `GITHUB_ENV`. - `actionlint` exits 0. - Not measured: a real download failure on a runner. `tools/ci/check-workflows.py` wasn't run locally (no PyYAML here); CI runs it. No output, `src/` or gate file changes, so no Measure.
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.
Summary
The last piece of #1457: the Rust install, which was thirty-two copies of one script, is a composite action,
.github/actions/setup-rust, and the three copies of the wasm-bindgen steps are another,.github/actions/wasm-tools. Nothing else changes: the same toolchain in every job, the same rust-cache keys, the same release path.Motivation
#1457's last box: "the Rust install is repeated 27 times and the
wasm-bindgensteps 3 times". Bygit greptoday the install is 32 steps in 10 workflows (ci.yml17,publish.yml5,measure.yml2,scheduled-checks.yml2, and one each incorpus-nightly.yml,deploy-viewer.yml,fuzz.yml,perf-budget.yml,release-binaries.ymlandviewer-test.yml), each a copy ofrustup toolchain install,rustup default, twoecho ... >> $GITHUB_ENVlines andrustc --version, differing in the toolchain, one component, one target and whether the toolchain becomes the default.Changes
.github/actions/setup-rust(new): inputstoolchain(defaultstable),component,targetandmake-default(default"true"). Oneshell: bashstep, inputs throughenv:(no expression in the script), the same--profile minimal --no-self-update, thenrustup defaultunlessmake-defaultis"false", thenCARGO_INCREMENTAL=0andCARGO_TERM_COLOR=alwaysinto$GITHUB_ENV, thenrustc +<toolchain> --version. No third-party action inside it..github/actions/wasm-tools(new): the "Locked wasm-bindgen version" step, byte for byte, andtaiki-e/install-actionat the same SHA and the same[email protected]and lockedwasm-bindgen, with the comment about the DNS outage (CI run 41954251714) moved into the action. Used byviewer-test.yml,deploy-viewer.ymlandpublish.yml.setup-rust(33 uses: the semver job takes a second for its nightly), asuses: $/.github/actions/setup-rustwith only the inputs that differ from the default:component: rustfmtandclippy(fmt, clippy),toolchain: ${{ matrix.rust }}(the test matrix),toolchain: nightly-2026-10-01(the docs.rs previews, the fuzz-check job),toolchain: ${{ env.NIGHTLY }}(Fuzz),toolchain: nightly(the floating docs.rs build),target: i686-unknown-linux-gnu,target: wasm32-unknown-unknown(three),target: ${{ matrix.target }}(release-binaries),target: ${{ runner.os == 'macOS' && matrix.target || '' }}(publish's wheels, stillif: runner.os != 'Linux').make-default: "false": the fuzz-check job (cargo +nightly-2026-10-01, its rust-cache keyed by the default stable'srustc -vV), the MCP server's 1.88 check (its own step now,cargo +1.88 check ...after the install), and the public API listing's nightly in the semver job (a second use of the action after the stable one)..github/actions/**andviewer-test.yml(ci(viewer): build the WASM once per run, and test the file Deploy viewer publishes (#1457) #1458), which covers both new actions, so it is unchanged.docs/maintaining.md: a section on the two actions and on why the environment they set is not tidying.What is the same, and what is not
Same: every job's toolchain, component and target; the default toolchain;
CARGO_INCREMENTAL=0andCARGO_TERM_COLOR=alwaysbefore the cache steps; the dated nightly stays at its sites;shell: bashon the composite steps;rustupflags.Swatinem/rust-cache hashes the default toolchain's
rustc -vVand everyCARGO*,CC*,CFLAGS,CXX*,CMAKE*andRUST*variable into its key (src/config.tsat the pinned SHA), so a change of default toolchain or of one of those variables in a job that restores a cache would start it from nothing. None changes:i686-overflow(noCARGO_TERM_COLORbefore, whichci.yml's workflow-levelenvsets for every step anyway),docs-rs-nightlyofscheduled-checks.yml(the same, from that file's workflow-levelenv; no cache there) and theAuditjobs ofscheduled-checks.yml(noCARGO_INCREMENTALbefore; they compile nothing, their tools are prebuilt, and restore no cache): these two files' sites gain a variable that is already set or that nothing reads;rustc +<toolchain> --versionwhere a step printed none (fuzz-check), and shows the install as one step with its inner steps.Left alone
Nothing in the issue's list was left.
publish.yml'spublish-cratejob runs only at a tag, so no dispatch runs its install step; it is the same invocation (setup-rustwith no inputs) thatrelease-source-smokeruns in a dispatch.Testing
Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead.
tools/check-local.shpasses. N/A: CI-only change; no local compute on this lane.What was run on this head (
13aa7f41):python3 tools/ci/check-workflows.py: 0 errors, 0 warnings; 65 jobs run steps in 17 workflows,PENDINGempty, and 67 uses of this repository's own actions and workflows, whose files exist and whosewith:names only inputs they declare (thetarget,toolchain,componentandmake-defaultofsetup-rust).actionlintexits 0.zizmor1.32.0 offline over.githubon this head and onorigin/main: 45 findings each (2 ignored, 37 suppressed, 6 medium, all the Dependabot 3-day cooldown), none in the new actions or the changed steps, and no inline suppression removed. The repository's ownzizmor.ymlruns 1.30.1 on this pull request.git grep "rustup toolchain install\|rustup default" -- .githubfinds only the action's own.Cache Keylines of the latest CI run onmain(42120229711, at16682a7a, this branch's base): clippyv0-rust-clippy-Linux-x64-cdee7d24-2ff012fc, docv0-rust-doc-Linux-x64-0c88e82e-2ff012fc, the sharedv0-rust-ci-release-Linux-x64-cdee7d24-2ff012fc(Corpus health, MCP on Einhoven, Writer patch corpus, IfcOpenShell, bench and the Ubuntu stable build),-1bcc85bf-(MSRV), the macOS and Windows builds,v0-rust-ci-i686-Linux-x64-3f01e9d1-2ff012fc,v0-rust-ci-docs-rs-Linux-x64-ab072a77-2ff012fc,v0-rust-ci-fuzz-check-Linux-x64-cd142760-c3664f70and the viewer'sv0-rust-viewer-wasm-fast-Linux-x64-a74c6f26-2ff012fc; Deploy viewer's build onmain(42112535877)v0-rust-viewer-wasm-Linux-x64-a74c6f26-2ff012fc; Measure's build onmain(42121438036)v0-rust-measure-Linux-x64-a74c6f26-2ff012fc. The runs on this head are compared against them (below).Runs on this head (
13aa7f41), none read yet: not yet measured on this head until they are.toolchain: ${{ matrix.rust }}), Corpus health and the MCP server on Einhoven (their rust-cache keys), the env config lint and the PII guard. At the first lookfast / cargo fmt,env config lint,PII guardand both zizmor runs had passed.measure.yml(run 42122476881, Build head and Build base): the build job's install and cache. I dispatched no Measure of my own on top of it, since the filtered run asked for would build the same job again.release-binaries.ymlstarts on a pull request (run 42122476923): the five targets, Windows, both macOS (one cross-compiled and smoked under Rosetta) and both Linux musl legs, withtarget: ${{ matrix.target }}.test-pypistays false): the preflight, the wheel builds on all three systems (the non-Linuxif:and the macOS target), the source install, the docs.rs preview on the dated nightly and the viewer smoke (target: wasm32-unknown-unknownandwasm-tools). Not run by it:publish-crate, which runs at a tag only; its install is the invocationrelease-source-smokeruns.viewer-wasm's cache key,wasm-tools) and the two calls ofviewer-test.yml.python3 cachekeys.py <main run> <this run>over each job'sCache Key:lines (.claude/scripts/cache-keys.py RUN_A RUN_B, kept out of the tree; the baselines are CI run 42120229711, Deploy viewer run 42112535877 and Measure run 42121438036, all onmain) reports the jobs whose key differs; the expected result is none.Audit-honesty checklist
docs/maintaining.md)changelog.d/<section>/. N/A: CI only, as agreed for CI: where the minutes go, and what to change #1457.Legal and contribution hygiene
Breaking changes
None.
Screenshots or output samples
See Testing.
Related issues
Closes #1457