not reliable way to detect target architecture
Metadata
Current evaluation
Snapcraft 8.0.0 added explicit build-for architecture variables, superseding the ambiguous 3.0.1-era target_arch and SNAPCRAFT_ARCH_TRIPLET behavior.
Suggested action: close resolved
Reason: The Snapcraft 8.0.0 changelog introduced CRAFT_ARCH_BUILD_FOR and CRAFT_ARCH_TRIPLET_BUILD_FOR as replacements for the old target variables, and the current platform reference documents both build-for and build-on values. Current lifecycle code also passes project.get_build_for() as target_arch, superseding the reproducible ambiguity reported with version 3.0.1.
Evaluated by: mr-cal-bot
Impact:
62
Quick Win:
29
Complexity:
48
Confidence:
88
Actionability:
90
Issue body
There is no reliable way to determine target snap architecture or at least project.target_arch does not provide consistent value
tested with snapcraft version 3.0.1
Tested use cases:
native build:
project.target_arch - has expected value
SNAPCRAFT_ARCH_TRIPLET has host arch
cross build with --target-arch:
project.target_arch has expected target arch value
SNAPCRAFT_ARCH_TRIPLET has target arch
build on amd64 with following statement in snapcraft.yaml
architectures:
- build-on: [amd64, arm64]
run-on: arm64
expected values:
project.target_arch has target arch
SNAPCRAFT_ARCH_TRIPLET has target arch
actual values:
project.target_arch is empty
SNAPCRAFT_ARCH_TRIPLET has host arch
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
62
Quick Win:
29
Complexity:
48
Confidence:
88
Actionability:
90
|
close resolved | Snapcraft 8.0.0 added explicit build-for architecture variables, superseding the ambiguous 3.0.1-era target_arch and SNAPCRAFT_ARCH_TRIPLET behavior. | |
| stealth/space-bunny-alpha |
Impact:
65
Quick Win:
20
Complexity:
45
Confidence:
82
Actionability:
55
|
close resolved | Modern Snapcraft exposes explicit build-for architecture variables, making the reported 3.0.1-era target-architecture detection problem appear addressed. | |
| stealth/space-bunny-alpha |
Impact:
45
Quick Win:
14
Complexity:
52
Confidence:
82
Actionability:
65
|
needs triage | Snapcraft 3.0.1 gives inconsistent target-architecture metadata for build-on/run-on builds: project.target_arch is empty and SNAPCRAFT_ARCH_TRIPLET reports the host; unassessed. | |
| qwen/qwen3.8-27b |
Impact:
40
Quick Win:
18
Staleness:
95
Complexity:
55
Confidence:
55
Support Request:
10
|
needs triage | Snapcraft 3.0.1: project.target_arch and SNAPCRAFT_ARCH_TRIPLET give inconsistent values for target arch across native, cross, and multi-arch (build-on/run-on) builds. No maintainer response, no labels, inactive ~7 years. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
45
Confidence:
92
Support Request:
15
|
close stale | Reports inconsistent values for project.target_arch and SNAPCRAFT_ARCH_TRIPLET in Snapcraft v3.0.1 across native, cross, and multi-arch builds. Untriaged, inactive for over 7 years, and likely obsolete due to major project updates. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
40
Confidence:
90
Support Request:
10
|
close stale | Reports inconsistent values for project.target_arch and SNAPCRAFT_ARCH_TRIPLET during native, cross, and multi-arch builds in snapcraft 3.0.1. No maintainer response or updates in over seven years. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
35
Confidence:
90
Support Request:
15
|
close stale | Reports inconsistent values for project.target_arch and SNAPCRAFT_ARCH_TRIPLET during native and cross builds in Snapcraft 3.0.1. Issue has been inactive for over 7 years with no maintainer response or labels. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3418 project: always set target arch even if not cross compiling | snapcraft | merged | Merged PR #3418 in commit a05e64594, setting an explicit target architecture for native and cross builds and consistently defining SNAPCRAFT_TARGET_ARCH. | |
| #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. | |
| #1648665 Architecture-specific sources for parts | snapcraft (launchpad) | closed | Closed 2026-08-25 by ~mr-cal as already fixed: Snapcraft part steps can pick architecture-specific sources via build-for env vars (SNAPCRAFT_ARCH_BUILD_FOR/SNAPCRAFT_TARGET_ARCH); no new patch was made. | |
| #3568 cli: enable SNAPCRAFT_TARGET_ARCH envvar matching --target-arch | snapcraft | closed | Closed unmerged after maintainers rejected expanding environment-variable support for CLI options; SNAPCRAFT_TARGET_ARCH was not accepted as an alternative to --target-arch. | |
| #4214 snapcraft 7.4.3 doesn't adequately complain about non-existent architectures | snapcraft | closed | Fixed in Snapcraft 8: invalid build-on architectures now produce a clear validation error listing all supported architectures. | |
| #1566331 snapcraft autotools plugin doesn't support building other architectures | snapcraft (launchpad) | open | Autotools cross-compilation is now supported through target build-for selection, CRAFT_ARCH_TRIPLET_BUILD_FOR, and --host configuration; the historical request has been implemented. | |
| #1664114 Need variable for arch triplet in yaml | snapcraft (launchpad) | closed | Added the architecture triplet to Snapcraft's build environment for use in YAML parts; implemented by snapcraft#1768 in commit 5df5ab8d5. |