Repository navigation
build: pin the Rust toolchain to 1.94.1 - #28
Merged
Merged
Conversation
Release engines are built on four hosts plus a container that installs its own Rust. Unpinned, they ran three different rustc versions. A rust-toolchain.toml makes rustup on every host, and in the linux-arm64 container, use the same compiler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rVbt7rENTwXkdHt3Bpgb5
🔍 CodeGraph PR Review4 files changed (+14/−3, 0 functions) · Risk: 🟢 low Suggested reviewersAndrey Vasilevsky (22 lines), anvanster (8 lines) Suggested commit: |
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.
Intent
The developer is preparing to build and publish the CodeGraph 0.21.0 release across all platforms (darwin-arm64, darwin-x64, linux-x64 on SLES, linux-arm64 via Docker, win32-x64). They agreed to pin the Rust toolchain to 1.94.1 with a rust-toolchain.toml, so every build host and the arm64 container use the same compiler. Hosts had disagreed: SLES defaulted to 1.94.1, the Mac and Windows to 1.93.1, and the container to whatever was current stable. This change is that one-line toolchain pin, committed and run through the no-mistakes gate before the release build. Standing constraints: push only through the no-mistakes gate, never use em dashes, don't manually edit CHANGELOG.md or Cargo.lock, and merge no external PRs.
What Changed
rust-toolchain.toml, which pins rustc to 1.94.1 with the minimal profile,rustfmtandclippy, and thex86_64-apple-darwintarget for the darwin-x64 cross-build. Every build host now uses the same compiler.scripts/build-linux-arm64.shnow bootstraps rustup with--default-toolchain none, so the container installs the pinned toolchain fromrust-toolchain.tomland no longer pulls current stable. Before building, the script runsrustc --versionand exits with an error if the toolchain install failed.README.mdandvscode/README.mdnow list rustup as the requirement and say it installs the pinned Rust version. They no longer say "Rust stable".🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change only adds a toolchain pin and makes a small bootstrap tweak to the arm64 build script. Both prior findings are fixed correctly: the darwin-x64 target is listed, the container installs no default toolchain, and
rustc --versionruns inside /src, where the pin triggers the 1.94.1 install and fails loudly if that install fails.Testing
I drove the pin on two fresh, isolated rustup installs with no toolchains, mirroring how release hosts and the linux-arm64 container meet it. On the arm64 Mac the pin auto-installed only 1.94.1, with the x86_64-apple-darwin target. With that toolchain, the full darwin-x64 codegraph-server release cross-build succeeded and produced an x86_64 Mach-O binary that prints
codegraph-server 0.21.0under Rosetta. In an Ubuntu 20.04 arm64 container I replayed the script's--default-toolchain nonebootstrap. No stable toolchain was installed. The newrustc --versionline installed and printed 1.94.1 inside /src. Outside the pinned tree, rustc failed, which is the error the guard is there to catch. Every scenario passed.rustup target add, and runsrustc --versionline in /src installs and prints 1.94.1Evidence: linux-arm64 container bootstrap transcript (installs none, pin picks 1.94.1, guard fires without pin)
Evidence: Fresh rustup on arm64 Mac: pin auto-installs 1.94.1 + x86_64-apple-darwin
Evidence: darwin-x64 codegraph-server release cross build with rustc 1.94.1; x86_64 binary prints 0.21.0
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
rust-toolchain.toml:7- The darwin-x64 engine is cross-compiled on the ARM Mac withcargo build --release --target x86_64-apple-darwin(per the release build notes). The pin makes rustup auto-install a fresh 1.94.1 toolchain withprofile = "minimal", and that install only includes the host std. rustup does not auto-add extra targets. The x86_64-apple-darwin target the Mac added for 1.93.1 does not carry over to 1.94.1, so the darwin-x64 release build will fail with "can't find crate forcore" / "target may not be installed" until someone runsrustup target addagain. Fix: addtargets = ["x86_64-apple-darwin"]to the [toolchain] table. rustup installs listed targets' std on every host, which is harmless, and this keeps the pin self-sufficient for every release artifact.scripts/build-linux-arm64.sh:142- The linux-arm64 container still bootstraps rustup with--default-toolchain stable. Oncecargoruns in /src, the new rust-toolchain.toml overrides that and rustup downloads 1.94.1 as well, so every container build downloads two toolchains and the stable one is never used. Using--default-toolchain nonehere, so the pin alone decides the compiler, would remove the extra download and the misleading 'stable' in the build log. This is not a correctness problem: the pin still wins.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
rustup target add, and runsrustc --versionline in /src installs and prints 1.94.1docker run --platform linux/arm64 ubuntu:20.04: ran the script's rustup bootstrap (--default-toolchain none --profile minimal), checkedrustup toolchain list(empty), ranrustc --versionin /tmp (no pin) and in /src (pinned), then checkedrustup show active-toolchainandrustup component list --installedFresh isolated RUSTUP_HOME/CARGO_HOME on the arm64 Mac, installed with--default-toolchain none:rustc --version,rustup show active-toolchain,rustup target list --installedin the worktreecargo build --release --target x86_64-apple-darwin -p codegraph-parser-apiwith the fresh pinned toolchaincargo build --release --target x86_64-apple-darwin -p codegraph-serverwith the fresh pinned toolchain, thenfileandarch -x86_64 codegraph-server --version✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.