"Architecture not supported" error in a armhf container on arm64 host
Metadata
Current evaluation
Added armv8l-to-armv7l support in craft-parts PR #697 (83679d41); Snapcraft PR #6394 (e51640488) delivered the fix in version 9.1.
Resolution: closed resolved
Reason: The architecture mapping was implemented and merged in craft-parts PR #697, commit 83679d41. Snapcraft integrated it through PR #6394, commit e51640488, resolving the unsupported armv8l error.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
Snapcraft assumes the kernel architecture is the userspace architecture.
```
craft_parts.errors.InvalidArchitecture: Architecture 'armv8l' is not supported.
Make sure the architecture name is correct.
```
### To Reproduce
On e.g. a Raspberry Pi:
```
$ lxc launch jammy/armhf jammy-armhf
$ lxc shell jammy-armhf
$ snapcraft
### part yaml
_No response_
### Relevant log output
```shell
$ snapcraft --verbose --destructive-mode
Starting Snapcraft 8.0.2
Logging execution to '/root/.local/state/snapcraft/log/snapcraft-20240208-122038.888225.log'
Running on armhf for armhf T
raceback (most recent call last):
File "/snap/snapcraft/10428/bin/snapcraft", line 8, in <module>
sys.exit(run())
File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/cli.py", line 258, in run
_run_dispatcher(dispatcher, global_args)
File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/cli.py", line 230, in _run_dispatcher
dispatcher.run()
File "/snap/snapcraft/10428/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 487, in run
return self._loaded_command.run(self._parsed_command_args)
File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/commands/lifecycle.py", line 265, in run
super().run(parsed_args)
File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/commands/lifecycle.py", line 138, in run
parts_lifecycle.run(self.name, parsed_args)
File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 97, in run
_expand_environment(
File "/snap/snapcraft/10428/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 616, in _expand_environment
info = craft_parts.ProjectInfo(
File "/snap/snapcraft/10428/lib/python3.10/site-packages/craft_parts/infos.py", line 97, in __init__
self._set_machine(arch)
File "/snap/snapcraft/10428/lib/python3.10/site-packages/craft_parts/infos.py", line 310, 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.
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Added armv8l-to-armv7l support in craft-parts PR #697 (83679d41); Snapcraft PR #6394 (e51640488) delivered the fix in version 9.1. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in Snapcraft 9.1 by merged PR #6394 (e51640488), adding armv8l-to-armv7l handling; craft-parts support had earlier landed in #697 (83679d41). | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without a public fix. Synced to internal Jira ticket CRAFT-2947 for tracking. The architecture mismatch handling remains unaddressed. | |
| qwen/qwen3.8-27b |
Impact:
50
Quick Win:
38
Staleness:
75
Complexity:
25
Confidence:
82
Support Request:
5
|
close stale | Snapcraft crashes with InvalidArchitecture 'armv8l' when run in an armhf container on an arm64 host. The bug is in craft-parts' architecture mapping. Fixed in craft-parts PR #697 which added armv8l to the platform machine variations map. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
90
Complexity:
65
Confidence:
85
Support Request:
15
|
close stale | Snapcraft fails with InvalidArchitecture error when running an armhf container on an arm64 host due to kernel/userspace architecture mismatch. Issue is triaged but inactive for over 10 months. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
85
Complexity:
60
Confidence:
75
Support Request:
10
|
close stale | Snapcraft fails with InvalidArchitecture error when running armhf container on arm64 host due to kernel/userspace architecture mismatch. Currently triaged but inactive. |
Update history
| Date | Change |
|---|---|
| closed |
Related work
-
Likely Fixed By:
canonical/craft-parts#697
(confidence 100%)
Added armv8l architecture support in commit 83679d41.
-
Likely Fixed By:
canonical/snapcraft#6394
(confidence 98%)
Delivered the craft-parts fix in Snapcraft 9.1 via commit e51640488.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1987627 Cannot build snaps in a 32-bit armhf container when running an arm64 kernel | snapcraft (launchpad) | closed | 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. | |
| #696 InvalidArchitecture: Architecture ‘armv8l’ is not supported | craft-parts | closed | Fixed by adding armv8l architecture support: PR #697 merged as commit 83679d41, mapping armv8l to armv7l/armhf in craft_parts/infos.py. Released in craft-parts 1.30.0. | |
| #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. | |
| #1173 `armv8l` architecture not suppored | craft-application | closed | armv8l hosts failed at build-stage platform matching. Fixed by merged PR #1174 (commit 7d75d877), which maps host arch armv8l to armhf; shipped in craft-application 7.2.1. | |
| #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. | |
| #1174 fix: add `armv8l` support | craft-application | merged | Merged PR #1174 (commit 7d75d877) added 'armv8l' to the platform→deb/snap arch translation map in craft_application/util/platforms.py, mapping such hosts to 'armhf'. Closes #1173; released in 7.2.1. |