Cannot build snaps in a 32-bit armhf container when running an arm64 kernel
Metadata
Current evaluation
Fixed in Snapcraft 9.1 by PR #6394 (commit e5164048), adding armv8l support so a 32-bit ARM userspace on an ARM64 kernel maps to armhf.
Resolution: closed resolved
Reason: Snapcraft PR #6394, merged as commit e5164048, added armv8l recognition and ARMHF mapping; the Snapcraft 9.1 release notes explicitly document this support. Craft-parts PR #697 also added armv8l handling in ProjectInfo.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Running Snapcraft inside of an armhf LXD container running on an arm64 host produces the following error:
---
$ sudo snapcraft --destructive-mode
Traceback (most recent call last):
File "/snap/snapcraft/8062/bin/snapcraft", line 8, in <module>
sys.exit(run())
File "/snap/snapcraft/8062/lib/python3.8/site-packages/snapcraft/cli.py", line 186, in run
_run_dispatcher(dispatcher)
File "/snap/snapcraft/8062/lib/python3.8/site-packages/snapcraft/cli.py", line 175, in _run_dispatcher
dispatcher.run()
File "/snap/snapcraft/8062/lib/python3.8/site-packages/craft_cli/dispatcher.py", line 419, in run
return self._loaded_command.run(self._parsed_command_args)
File "/snap/snapcraft/8062/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 235, in run
super().run(parsed_args)
File "/snap/snapcraft/8062/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 108, in run
parts_lifecycle.run(self.name, parsed_args)
File "/snap/snapcraft/8062/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 193, in run
_expand_environment(
File "/snap/snapcraft/8062/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 513, in _expand_environment
info = craft_parts.ProjectInfo(
File "/snap/snapcraft/8062/lib/python3.8/site-packages/craft_parts/infos.py", line 88, in __init__
self._set_machine(arch)
File "/snap/snapcraft/8062/lib/python3.8/site-packages/craft_parts/infos.py", line 264, in _set_machine
raise errors.InvalidArchitecture(self._host_arch)
craft_parts.errors.InvalidArchitecture: Architecture 'armv8l' is not supported.
Make sure the architecture name is correct.
---
Expected behavious:
This should build an armhf snap, but instead it fails out due to the architecture detection.
System information:
$ dpkg --print-architecture
armhf
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
$ snapcraft version
snapcraft 7.1.1
$ uname -m
armv8l
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed in Snapcraft 9.1 by PR #6394 (commit e5164048), adding armv8l support so a 32-bit ARM userspace on an ARM64 kernel maps to armhf. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in Snapcraft 9.1 by merged PR #6394 (commit e51640488), mapping armv8l to armv7l so armhf containers on arm64 kernels can build snaps. | |
| qwen/qwen3.6-35b-a3b | — | — | Snapcraft failed to build armhf snaps in armhf containers on arm64 hosts due to unsupported armv8l architecture detection. The issue was resolved in Snapcraft 9.1 by adding native armv8l support, enabling successful builds in this configuration. | |
| qwen3.6-35b-a3b-mtp-q6 |
Impact:
75
Quick Win:
41
Staleness:
95
Complexity:
45
Confidence:
90
Support Request:
0
|
close stale | armhf container on arm64 kernel fails with InvalidArchitecture: 'armv8l' not supported. Fixed in snapcraft 9.1 via PR #6394 and craft-parts #697. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
92
Complexity:
50
Confidence:
88
Support Request:
5
|
close stale | Bug report detailing a crash in snapcraft 7.1.1 when building armhf snaps in an armhf LXD container on an arm64 host due to unsupported architecture detection. Issue remains untriaged and inactive for nearly four years. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
45
Confidence:
85
Support Request:
10
|
close stale | snapcraft crashes with InvalidArchitecture error when building armhf snaps in an armhf LXD container on an arm64 host. Issue is four years old, unlabelled, and has no maintainer engagement. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
45
Confidence:
85
Support Request:
15
|
close stale | Unresolved crash in snapcraft v7.1.1 when building armhf snaps in an arm64 container due to architecture detection failing on 'armv8l'. No maintainer interaction in over four years. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/snapcraft#6394
(confidence 100%)
Merged commit e5164048 added armv8l support and documented it for Snapcraft 9.1.
-
Likely Fixed By:
canonical/craft-parts#697
(confidence 98%)
Commit 83679d41 added armv8l mapping in ProjectInfo, where the original InvalidArchitecture error originated.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4627 Cannot build snaps in a 32-bit armhf container when running an arm64 kernel | snapcraft | closed | Fixed in Snapcraft 9.1 by merged PR #6394 (commit e51640488), which maps armv8l to armv7l for armhf container builds on arm64 kernels. | |
| #5638 Snapcraft fails to run on 32bit userspace container on 64bit ARM kernel. | snapcraft | closed | Fixed by merged PR #6394 (commit e51640488): Snapcraft now maps armv8l to armv7l, supporting ARMHF builds in 32-bit ARM userspace on 64-bit ARM kernels. | |
| #655 "Architecture not supported" error in a armhf container on arm64 host | craft-parts | closed | Added armv8l-to-armv7l support in craft-parts PR #697 (83679d41); Snapcraft PR #6394 (e51640488) delivered the fix in version 9.1. | |
| #1641123 snapcraft does not properly detect the architecture when kernel is 64 bits but userspace is 32 | snapcraft (launchpad) | closed | Fixed in snapcore/snapcraft#1089 by deriving the build architecture from the compiler target, preventing 32-bit ARM artifacts from being mislabeled arm64. | |
| #5132 push of locally built snap fails on arm64 device | snapcraft | closed | Fixed in Snapcraft 8.6 by merged PR #5136 (commit 2e7f5c3b), which migrated Snapcraft to core24 and updated bundled unsquashfs to 4.6.1; overlapping PR #5147 was closed. | |
| #331 feat(snap): build on arm64 | fetch-service | merged | Merged PR #331 via commit 1847b25, adding arm64 to the Snap build platforms. | |
| #1175 fix: map armv8l to armhf (#1174) | craft-application | merged | Merged #1175 brought in #1174 (commit 7d75d877), mapping armv8l hosts to armhf and preparing craft-application 7.2.1 for the Snapcraft 9.1.1 hotfix. | |
| #1650458 snaps tests fail in armhf | snapcraft (launchpad) | closed | Armhf snap test builds were fixed by snapcore/snapcraft#990, merged as f467e55bc; installation testing remained deferred because runners used LXC. |