Skip to content

fix(rustup): discover rustup at $CARGO_HOME/bin/rustup#1005

Merged
zackees merged 1 commit into
mainfrom
fix/rustup-discovery-cargo-bin
Jun 28, 2026
Merged

fix(rustup): discover rustup at $CARGO_HOME/bin/rustup#1005
zackees merged 1 commit into
mainfrom
fix/rustup-discovery-cargo-bin

Conversation

@zackees

@zackees zackees commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Surfaced while validating the FastLED/fbuild Linux → mac-arm64 cross-compile docker harness (FastLED/fbuild#771). soldr prepare was warning rustup target add failed: rustup target add: No such file or directory even though rustup was installed in the soldr-managed dir.

Root cause: discover_rustup() checks <paths.bin>/rustup but the rustup-init minimal-profile install actually puts rustup at <paths.root>/cargo/bin/rustup. The bootstrap copies the binary to <paths.bin>/ after install for fast discovery, but a fresh soldr toolchain ensure from a previous session can leave only the cargo/bin/ copy.

Fix: add the cargo/bin/ path as a third fallback in discover_rustup.

soldr-managed rustup-init installs rustup at
\`<paths.root>/cargo/bin/rustup\` (the minimal-profile install path).
The bootstrap *also* copies the binary to \`<paths.bin>/rustup\` for
discoverability, but a fresh \`soldr toolchain ensure\` from a previous
session can leave only the cargo/bin/ copy.

Without this fix, \`discover_rustup()\` misses the cargo/bin/ install
and \`soldr prepare\` (and any other command that uses the cheap
discovery path) falls back to literal \`"rustup"\` on PATH — which
fails on a fresh container where PATH was never updated to include
\`<paths.root>/cargo/bin\`.

Symptom: \`soldr prepare\` prints
\`warning: rustup target add failed: rustup target add: No such file or directory (os error 2)\`
even though rustup is installed in soldr's managed dir.

Repro: clean docker (no PATH-side rustup), then
\`soldr toolchain ensure && soldr prepare --target aarch64-apple-darwin\`.
Surfaced while validating the FastLED/fbuild Linux → mac-arm64
cross-compile docker harness.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zackees zackees merged commit 11e8da9 into main Jun 28, 2026
11 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant