fix(apt_cache): set all candidate versions before marking packages
Metadata
Current evaluation
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.
Suggested action: —
No scores available.
Issue body
Split mark_packages into two passes so that versioned interdependencies resolve correctly. Previously, candidate versions and mark_install were done in the same loop. When package A=v1 depends on package B (= v1) but B's default candidate is v2, mark_install fails because B's candidate has not been pinned yet.
Pass 1 now resolves names and calls _set_pkg_version for every package. Pass 2 calls mark_install on the already-pinned packages so the resolver sees the correct candidates for all dependencies.
Fixes #1444
- [x] Have you followed the guidelines for contributing?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? -- Note: login page appears to be broken. Emailed to legal@canonical.com
- [x] Have you successfully run `make lint && make test`?
- [x] Have you added an entry to the changelog (`docs/reference/changelog.rst`)?
---
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged apt_cache fix splitting mark_packages into two passes to resolve versioned interdependencies. First pass pins candidates, second marks installations. Resolves #1444. Lint warning for new test approved. |
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. | |
| #3411 repo: only install build packages marked for installation | snapcraft | merged | 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. |