← Back to issue list

"Environment validation failed for part 'xsv': 'cargo' not found" with `base: core22`

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1990950
Type
issue
State
open
Author
~saviq
Labels
—
Created
Updated
Closed
—

Current evaluation

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.

Suggested action: close resolved

Reason: Snapcraft PR #4297 was merged as commit b357ef5e7, and the later craft-parts commit dc79714c (PR #903) explicitly improved Rust dependency validation. Craft-parts 2.2.0 and Snapcraft 8.6.0 document the rust-deps validation fix, and the current plugin handles rust-deps before validating cargo and rustc.

Evaluated by: mr-cal-bot

Impact: 40 Quick Win: 27 Complexity: 32 Confidence: 98 Actionability: 98

Issue body

1. git clone https://github.com/snapcraft-docs/xsv.git 2. cd xsv 3. sed -i 's/base:.*/base: core22/' snapcraft.yaml 4. snapcraft Launching instance... Environment validation failed for part 'xsv': 'cargo' not found and part 'xsv' does not depend on a part named 'rust-deps' that would satisfy the dependency. Full execution log: '/tmp/snapcraft.log' Traceback (most recent call last): File "/snap/snapcraft/8187/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 448, in _run_in_provider instance.execute_run(cmd, check=True, cwd=output_dir) File "/snap/snapcraft/8187/lib/python3.8/site-packages/craft_providers/lxd/lxd_instance.py", line 289, in execute_run return self.lxc.exec( File "/snap/snapcraft/8187/lib/python3.8/site-packages/craft_providers/lxd/lxc.py", line 329, in exec return runner(final_cmd, **kwargs) # pylint: disable=subprocess-run-check File "/snap/snapcraft/8187/usr/lib/python3.8/subprocess.py", line 516, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['lxc', '--project', 'snapcraft', 'exec', 'local:snapcraft-xsv-on-amd64-for-amd64-479080', '--cwd', '/root/project', '--', 'env', 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin', 'SNAPCRAFT_MANAGED_MODE=1', 'snapcraft', 'pack', '--build-for', 'amd64']' returned non-zero exit status 1.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 40
Quick Win: 27
Complexity: 32
Confidence: 98
Actionability: 98
close resolved 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.
stealth/space-bunny-alpha
Impact: 45
Quick Win: 22
Complexity: 45
Confidence: 86
Actionability: 88
close resolved Rust plugin on core22 failed env validation with "'cargo' not found" when using rust-deps; fixed in craft-parts (validation ordering) and shipped in Snapcraft 8.6.0. Issue left open since2023.
stealth/space-bunny-alpha
Impact: 40
Quick Win: 15
Complexity: 55
Confidence: 78
Actionability: 86
needs triage Rust packaging for xsv on core22 fails because cargo is missing during plugin validation; the exact reproducer is reported, but the unlabelled issue remains unassessed.
qwen3.6-35b-a3b-mtp-q6
Impact: 60
Quick Win: 36
Staleness: 85
Complexity: 40
Confidence: 65
Support Request: 50
needs triage Snapcraft fails with 'cargo not found' when building a Rust project with base: core22. Issue is unlabelled and has had no maintainer response in 1114 days.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 30
close stale Report of snapcraft build failure with core22 base due to missing cargo dependency. Issue has been inactive for over 3 years with no maintainer response or labels.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 45
Confidence: 90
Support Request: 20
close stale Snapcraft build fails with 'cargo' not found when using core22 base. Open for over 3 years with no maintainer interaction or updates.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 70
close stale Snapcraft build fails with core22 base due to missing cargo dependency. No maintainer response or comments in over three years.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/craft-parts#903 (confidence 99%)

    Commit dc79714c explicitly fixes Rust plugin dependency validation; the change is documented in craft-parts 2.2.0.

  • Related To: canonical/craft-parts#890 (confidence 95%)

    The Snapcraft changelog cites this craft-parts issue for the later rust-deps dependency-validation fix.

  • Likely Fixed By: snapcraft#4297 (confidence 90%)

    Merged as b357ef5e7; added rustup support and Rust plugin configuration after the reporter requested a fix.

Related issues

Issue Project State Summary Similarity
#1852545 rust plugin build fails due to wrong env var snapcraft (launchpad) closed Fixed in snapcore/snapcraft#2849 (commit 0b2fdb72b) by separating CARGO_HOME and RUSTUP_HOME; the change was tracked as part of Snapcraft 3.10.
70%