← Back to issue list

The rust plugin is not using the Cargo.toml from the part dir

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1654764
Type
issue
State
closed
Author
~elopio
Labels
plugin
Created
Updated
Closed

Current evaluation

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.

Resolution: closed resolved

Reason: Maintainer ~elopio linked PR snapcore/snapcraft#1035, which was merged as commit 3f3673536 changing the rust plugin to use the part source path; the Launchpad bug was then closed as fixed.

Evaluated by: mr-cal-bot

No scores available.

Issue body

When running the rust plugin, the repository will get a Cargo.lock file next to the Cargo.toml file. This Cargo.lock should be created instead in the parts/project/src directory, to keep the repository clean. This is a considerable problem, because if the Cargo.toml file changes, it is ignored because the Cargo.lock file stays outdated. To reproduce: cd integration_tests/snaps/simple-rust snapcraft ls Cargo.lock

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved 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.
stealth/space-bunny-alpha — closed resolved Rust plugin now uses the part source path, keeping Cargo.lock in the part directory. Merged in canonical/snapcraft#1035 via commit 3f3673536.
stealth/space-bunny-alpha — closed resolved Fixed in canonical/snapcraft#1035, merged as commit 3f3673536, by making the Rust plugin run Cargo from the part source directory.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The rust plugin incorrectly generated Cargo.lock in the repository root rather than the part directory, causing outdated lockfiles when Cargo.toml changed.
qwen/qwen3.6-35b-a3b — — Closed without comments or explicit resolution, likely abandoned or auto-closed due to inactivity. The report identified a bug where the rust plugin incorrectly generated Cargo.lock outside the part directory, causing outdated lock files when Cargo.toml changed.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#1035 (confidence 95%)

    Merged commit 3f3673536 'rust plugin: use the part source path (#1035)' is the cited fix

Related issues

Issue Project State Summary Similarity
#1685562 The rust plugin fails when using source_subdir snapcraft (launchpad) closed Rust plugin source-subdir handling was fixed by merged PR snapcore/snapcraft#1296 (commit 2c957a311), preventing pull-time Cargo.toml lookup failures.
81%
#1035 rust plugin: use the part source path snapcraft merged Merged PR #1035 as commit 3f3673536, updating the Rust plugin to use the part source path; it was rebased after sibling PR #1034 merged.
76%
#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%
#198 plugins: rust craft-parts merged Merged PR #198 (bb92a132) ported Snapcraft’s Rust plugin into craft-parts for CRAFT-955 after prerequisite test refactor #199.
71%
#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%