← Back to issue list

fix(apt_cache): set all candidate versions before marking packages

View original Github issue

Metadata

Project
craft-parts
Number
#1446
Type
pull request
State
merged
Author
EddyPronk
Labels
—
Created
Updated
Closed

Current evaluation

Merged as commit cf118b5f: apt_cache.mark_packages split into two passes so candidate versions are pinned before mark_install, fixing versioned interdependency resolution. Closes craft-parts#1444.

Resolution: closed resolved

Reason: PR #1446 was approved by two reviewers and merged as commit cf118b5f ('fix(apt_cache): set all candidate versions before marking packages (#1446)'). Pass 1 resolves names and calls _set_pkg_version for all packages, pass 2 calls mark_install on already-pinned packages, fixing the bug reported in craft-parts#1444, which this PR states it fixes.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed resolved Merged as commit cf118b5f: apt_cache.mark_packages split into two passes so candidate versions are pinned before mark_install, fixing versioned interdependency resolution. Closes craft-parts#1444.
stealth/space-bunny-alpha — closed resolved Merged craft-parts#1446 (commit cf118b5f), splitting apt_cache.mark_packages into version-pinning and installation-marking passes to fix versioned dependency resolution in #1444.
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 work

  • Likely Fixed By: canonical/craft-parts#1444 (confidence 95%)

    Issue 'Marking deb packages fails with versioned interdependencies'; the PR body declares 'Fixes #1444' and implements exactly that two-pass fix, merged in cf118b5f.

Related issues

Issue Project State Summary Similarity
#3528 apt cache: improve error handling when packages do not have candidates available (CRAFT-136) (CRAFT-218) snapcraft merged Merged #3528, adding missing APT candidate checks and limiting unmarking to relevant packages, preventing crashes when repositories expose no candidate.
74%