← Back to issue list

rust plugin build fails due to wrong env var

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1852545
Type
issue
State
closed
Author
~luke-nimtz
Labels
plugin
Created
Updated
Closed

Current evaluation

Fixed in snapcore/snapcraft#2849 (commit 0b2fdb72b) by separating CARGO_HOME and RUSTUP_HOME; the change was tracked as part of Snapcraft 3.10.

Resolution: closed resolved

Reason: Commit 0b2fdb72b changed the Rust plugin to use distinct Cargo and rustup home directories, resolving the armhf destructive-mode component-download failure. The referenced fix is PR #2849, and maintainer Sergiuens confirmed it was part of Snapcraft 3.10.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The Rust plugin sets the RUSTUP_HOME env var to `~/.cargo` when it should probably be `~/.rustup`: https://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/rust.py#L234 This can cause the `~/.cargo/bin/rustup install stable` command to fail builds with `error: some components unavailable for download for channel stable: 'clippy', 'rustfmt'`. When running same command with RUSTUP_HOME set to `~/.rustup` it works fine.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed in snapcore/snapcraft#2849 (commit 0b2fdb72b) by separating CARGO_HOME and RUSTUP_HOME; the change was tracked as part of Snapcraft 3.10.
stealth/space-bunny-alpha — closed resolved Rust plugin set RUSTUP_HOME to ~/.cargo instead of ~/.rustup, breaking 'rustup install stable' (clippy/rustfmt unavailable). Closed as fixed in snapcraft 3.10 via PR #2849 (split RUSTUP_HOME/CARGO_HOME); related PR #2767 added the minimal rustup profile.
stealth/space-bunny-alpha — closed resolved Fixed in commit 0b2fdb72b by separating RUSTUP_HOME and CARGO_HOME, resolving the Rust plugin’s toolchain-component download failures.
qwen/qwen3.6-35b-a3b — — Closed. The Rust plugin incorrectly set RUSTUP_HOME to ~/.cargo instead of ~/.rustup, causing build failures. Resolved by correcting the environment variable path.
qwen/qwen3.6-35b-a3b — — Fixed the Rust plugin by correcting the RUSTUP_HOME environment variable from ~/.cargo to ~/.rustup, resolving the build failure. The report was closed after the fix.
qwen/qwen3.6-35b-a3b — — Closed without linked fix or comments. The report identified an incorrect RUSTUP_HOME environment variable in the Rust plugin causing build failures. No resolution or PR was provided, indicating the issue was likely abandoned.
qwen3.6-35b-a3b-mtp-q6 — — Fixed by correcting the Rust plugin's RUSTUP_HOME environment variable from ~/.cargo to ~/.rustup, resolving build failures caused by unavailable components.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcore/snapcraft#2849 (confidence 98%)

    Referenced fix PR for splitting RUSTUP_HOME and CARGO_HOME, implemented by commit 0b2fdb72b.

  • Related To: snapcore/snapcraft#2767 (confidence 86%)

    Related Rust plugin change that set the rustup profile to minimal.

Related issues

Issue Project State Summary Similarity
#2849 rust plugin: split RUSTUP_HOME and CARGO_HOME snapcraft merged Merged PR #2849 (commit 0b2fdb72b) separates RUSTUP_HOME (~/.rustup) from CARGO_HOME (~/.cargo), avoiding shared-directory side effects.
75%
#2158 rust plugin: fix cargo builds and run tests snapcraft closed PR closed as superseded: the rust-plugin-improvements branch was deleted and the work was reworked and merged as snapcore/snapcraft#2170 (commit 4f80a1051) after cargo test broke cross-compilation.
72%
#1990950 "Environment validation failed for part 'xsv': 'cargo' not found" with `base: core22` snapcraft (launchpad) open The core22 Rust plugin's false "cargo not found" failure is resolved: rustup support landed in Snapcraft #4297, followed by an explicit rust-deps validation fix in craft-parts 2.2.0.
70%
#1654764 The rust plugin is not using the Cargo.toml from the part dir snapcraft (launchpad) closed Fixed by snapcore/snapcraft#1035, merged as commit 3f3673536 "rust plugin: use the part source path", so the Rust plugin builds in the part source dir and Cargo.lock lands there instead of the repo.
70%