← Back to issue list

Cannot build snaps in a 32-bit armhf container when running an arm64 kernel

View original Github issue

Metadata

Project
snapcraft
Number
#4627
Type
issue
State
closed
Author
IsaacJT
Labels
—
Created
Updated
Closed

Current evaluation

Fixed in Snapcraft 9.1 by merged PR #6394 (commit e51640488), which maps armv8l to armv7l for armhf container builds on arm64 kernels.

Resolution: closed resolved

Reason: PR #6394 was merged as commit e51640488 and released in Snapcraft 9.1. The release notes confirm armv8l is recognized and mapped to ARMHF, enabling ARMHF snaps to be built in 32-bit containers on 64-bit ARM systems.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description This is a follow-up to the bug report posted on Launchpad: https://bugs.launchpad.net/snapcraft/+bug/1987627 Snapcraft is unable to snaps inside armhf containers when running on an arm64 host. ### To Reproduce Create an armhf container on an arm64 host and try to build a Core22-based snap with Snapcraft. ### Environment Building with destructive mode in an Ubuntu 22.04 armhf container on an arm64 host ### snapcraft.yaml ```shell Any snapcraft.yaml for armhf ``` ### Relevant log output ```shell Traceback (most recent call last): File "/snap/snapcraft/10599/bin/snapcraft", line 8, in <module> sys.exit(run()) File "/snap/snapcraft/10599/lib/python3.10/site-packages/snapcraft/cli.py", line 258, in run _run_dispatcher(dispatcher, global_args) File "/snap/snapcraft/10599/lib/python3.10/site-packages/snapcraft/cli.py", line 230, in _run_dispatcher dispatcher.run() File "/snap/snapcraft/10599/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/10599/lib/python3.10/site-packages/snapcraft/commands/lifecycle.py", line 265, in run super().run(parsed_args) File "/snap/snapcraft/10599/lib/python3.10/site-packages/snapcraft/commands/lifecycle.py", line 138, in run parts_lifecycle.run(self.name, parsed_args) File "/snap/snapcraft/10599/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 97, in run _expand_environment( File "/snap/snapcraft/10599/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 629, in _expand_environment info = craft_parts.ProjectInfo( File "/snap/snapcraft/10599/lib/python3.10/site-packages/craft_parts/infos.py", line 97, in __init__ self._set_machine(arch) File "/snap/snapcraft/10599/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. ``` ### Additional context ``` $ 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 $ uname -m armv8l ``` Core20-based snaps build correctly on Ubuntu 20.04 in an armhf container on an arm64 host.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed in Snapcraft 9.1 by merged PR #6394 (commit e51640488), which maps armv8l to armv7l for armhf container builds on arm64 kernels.
stealth/space-bunny-alpha — closed resolved Fixed in Snapcraft 9.1: PR #6394 (commit e51640488) added armv8l support, mapping the machine type to armv7l so armhf snaps build in 32-bit containers on arm64 kernels.
stealth/space-bunny-alpha — closed resolved Fixed in Snapcraft 9.1 by merged PR #6394 (commit e51640488), which maps armv8l to armv7l and enables armhf builds in containers on arm64 kernels.
qwen/qwen3.6-35b-a3b — — Closed without a public fix. An internal Jira ticket (CRAFT-2567) was created to track the architecture detection error, but no resolution or update was provided, leaving the issue deferred.
qwen/qwen3.8-27b
Impact: 45
Quick Win: 32
Staleness: 75
Complexity: 30
Confidence: 85
Support Request: 5
close stale Snapcraft failed to build armhf snaps in an armhf container on an arm64 host, raising InvalidArchitecture: 'armv8l' is not supported. Fixed in snapcraft 9.1 (PR #6394) and craft-parts #697; issue is stale and awaiting closure.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 60
Confidence: 80
Support Request: 5
needs triage Snapcraft fails to build armhf snaps in containers on arm64 hosts due to invalid architecture detection (armv8l). Unlabelled, no maintainer response, inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 50
Confidence: 75
Support Request: 15
needs triage Snapcraft crashes with InvalidArchitecture when building armhf snaps in containers on arm64 hosts. Report lacks maintainer assessment, labels, or activity for over two years.

Update history

Date Change
closed

Related work

  • Likely Fixed By: canonical/snapcraft#6394 (confidence 100%)

    Merged PR #6394 added armv8l-to-armv7l architecture mapping in 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.
98%
#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.
88%
#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.
78%
#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.
72%
#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.
71%
#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.
71%
#331 feat(snap): build on arm64 fetch-service merged Merged PR #331 via commit 1847b25, adding arm64 to the Snap build platforms.
70%