build-packages doesn't support specifying a version
Metadata
Current evaluation
Versioned build-packages support was merged in snapcraft#1185 (0405cb87e), with follow-up 8eb2eb6 restoring installed-package version checks.
Resolution: closed resolved
Reason: PR snapcraft#1185 was merged as commit 0405cb87e and added version-aware build-package handling. Follow-up commit 8eb2eb6 restored version checks lost during a rebase, resolving the reported apt-cache KeyError.
Evaluated by: mr-cal-bot
No scores available.
Issue body
There is no way to install a specific version of a build-package.
KeyError: 'make=4.1-6'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apt/cache.py", line 198, in __getitem__
rawpkg = self._cache[key]
KeyError: 'make=4.1-6'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/josepht/src/git/snapcraft/snapcraft/internal/repo.py", line 86, in install_build_packages
if not apt_cache[pkg].installed:
File "/usr/lib/python3/dist-packages/apt/cache.py", line 200, in __getitem__
raise KeyError('The cache has no package named %r' % key)
KeyError: "The cache has no package named 'make=4.1-6'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../../../bin/snapcraft", line 31, in <module>
snapcraft.main.main()
File "/home/josepht/src/git/snapcraft/snapcraft/main.py", line 244, in main
return run(args, project_options)
File "/home/josepht/src/git/snapcraft/snapcraft/main.py", line 280, in run
lifecycle_command, project_options, args['<part>'])
File "/home/josepht/src/git/snapcraft/snapcraft/internal/lifecycle.py", line 111, in execute
build_packages = repo.install_build_packages(config.build_tools)
File "/home/josepht/src/git/snapcraft/snapcraft/internal/repo.py", line 91, in install_build_packages
'\'build-packages\': {}'.format(str(e)))
OSError: Could not find a required package in 'build-packages': "The cache has no package named 'make=4.1-6'"
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Versioned build-packages support was merged in snapcraft#1185 (0405cb87e), with follow-up 8eb2eb6 restoring installed-package version checks. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by PR #1185, merged as commit 0405cb87e, adding version support for build-packages. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by snapcraft#1185, merged as commit 0405cb87e, adding version support for build-packages. | |
| stealth/space-bunny-alpha | — | closed resolved | Versioned build-packages support was merged in snapcraft#1185 (commit 0405cb87e), allowing specifications such as make=4.1-6. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. Closed without comments or documented resolution. Snapcraft does not support version pinning in build-packages due to underlying apt cache limitations. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. Specifying versions in build-packages causes a KeyError during installation. The feature remains unsupported. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as abandoned due to zero comments and prolonged inactivity. Version pinning for build-packages was not implemented. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution or comments, indicating abandonment. Build-packages failed when specifying package versions due to an apt cache KeyError. No fix or merge was implemented. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcraft#1185
(confidence 100%)
Merged PR adding version support for build-packages.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1185 repo: add version support for build-packages | snapcraft | merged | Merged build-package version support in snapcraft#1185 (commit 0405cb87e); follow-up 8eb2eb6 restored package version checks lost during a rebase. | |
| #1666656 stage-packages doesn't support versions | snapcraft (launchpad) | closed | Fixed in canonical/snapcraft#1157, merged as commit ef4076821 ('repo: support versioned stage-packages'), adding version-specifier support so entries like hello=2.10-1 resolve instead of erroring. |