environment: add build-on and build-for architectures
Metadata
Current evaluation
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.
Resolution: closed resolved
Reason: PR #532 was merged as commit 9f8e969e and implemented the variables requested by issue #514. Current code exports all four build-on/build-for variables and marks the two legacy names deprecated.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Existing `CRAFT_TARGET_ARCH` and `CRAFT_ARCH_TRIPLET` refer to the
architecture we're building for. To align with the build-on/build-for
naming convention and to give users access to both architectures
when defining override scripts and environments, set new environment
variables:
```
New environment variable Deprecated name
------------------------ ------------------
CRAFT_ARCH_BUILD_ON n/a
CRAFT_ARCH_BUILD_FOR CRAFT_TARGET_ARCH
CRAFT_ARCH_TRIPLET_BUILD_ON n/a
CRAFT_ARCH_TRIPLET_BUILD_FOR CRAFT_ARCH_TRIPLET
```
Fixes #514.
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | 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. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #532 (9f8e969e) added build-on/build-for architecture and triplet variables, deprecating CRAFT_TARGET_ARCH and CRAFT_ARCH_TRIPLET; fixes #514. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged following approval and CI checks. Introduces CRAFT_ARCH_BUILD_ON and CRAFT_ARCH_BUILD_FOR environment variables to standardize architecture naming, deprecating CRAFT_TARGET_ARCH and CRAFT_ARCH_TRIPLET. Resolves #514. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Introduced CRAFT_ARCH_BUILD_ON and CRAFT_ARCH_BUILD_FOR environment variables to standardize architecture naming, deprecating CRAFT_TARGET_ARCH and CRAFT_ARCH_TRIPLET. Addressed review feedback to correct naming. Closes #514. |
Update history
No update history recorded yet.
Related work
-
Related To:
craft-parts#514
(confidence 100%)
The issue requested these build-on/build-for environment variables and was fixed by merged PR #532.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #514 Add new envvars for build-on and build-for architectures | craft-parts | closed | Added build-on/build-for architecture and triplet environment variables in merged PR #532 (9f8e969e), retaining legacy names with deprecation warnings. | |
| #1027 feat: allow building on other compatible architectures | craft-application | merged | Merged #1027 as commit 15f48281, enabling provider-compatible cross-architecture builds and CRAFT_BUILD_ON architecture selection. | |
| #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. | |
| #4313 environment: add build-on and build-for envvars for core20 | snapcraft | merged | Merged PR #4313 as 93a9d8170, adding core20 SNAPCRAFT build-on/build-for architecture and triplet environment variables plus tests. | |
| #192 Introduce a platform format that can have both `build-for: all` and architecture-specific builds | craft-platforms | closed | Implemented Debcraft-specific mixed-architecture and build-for-all platform handling in merged PR #197 (commit 312896f). | |
| #197 feat: implement debcraft-specific rules | craft-platforms | merged | Merged PR #197 as commit 312896f, adding debcraft defaults and allowing build-for: all alongside architecture-specific builds; fixes #192. | |
| #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. | |
| #150 Support foreign architectures | craft-archives | closed | Foreign-architecture support shipped in craft-archives 2.1.0 via merged PR #153 (64f1092), replacing prototype #149 and enabling cross-compilation dependencies. | |
| #3821 meta: architectures | snapcraft | merged | Merged core22 architecture support, including build-on/build-for handling, host and build-instance selection, and SNAPCRAFT_BUILD_FOR filtering, via commit 4876b53. |