← Back to issue list

Snapcraft Rust Plugin Does not Respect Cargo.lock

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1862219
Type
issue
State
closed
Author
~zicklag
Labels
plugin rust
Created
Updated
Closed

Current evaluation

Rust plugin now honours Cargo.lock: merged snapcore/snapcraft#2915 (af326013a) passes --locked to cargo fetch/install, with pull-stage fix in #2917 (38928cd54); shipped in Snapcraft 3.10.

Resolution: closed resolved

Reason: PR #2915 (commit af326013a) made the rust plugin respect Cargo.lock via --locked, and follow-up PR #2917 (commit 38928cd54) corrected the pull step to fetch the locked crates. The issue was closed after confirming both landed on master/edge and shipped in Snapcraft 3.10.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Original forum topic: https://forum.snapcraft.io/t/does-snapcrafts-rust-plugin-respect-the-cargo-lock-file/14776?u=zicklag. I have a Rust project that is getting built with build.snapcraft.io service and I noticed that the automated builds are not respecting the `Cargo.lock` file that is included in my project's source. Instead, the snapcraft build is acting if the lock file was not there and using the latest updated versions of all of the crates declared in my `Cargo.toml` file. This causes problems because an updated dependency is getting used that causes the project not to compile. Granted, the fact that an updated dependency can cause a compile to fail on my project likely indicates that a crate I'm depending on is not correctly following semantic versioning, but regardless, the fact that snapcraft is not respecting the lock file could result in even harder to notice bugs because the snapcraft builds are going to be different than the builds made without snapcraft. For an example of the failure: build.snapcraft.io build log ( which failed ): https://build.snapcraft.io/user/katharostech/lucky/772273 my CI build log ( which succeeded ): https://cloud.drone.io/katharostech/lucky/259/1/2 The commit of my project: https://github.com/katharostech/lucky/tree/9079bbcb46bb8df4ed73c9a10f5eb6dc8f92772f

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Rust plugin now honours Cargo.lock: merged snapcore/snapcraft#2915 (af326013a) passes --locked to cargo fetch/install, with pull-stage fix in #2917 (38928cd54); shipped in Snapcraft 3.10.
stealth/space-bunny-alpha — closed resolved Rust plugin ignored Cargo.lock, causing builds.snapcraft.io to fail with newer deps. Fixed by merged PR snapcore/snapcraft#2915 (commit af326013a) passing --locked to cargo fetch/install, plus follow-up #2917 (38928cd54) for pull-step fetching. Landed on edge / snapcraft 3.10.
stealth/space-bunny-alpha — closed resolved Fixed in snapcore/snapcraft#2915 (af326013a), with pull-stage correction in #2917 (38928cd54); released in Snapcraft 3.10.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #2915 (af326013a), making the Rust plugin honor Cargo.lock with --locked. Follow-up #2917 (38928cd54) fixed locked-crate fetching during pull.
qwen/qwen3.6-35b-a3b — — Abandoned and closed without resolution due to inactivity. The Snapcraft Rust plugin continues to ignore Cargo.lock files, causing dependency version mismatches and build failures. No fix was implemented.
qwen/qwen3.6-35b-a3b — — Abandoned and closed without resolution. The Snapcraft Rust plugin continues to ignore Cargo.lock files, causing dependency resolution mismatches during automated builds.
qwen/qwen3.6-35b-a3b — — Closed with zero comments and no resolution details. The Snapcraft Rust plugin failure to respect Cargo.lock remains unaddressed and appears abandoned.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution. The report was abandoned due to inactivity, with no comments, fixes, or merge requests linked to address the Cargo.lock dependency resolution issue.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcore/snapcraft#2915 (confidence 97%)

    Merged commit af326013a 'rust plugin: respect Cargo.lock if present in project' passes --locked to cargo fetch and install.

  • Likely Fixed By: snapcore/snapcraft#2917 (confidence 90%)

    Follow-up merged commit 38928cd54 fixed the pull stage to check Cargo.lock in the source dir and fetch the locked crates; author noted he missed part of #2915.

  • Related To: snapcore/snapcraft#2842 (confidence 40%)

    Earlier rust plugin change (cd8c775f5) adding Cargo workspace support, touching lockfile handling in the same code area.

Related issues

Issue Project State Summary Similarity
#2915 rust plugin: respect Cargo.lock if present in project snapcraft merged Merged as af326013a: standard Rust builds use Cargo.lock by passing --locked to cargo fetch and install. Follow-up #2917 corrected pull-time dependency fetching.
74%