repo: only install build packages marked for installation
Metadata
Current evaluation
Merged a fix updating apt_cache.get_marked_packages() to exclude packages marked for deletion. The function now only returns packages intended for installation, letting apt handle removals. Approved and merged after passing CI.
Suggested action: —
No scores available.
Issue body
Ubuntu usage of apt_cache.get_marked_packages() assumes any
marked package is marked for installation. However, it may
contain packages marked for deletion.
Modify get_marked_packages() to get_packages_marked_for_installation()
to accurately capture the required build packages to install. Apt
will handle deletion as necessary.
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 |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix updating apt_cache.get_marked_packages() to exclude packages marked for deletion. The function now only returns packages intended for installation, letting apt handle removals. Approved and merged after passing CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix updating apt_cache.get_marked_packages() to get_packages_marked_for_installation(). This prevents including packages marked for deletion, ensuring only build packages intended for installation are captured while Apt handles removals. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix updating apt_cache.get_marked_packages() to only return packages marked for installation. This prevents incorrectly flagging build dependencies for deletion, as apt manages removals separately. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3086 repo: restore marked-install strategy for apt-cache | snapcraft | merged | Merged after approval and CI. Restores the marked-install strategy for apt-cache by refactoring AptCache for safe cache handling. Fixes a primed-stage-packages parsing bug and improves stage package dependency management. | |
| #891 repo: apt-mark new build-packages as automatically installed | snapcraft | merged | Merged. Marks new build packages as automatically installed to enable cleanup via apt-get autoremove. Approved, updated with integration tests, rebased to resolve conflicts, minor fixes applied, and merged. | |
| #3221 repo: install requested build-package versions | snapcraft | merged | Merged fix for unimplemented build-package version installation. Explicitly specifies apt package versions and enables downgrades to resolve LP: #1887960. Approved and passed CI checks. | |
| #1185 repo: add version support for build-packages | snapcraft | merged | Merged after adjusting apt_cache to exclude package versions, adding version support for build-packages. Rebased changes were re-applied and tests passed. Approved by two reviewers. | |
| #3177 repo: consider virtual pkgs for cache invalidation | snapcraft | merged | Merged. Updates cache invalidation to include virtual packages, adding a warning to discourage their use for deterministic builds. Refactors AptCache logic for better separation of concerns. Approved by one reviewer and passed CI. | |
| #1446 fix(apt_cache): set all candidate versions before marking packages | craft-parts | merged | Merged a fix for apt_cache splitting mark_packages into two passes. Pass one sets candidate versions, pass two marks packages, preventing resolver failures when dependency candidates differ. Resolves #1444. Approved and passed CI. | |
| #2023 repo: catch error due to broken build packages | snapcraft | merged | Resolved broken build package errors by introducing BuildPackagesNotInstalledError and falling back to apt-get for detailed conflict messages. Merged after reviewer approval and passing CI checks. |