project: always set target arch even if not cross compiling
Metadata
Current evaluation
Merged PR #3418 in commit a05e64594, setting an explicit target architecture for native and cross builds and consistently defining SNAPCRAFT_TARGET_ARCH.
Resolution: closed resolved
Reason: The approved PR was merged as commit a05e64594. It ensures target architecture is always set, rather than left unset for native builds.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3418 in commit a05e64594, setting an explicit target architecture for native and cross builds and consistently defining SNAPCRAFT_TARGET_ARCH. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3418 in commit a05e64594, explicitly setting the target architecture for native and cross builds and consistently defining SNAPCRAFT_TARGET_ARCH. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in #3418 via commit a05e64594, making target architecture explicit for native builds and consistently defining SNAPCRAFT_TARGET_ARCH. | |
| stealth/space-bunny-alpha | — | closed resolved | PR #3418 merged as commit a05e64594, setting the project target arch unconditionally (not just when cross compiling) so SNAPCRAFT_TARGET_ARCH is always populated, superseding the narrower defaulting done in #3416. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3418 in commit a05e64594, making target architecture explicit for native builds too and ensuring SNAPCRAFT_TARGET_ARCH is consistently defined. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged a change that always sets the target architecture, even during native builds. This avoids special-casing None in apt_cache and ensures SNAPCRAFT_TARGET_ARCH is consistently defined. Approved by one reviewer and passed CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. The target architecture is now always explicitly set, even for native builds. This removes special-case None handling in apt_cache by consistently applying the architecture across all code paths, including SNAPCRAFT_TARGET_ARCH. |
Update history
No update history recorded yet.
Related work
-
Related To:
snapcraft#3416
(confidence 90%)
This preceding change defaulted the stage package cache to the target architecture and motivated consistent target-arch handling.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3415 cli: enable SNAPCRAFT_TARGET_ARCH envvar matching --target-arch | snapcraft | closed | Closed unmerged with changes requested. Superseded by merged PR #3414 (ff2cd96bb), which exported SNAPCRAFT_TARGET_ARCH in the project loader's build environment instead of adding a CLI envvar option. | |
| #3414 project loader: export SNAPCRAFT_TARGET_ARCH in build environment | snapcraft | merged | Merged PR #3414 (commit ff2cd96bb) added SNAPCRAFT_TARGET_ARCH to the global build environment in set_global_environment() for core22, alongside SNAPCRAFT_ARCH_TRIPLET. | |
| #1813634 not reliable way to detect target architecture | snapcraft (launchpad) | open | Snapcraft 8.0.0 added explicit build-for architecture variables, superseding the ambiguous 3.0.1-era target_arch and SNAPCRAFT_ARCH_TRIPLET behavior. | |
| #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. | |
| #532 environment: add build-on and build-for architectures | craft-parts | merged | Merged PR #532 in commit 9f8e969e, adding build-on/build-for architecture and triplet variables, deprecating CRAFT_TARGET_ARCH and CRAFT_ARCH_TRIPLET, and fixing #514. | |
| #3416 repo: default to target arch for stage package cache | snapcraft | merged | Merged #3416, defaulting stage package caches to the target architecture and adding Spread coverage; landed as commit 8f418e3d9. | |
| #1564192 Lifecycle needs to track cross compilation | snapcraft (launchpad) | closed | Snapcraft didn't track target architecture in lifecycle dirty state, so rebuilding for a second arch was skipped. Fixed by merged PR canonical/snapcraft#450 (commit ab27f5587), shipped in snapcraft 2.9 for xenial; verified done. | |
| #3831 project: use correct host arch when target arch is set | snapcraft | merged | Merged as commit 33088d59d: Project now tracks host Debian architecture separately, so --target-arch no longer overwrites it. |