repo: raise error when populating the apt cache directory fails
Metadata
Current evaluation
Merged PR #3983 in commit 341037573, making Snapcraft raise a clear error when /etc/apt cannot be copied into its cache (CRAFT-1421).
Resolution: closed resolved
Reason: PR #3983 was merged into main as commit 341037573. It added handling and tests for failures while populating the APT cache directory.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `make lint`?
- [X] Have you successfully run `pytest tests/unit`?
-----
If the contents of `/etc/apt` cannot be copied to the cache directory, snapcraft will now produce a helpful error.
This can occur on a system where Ubuntu Pro is enabled, snapcraft is run in destructive mode, and snapcraft is not being run with sudo nor as root.
(CRAFT-1421)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3983 in commit 341037573, making Snapcraft raise a clear error when /etc/apt cannot be copied into its cache (CRAFT-1421). | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3983 in commit 341037573, adding a clear error when /etc/apt cannot be copied into the APT cache, covering destructive-mode Ubuntu Pro failures (CRAFT-1421). | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3983 in commit 341037573, adding a helpful error when /etc/apt cannot be copied to the apt cache directory (CRAFT-1421). | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Adds a helpful error when copying /etc/apt to the cache directory fails, resolving CRAFT-1421. Handles Ubuntu Pro and destructive mode edge cases without root privileges. Approved by two reviewers and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Snapcraft now raises a clear error when copying /etc/apt to the cache directory fails, resolving CRAFT-1421 and improving error reporting in Ubuntu Pro destructive mode without root privileges. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4558 Provide better errors for failures to clear the apt cache | snapcraft | closed | Closed as superseded: Snapcraft 8.14 added a warning for destructive-mode runs as non-root (craft-application#974) instead of an apt-cache error; legacy apt_cache code later removed. | |
| #2030 Properly invalidate the cache if sources change | snapcraft | closed | Fixed by merged PR #2079 (commit d879b2e3a): Snapcraft now catches apt cache update failures and clears the package index on hash mismatches. | |
| #1499 repo: make errors based on SnapcraftError | snapcraft | merged | Merged PR #1499 in commit 827d7fd82, making repo errors inherit SnapcraftError so non-debug runs report handled errors instead of tracebacks. |