← Back to issue list

stage package cache no longer working

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1661383
Type
issue
State
closed
Author
~kyrofa
Labels
—
Created
Updated
Closed

Current evaluation

Stage-package cache reuse was restored: snapcraft PR #1122 (commit 20b422459, 'repo: cache stage packages for faster future use') merged, reusing cached debs and copying the apt cache into cleanbuild containers, closing LP #1661383.

Resolution: closed resolved

Reason: Maintainer kyrofa posted links to snapcore/snapcraft PR #1113 and then the 'better fix' PR #1122, which was merged as commit 20b422459 and reuses cached stage packages (plus copies the apt cache into cleanbuild containers), fixing the reported regression.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Snapcraft currently caches stage-packages. For example: $ snapcraft pull Preparing to pull ros-base Pulling ros-base Preparing to fetch compilers... Fetching compilers... Get:1 http://packages.ros.org/ros/ubuntu xenial InRelease [4025 B] Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB] Hit http://archive.ubuntu.com/ubuntu xenial InRelease Ign http://packages.ros.org/ros/ubuntu xenial InRelease Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB] Get:4 http://archive.ubuntu.com/ubuntu xenial-security InRelease [102 kB] Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [463 kB] Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [387 kB] Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [144 kB] Fetched 1,305 kB in 0s (0 B/s) Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 libgmp10 amd64 2:6.1.0+dfsg-2 [240 kB] Get:2 http://archive.ubuntu.com/ubuntu xenial/main amd64 libmpfr4 amd64 3.1.4-1 [191 kB] Get:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 libmpc3 amd64 1.0.3-1 [39.7 kB] <snip> Now check `~/.cache/snapcraft/apt/` and you'll see that snapcraft has cached all those debs. However, that cache doesn't seem to be used, as shown by this: $ snapcraft clean && snapcraft pull Cleaning up priming area Cleaning up staging area Cleaning up parts directory Preparing to pull ros-base Pulling ros-base Preparing to fetch compilers... Fetching compilers... Get:1 http://packages.ros.org/ros/ubuntu xenial InRelease [4025 B] Ign http://packages.ros.org/ros/ubuntu xenial InRelease Hit http://security.ubuntu.com/ubuntu xenial-security InRelease Hit http://archive.ubuntu.com/ubuntu xenial InRelease Hit http://archive.ubuntu.com/ubuntu xenial-updates InRelease Hit http://archive.ubuntu.com/ubuntu xenial-security InRelease Fetched 4,025 B in 0s (0 B/s) Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 libgmp10 amd64 2:6.1.0+dfsg-2 [240 kB] Get:2 http://archive.ubuntu.com/ubuntu xenial/main amd64 libmpfr4 amd64 3.1.4-1 [191 kB] Get:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 libmpc3 amd64 1.0.3-1 [39.7 kB] <snip> See that the packages are being downloaded again instead of being unpacked from the cache.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Stage-package cache reuse was restored: snapcraft PR #1122 (commit 20b422459, 'repo: cache stage packages for faster future use') merged, reusing cached debs and copying the apt cache into cleanbuild containers, closing LP #1661383.
stealth/space-bunny-alpha — closed resolved Stage-package cache reuse was restored by merged PR #1122 (commit 20b422459), including copying the cache into cleanbuild containers.
stealth/space-bunny-alpha — closed resolved Stage-package caching was repaired in merged PR canonical/snapcraft#1122 (commit 20b422459), which reused cached packages and copied the cache into cleanbuild.
stealth/space-bunny-alpha — closed resolved Cached stage packages were downloaded again after a clean. PR #1122 fixed cache reuse and was merged in commit 20b422459.
qwen/qwen3.6-35b-a3b — — Closed without resolution. Stage package cache regression remains unfixed, likely abandoned due to inactivity.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The stage package cache failure after clean operations was abandoned.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#1122 (confidence 97%)

    Merged PR 'repo: cache stage packages for faster future use' as commit 20b422459; directly referenced by the maintainer as the better fix and it fixes LP #1661383.

  • Superseded By: canonical/snapcraft#1113 (confidence 92%)

    Earlier attempt at the same fix, closed unmerged in favour of #1122.

  • Related To: snapcraft (launchpad)#1663051 (confidence 55%)

    Follow-up LP bug that the stage-package cache is never cleaned; remains open.

Related issues

Issue Project State Summary Similarity
#1612813 stage-package cache doesn't work on encrypted home if building snap outside of home snapcraft (launchpad) closed stage-package (deb) cache used hard links, breaking on encrypted homes across filesystem boundaries. Fixed by merged canonical/snapcraft PR #728 (commit 3d1835b5d), which switched the cache to common.link_or_copy with a copy fallback.
79%
#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.
79%
#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.
75%
#1663051 Stage package cache is never cleaned snapcraft (launchpad) open Open, triaged cache-growth bug: source-hash-specific stage-package caches grow without cleanup; maintainers proposed an apt-get clean-style reset, but no clearing command or fix is evident in the current tree.
72%
#1663365 Stage package fetching progress is useless snapcraft (launchpad) closed Fixed by merged snapcore/snapcraft#1949 (commit 54323e13b), restoring aggregate stage-package fetch progress while suppressing deb-cache output.
71%
#3110 repo: use persistent cache for fetching stage packages snapcraft closed PR #3110 (persistent cache for fetching stage packages) was closed unmerged with 0 reviews and 1 open maintainer question. Its dependency #3109 also closed unmerged; the feature was later delivered by merged PR #3585 (CRAFT-488) using host /var/lib/apt state.
71%
#1157 repo: support versioned stage-packages snapcraft merged Merged support for versioned stage-packages in canonical/snapcraft#1157 via commit ef4076821, resolving Launchpad bug #1666656.
70%