← Back to issue list

snapcraft requires optional VERSION_ID in os-release

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1722650
Type
issue
State
closed
Author
~dichro
Labels
bitesize
Created
Updated
Closed

Current evaluation

Fixed by merged PR snapcore/snapcraft#1623 (commit b335ed471), removing the required os-release VERSION_ID; PR #1636 further improved host OS detection.

Resolution: closed resolved

Reason: Merged PR snapcore/snapcraft#1623, commit b335ed471, removed Snapcraft's dependency on os-release VERSION_ID and resolved the KeyError. Follow-up PR #1636 added more graceful host OS detection.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Trying to build a snap on my Debian system fails with: File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 770, in _find_dependencies dependencies += libraries.get_dependencies(elf_file) File "/usr/lib/python3/dist-packages/snapcraft/internal/libraries.py", line 100, in get_dependencies system_libs = _get_system_libs() File "/usr/lib/python3/dist-packages/snapcraft/internal/libraries.py", line 69, in _get_system_libs release = common.get_os_release_info()['VERSION_ID'] KeyError: 'VERSION_ID' miki@slab:~/c/rtl_433$ uname -a Linux slab 4.12.0-2-amd64 #1 SMP Debian 4.12.13-1 (2017-09-19) x86_64 GNU/Linux miki@slab:~/c/rtl_433$ /etc/os-release does not contain a VERSION_ID. Adding one allows snapcraft to run successfully, however os-release(5) states that VERSION_ID is optional. Is there something else that this value could be defaulted to?

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR snapcore/snapcraft#1623 (commit b335ed471), removing the required os-release VERSION_ID; PR #1636 further improved host OS detection.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #1623 (b335ed471), removing Snapcraft's required os-release VERSION_ID; PR #1636 also improved graceful host OS detection.
stealth/space-bunny-alpha — closed resolved Fixed: snapcraft crashed with KeyError 'VERSION_ID' on distros without it in /etc/os-release. Resolved by PR #1636, merged as commit a25cfcc12 ('internal: more gracefully determine host OS').
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #1623: Snapcraft no longer requires os-release VERSION_ID; its absence now means there is no shared-library exclusion file.
qwen/qwen3.6-35b-a3b — — Closed and abandoned without resolution. Snapcraft crashed with a KeyError when /etc/os-release lacked the optional VERSION_ID field. No fixes or comments were provided.
qwen/qwen3.6-35b-a3b — — Abandoned due to inactivity. Reports a KeyError when VERSION_ID is missing from os-release. Snapcraft was later updated to safely handle optional fields.
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments, indicating abandonment. The KeyError was later resolved in upstream Snapcraft by updating os-release parsing to safely handle missing optional fields.
qwen3.6-35b-a3b-mtp-q6 — — Closed and abandoned due to inactivity. No resolution was provided to handle the optional VERSION_ID field, leaving the compatibility issue unaddressed.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcore/snapcraft#1623 (confidence 100%)

    Merged fix in commit b335ed471 removed the VERSION_ID requirement.

  • Likely Fixed By: snapcore/snapcraft#1636 (confidence 95%)

    Merged follow-up in commit a25cfcc12 improved graceful host OS detection.

Related issues

Issue Project State Summary Similarity
#3646 utils: gracefully determine host os (CRAFT-845) snapcraft merged PR #3646 (CRAFT-845) merged into snapcraft/7.0 as commit dcee4f58, forward-porting commit a25cfcc from #1636: added snapcraft/os_release.py with an OsRelease class for graceful /etc/os-release parsing and codename fallbacks.
74%