← Back to issue list

repo: drop _AptCache and add migrate to install_stage_packages()

View original Github issue

Metadata

Project
snapcraft
Number
#3030
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

Merged in PR #3030 as commit 66467629d, replacing custom _AptCache handling with install_stage_packages() and updating package staging, tests, and ROS plugins.

Resolution: closed resolved

Reason: PR #3030 was merged as commit 66467629d. It removed the custom APT cache implementation, consolidated package staging in install_stage_packages(), and migrated affected plugins and tests.

Evaluated by: mr-cal-bot

No scores available.

Issue body

This does remove the broken dependency handling... I need a working test case to make sure that's solid. - Move repo.get_pkg_name_parts to test_base, even though it's in __init__. - Remove all instance methods from repo and Ubuntu, consolidating to install_stage_packages() classmethod. - Move non-class methods in Repo into Repo class so they can be easily inherited. - Remove custom _AptCache implementation. - Use a single instance of the system's apt cache, which should improve performance due to the penalty of recreating caches in numerous points. It also simplifies usage without the requirement of copying/sharing instances for what is (now) a system-wide resource. - Remove old scheme for gathering stage packages, and simply do a scan ourselves for the packages and their dependencies. Then fetch them using python-apt's fetch_binary(). - Rework apt tests. - Rework of the ROS plugins to remove their current usage of Ubuntu and replace it with install_stage_packages(). 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
stealth/space-bunny-alpha — closed resolved Merged in PR #3030 as commit 66467629d, replacing custom _AptCache handling with install_stage_packages() and updating package staging, tests, and ROS plugins.
stealth/space-bunny-alpha — closed resolved Merged PR #3030 (commit 66467629d): removed the custom _AptCache, switched to the system apt cache with fetch_binary(), and consolidated stage-package installation into Repo.install_stage_packages(); apt tests and ROS plugins reworked.
stealth/space-bunny-alpha — closed resolved Merged #3030 (66467629d), replacing custom _AptCache with the system apt cache and consolidating stage-package installation into Repo.install_stage_packages().
qwen/qwen3.6-35b-a3b — — Merged refactoring removing _AptCache and consolidating repo logic into install_stage_packages(). Uses system apt cache for performance, updates tests, and migrates ROS plugins. Approved; +490/-1009 lines across 18 files.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Replaced _AptCache with a system apt cache to improve performance. Consolidated repository methods into install_stage_packages(), removed legacy package gathering logic, and updated tests and ROS plugins.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#3047 (confidence 95%)

    Follow-up PR #3047 fixed return-value handling for install_stage_packages().

  • Related To: snapcraft#3086 (confidence 90%)

    Follow-up PR #3086 restored marked-install handling for build and stage packages.

Related issues

Issue Project State Summary Similarity
#3086 repo: restore marked-install strategy for apt-cache snapcraft merged Merged PR #3086 (17cc75aae), restoring AptCache marked installs for build and stage packages and fixing primed-stage-packages name/version parsing from ':' to '='.
74%
#2119 repo: automatically prune unneeded stage-packages snapcraft merged Merged as b9faf80bd, adding APT cache analysis to remove automatically installed stage-packages left unneeded after alternative dependency resolution.
74%
#1122 repo: cache stage packages for faster future use. snapcraft merged Merged PR #1122 (20b422459), reusing cached stage packages and copying the apt cache into cleanbuild containers to fix LP #1661383.
72%
#43 packages: add support to apt cache operations craft-parts merged Merged PR #43 via 115ae066, adding APT cache operations for package retrieval. Implementation commit: 3ee0c477.
72%
#1113 repo: cache stage packages for faster future use. snapcraft closed Closed unmerged in favor of #1122, which merged the stage-package caching and cleanbuild improvements as commit 20b422459.
70%