rust plugin: fetch correct (locked) crates during pull
Metadata
Current evaluation
Merged PR #2917 (commit 38928cd54) fixed Rust pull-time crate fetching by checking Cargo.lock in the source directory and strengthened the spread test.
Resolution: closed resolved
Reason: The merged change in PR #2917, commit 38928cd54, corrected the pull-time logic from #2915 to use the source directory's Cargo.lock, ensuring locked crate versions are fetched.
Evaluated by: mr-cal-bot
No scores available.
Issue body
The previous PR was checking against the existence of the
Cargo.lock in builddir, which does not work at pull time.
So snapcraft it fetched the incorrect crate verisons at pull
time, but still built against the correct versions at build time.
Check for Cargo.lock in the source directory instead of the build
directory. This will work anytime after the rust project's sources
have been fetched.
Improve the spread test to hopefully capture this error by
ensuring that "time" is downloaded only once.
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2917 (commit 38928cd54) fixed Rust pull-time crate fetching by checking Cargo.lock in the source directory and strengthened the spread test. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2917 fixed the Rust plugin’s pull-time crate fetching by checking Cargo.lock in the source tree; commit 38928cd54 also strengthened the spread test. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2917 fixed Rust plugin pull-time crate fetching by checking for Cargo.lock in the source directory, with a spread test ensuring the locked “time” crate is fetched once. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for the rust plugin that corrected crate version fetching during pull by checking for Cargo.lock in the source directory instead of the build directory. Updated spread test to prevent regression. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for the Rust plugin to fetch correct locked crate versions during pull. Changed Cargo.lock detection from the build directory to the source directory. Updated spread test to prevent regression. |
Update history
No update history recorded yet.
Related work
-
Caused By:
snapcraft#2915
(confidence 99%)
The earlier merged implementation checked Cargo.lock in the wrong directory, prompting this corrective follow-up.
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. |