The rust plugin fails when using source_subdir
Metadata
Current evaluation
Rust plugin source-subdir handling was fixed by merged PR snapcore/snapcraft#1296 (commit 2c957a311), preventing pull-time Cargo.toml lookup failures.
Resolution: closed resolved
Reason: PR snapcore/snapcraft#1296 was merged as commit 2c957a311, updating the Rust plugin to use source-subdir correctly without failing during pull.
Evaluated by: mr-cal-bot
No scores available.
Issue body
When trying to make a rust snap that has uses source-subdir, it fails during fetch:
/home/ubuntu/workspace/canonical/snapcraft/integration_tests/snaps/rust-subdir/parts/rust-subdir/rust/bin/cargo fetch --manifest-path /home/ubuntu/workspace/canonical/snapcraft/integration_tests/snaps/rust-subdir/parts/rust-subdir/src/Cargo.toml
error: manifest path `/home/ubuntu/workspace/canonical/snapcraft/integration_tests/snaps/rust-subdir/parts/rust-subdir/src/Cargo.toml` does not exist
It's looking for the Cargo.toml file in source, not in source-subdir.
Steps to reproduce:
Go to integration_tests/snaps/rust-subdir
Edit the snapcraft.yaml to have:
source: .
source-subdir: subdir
Run snapcraft
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Rust plugin source-subdir handling was fixed by merged PR snapcore/snapcraft#1296 (commit 2c957a311), preventing pull-time Cargo.toml lookup failures. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed Rust plugin source-subdir handling; snapcraft#1296 merged in commit 2c957a311 and resolved Cargo.toml lookup failures. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #1296, commit 2c957a311, which made Rust pulls use source-subdir so Cargo.toml is found. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned due to inactivity. The Rust plugin failed to locate Cargo.toml when source_subdir was specified, causing fetch errors. No fix was implemented. | |
| qwen/qwen3.6-35b-a3b | — | — | Rust plugin failure with source-subdir was closed without comments or resolution, indicating abandonment. No fix or merge details were provided. | |
| qwen/qwen3.6-35b-a3b | — | — | Rust plugin source_subdir path resolution failure was closed without resolution. No comments or fixes were provided, indicating the report was abandoned. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Abandoned. The Rust plugin incorrectly resolved Cargo.toml paths when source-subdir was specified, causing cargo fetch failures. No comments or resolution were provided. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#1296
(confidence 100%)
Commit 2c957a311 implements the source-subdir fix and closed the reported failure.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. | |
| #1296 rust snaps can now use source-subdir without failing on pull | snapcraft | merged | Merged PR #1296 fixed Rust plugin pull failures with source-subdir in commit 2c957a311. | |
| #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. |