lifecycle: automatically stage dependencies
Metadata
Current evaluation
Merged PR #2144 resolves LP: #1774018 by automatically staging dependencies when a part depends on another, preventing a RuntimeError during snapcraft pull. Approved, passed CI, and achieved 100% diff coverage.
Suggested action: —
No scores available.
Issue body
- [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] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh unit`?
-----
Take the following situation: we have two parts, `A` and `B`. `A` depends on `B` by way of having `after: [B]`. Today, if one runs `snapcraft pull A`, the snapcraft CLI errors out complaining that it needs to stage `B` first, requiring one to run `snapcraft pull A B`. Not only is this an error, it's a `RuntimeError`, causing a traceback.
This PR fixes [LP: #1774018](https://bugs.launchpad.net/snapcraft/+bug/1774018) by no longer erroring in this situation, and just staging `B` like the user wants.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged PR #2144 resolves LP: #1774018 by automatically staging dependencies when a part depends on another, preventing a RuntimeError during snapcraft pull. Approved, passed CI, and achieved 100% diff coverage. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master. Automatically stages dependencies when pulling a part, resolving a RuntimeError that previously required manual dependency staging. Fixes Launchpad bug #1774018. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master. Automatically stages dependencies when pulling a part, eliminating a RuntimeError that previously required manual staging. Resolves LP: #1774018. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3641 lifecycle: fix behavior for core22-step-dependencies (CRAFT-733) | snapcraft | merged | Merged fix for core22-step-dependencies lifecycle behavior. Corrected PULL dependencies being incorrectly treated as STAGE, which caused unwanted re-pulling. Approved, passed CI, and merged into main as commit aa8e685. | |
| #3610 lifecycle: do not stage deps for pull on core20 (CRAFT-725) | snapcraft | merged | Merged to stop staging dependencies for the pull step on core20, aligning with Plugins V2. A reviewer reported a regression breaking telegram-desktop snap builds, but the change was still merged. | |
| #237 feat(lifecycle): always track stage packages | craft-application | merged | Merged to always track stage packages in the lifecycle. Approved by three reviewers with zero unresolved comments. The single-line change was validated for compatibility with craft-application-based Snapcraft. | |
| #2119 repo: automatically prune unneeded stage-packages | snapcraft | merged | Merged a fix that automatically prunes unneeded stage-packages from snaps by crawling the apt cache to remove orphaned dependencies from alternative resolution and conflict handling. Approved and passed CI. |