environment: add build-on and build-for architectures
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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 issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #514 Add new envvars for build-on and build-for architectures | craft-parts | closed | Closed without implementation. The proposal to add new CRAFT_ARCH_BUILD_ON and CRAFT_ARCH_BUILD_FOR environment variables and deprecate legacy names was not merged, likely abandoned. No resolution or merge details were provided. | |
| #1027 feat: allow building on other compatible architectures | craft-application | merged | Merged. Enables cross-architecture builds via CRAFT_BUILD_ON. Approved by two reviewers with all CI checks passing. Modifies ten files to support compatible packaging. Follow-up work tracked in PR #1040. | |
| #4313 environment: add build-on and build-for envvars for core20 | snapcraft | merged | Merged into main. Added SNAPCRAFT_ARCH_BUILD_ON and SNAPCRAFT_ARCH_BUILD_FOR environment variables to expose build architecture details for core20. Approved, passed CI, and increased coverage. | |
| #3821 meta: architectures | snapcraft | merged | Merged adding build-on and build-for architecture support for core22 snaps. Introduced the SNAPCRAFT_BUILD_FOR environment variable to limit builds. Temporarily drafted to fix a duplicate build regression before final merge. | |
| #3418 project: always set target arch even if not cross compiling | snapcraft | merged | 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. |