Update Rust plugin to be able to rebuild
Metadata
Current evaluation
Merged PR #2620 (commit 601bd2df7) added Cargo's --force option so Rust projects can rebuild without clearing the compiler cache; resolves LP #1825858.
Resolution: closed resolved
Reason: The approved change was merged as commit 601bd2df7. It updates the Rust plugin's Cargo install command with --force, enabling repeat builds while retaining the compiler cache.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Currently, when a user re-runs `snapcraft` against a Rust project, the compiler refuses to "re"-install the package, and crashes the build. This change adds the `--force` flag to the install command which tells the rust compiler to re-install the package. This does _not_ break the cargo compiler cache.
This PR resolves LP: [#1825858](https://bugs.launchpad.net/snapcraft/+bug/1825858)
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2620 (commit 601bd2df7) added Cargo's --force option so Rust projects can rebuild without clearing the compiler cache; resolves LP #1825858. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #2620 in commit 601bd2df7, adding --force to Cargo install so Rust projects can rebuild without clearing the compiler cache. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged as commit 601bd2df7, adding Cargo's --force flag so Rust projects can rebuild without clearing the compiler cache. | |
| stealth/space-bunny-alpha | — | closed resolved | PR #2620 merged (commit 601bd2df7, "rust plugin: add ability to rebuild"), adding --force to Cargo install so rust snaps can rebuild without clearing the compiler cache. Resolves LP #1825858. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2620 adds --force to Cargo install, allowing Rust snaps to rebuild without clearing the compiler cache; resolves LP #1825858. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged update adds the --force flag to the Rust plugin install command, preventing build crashes during rebuilds. Approved by reviewers, passed CI, and successfully merged to resolve Launchpad bug #1825858. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | PR #2620 merged adds the --force flag to the Rust plugin install command, preventing compiler crashes during snapcraft rebuilds and resolving Launchpad bug #1825858. Code coverage remains unchanged. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1825858 rust plugin crashes when trying to rebuild a snap package | snapcraft (launchpad) | closed | Rust plugin rebuilt via `cargo install` without `--force`, so re-running snapcraft failed. Fixed by merged PR snapcore/snapcraft#2620 (commit 601bd2df7), which adds `--force` to cargo args. | |
| #2434 rust plugin: refactor to use the latest rustup | snapcraft | merged | Merged PR #2434 in commit 3e821ca8d, updating the Rust plugin for current rustup, sharing toolchain storage, and adopting .cargo/config. |