Skip to content

fix(release): rustup target add to defeat workspace toolchain pin#124

Merged
noahgift merged 1 commit into
mainfrom
fix/musl-target-via-rustup
Apr 27, 2026
Merged

fix(release): rustup target add to defeat workspace toolchain pin#124
noahgift merged 1 commit into
mainfrom
fix/musl-target-via-rustup

Conversation

@noahgift
Copy link
Copy Markdown
Contributor

Summary

forjar v1.3.0 backfill ran 4 jobs; 3 succeeded but x86_64-unknown-linux-musl failed mid-build with:

error[E0463]: can't find crate for `core`

Root cause (Five Whys):

  1. cargo build with --target x86_64-unknown-linux-musl couldn't find core
  2. because the target wasn't installed in the active toolchain
  3. because rust-toolchain.toml pins channel = "1.93.0" with no targets list
  4. and that toolchain is the active one whenever cargo runs in the workspace tree
  5. and dtolnay/rust-toolchain@stable's `targets:` parameter installs the target into the action's toolchain (stable), not the workspace-pinned one

Fix: add an explicit `rustup target add ${{ matrix.target }}` step after the dtolnay step. Skip when matrix.cross=true (cross uses its own Docker image).

Test plan

  • forjar v1.3.0 backfill x86_64-musl was failing at "Build forjar" step — diagnosed via run 25003882860 logs
  • Backfill v1.3.0 again after merge to confirm 4/4 succeeds

🤖 Generated with Claude Code

rust-toolchain.toml pins channel 1.93.0 with no target list. The
dtolnay/rust-toolchain action's `targets:` parameter installs the
target into the action's chosen toolchain, but cargo running inside
the workspace honors rust-toolchain.toml and ends up with a toolchain
that's missing x86_64-unknown-linux-musl — so the native musl build
fails mid-compile with "can't find crate for core".

Add an explicit `rustup target add ${{ matrix.target }}` after the
dtolnay step so the pinned toolchain gets the target too. Skip when
matrix.cross=true since cross builds inside its own Docker image and
doesn't need host targets.

Refs: forjar v1.3.0 backfill x86_64-musl failure (run 25003882860).
@noahgift noahgift merged commit e99a12d into main Apr 27, 2026
14 checks passed
@noahgift noahgift deleted the fix/musl-target-via-rustup branch April 27, 2026 15:46
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