← Back to issue list

environment: add build-on and build-for envvars for core20

View original Github issue

Metadata

Project
snapcraft
Number
#4313
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #4313 as 93a9d8170, adding core20 SNAPCRAFT build-on/build-for architecture and triplet environment variables plus tests.

Resolution: closed resolved

Reason: PR #4313 was merged into main as commit 93a9d8170, introducing all four core20 environment variables and test coverage. Follow-up PR #4332 later made unresolved build-for values fail explicitly instead of producing "None".

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint`? - [x] Have you successfully run `pytest tests/unit`? ----- New environment variables: - `SNAPCRAFT_ARCH_BUILD_ON` - `SNAPCRAFT_ARCH_TRIPLET_BUILD_ON` - `SNAPCRAFT_ARCH_BUILD_FOR` - `SNAPCRAFT_ARCH_TRIPLET_BUILD_FOR` The build-for envvars are only available when the build-for architecture can be determined. They are not available for multi-architecture builds or for unknown build-for architectures. TODO: - [x] add spread tests - [x] s/run-on/build-for - [x] change target from `hotfix/7.5` to `main` [LP: #1997752](https://bugs.launchpad.net/bugs/1997752) (CRAFT-1498)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #4313 as 93a9d8170, adding core20 SNAPCRAFT build-on/build-for architecture and triplet environment variables plus tests.
stealth/space-bunny-alpha — closed resolved Merged PR #4313 in commit 93a9d8170, adding core20 build-on/build-for architecture and triplet environment variables with spread tests; released in Snapcraft 8.0.0.
stealth/space-bunny-alpha — closed resolved Merged in PR #4313 (commit 93a9d8170), adding build-on/build-for architecture environment variables and related core20 tests.
qwen/qwen3.6-35b-a3b — — 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.
qwen3.6-35b-a3b-mtp-q6 — — Merged into main. Adds SNAPCRAFT_ARCH_BUILD_ON and SNAPCRAFT_ARCH_BUILD_FOR environment variables for core20 builds. Updated naming from RUN_ON to BUILD_FOR and included CRAFT variants. Approved after review with 100% diff coverage.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#4332 (confidence 99%)

    Follow-up merged as 48bd0632f to handle core20 build-for values that cannot be evaluated.

Related issues

Issue Project State Summary Similarity
#1997752 base core20: wrong arch triplet snapcraft (launchpad) closed Wrong SNAPCRAFT_ARCH_TRIPLET for core20 build-on/run-on builds fixed by adding SNAPCRAFT_ARCH_BUILD_ON/BUILD_FOR and *_TRIPLET_BUILD_FOR envvars (PR #4313, commit 93a9d8170); follow-up #4332 (48bd0632f) errors on unevaluable multi-arch cases.
78%
#4366 fix(environment): sort core20 project variables before replacement snapcraft merged Merged PR #4366 in commit ae891d1d, sorting core20 project variables so BUILD_ON/BUILD_FOR values expand before SNAPCRAFT_ARCH_TRIPLET and fixing #4363.
76%
#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.
75%
#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.
75%
#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.
74%
#4332 environment: error when build-for arch variable cannot be evaluated snapcraft merged Merged PR #4332 (48bd0632f) now errors on unevaluable core20 SNAPCRAFT_ARCH_BUILD_FOR and SNAPCRAFT_ARCH_TRIPLET_BUILD_FOR variables instead of producing "None".
74%
#1576 docker: add the environment variable to setup core snapcraft merged Merged #1576 in commit 338278005, adding SNAPCRAFT_SETUP_CORE to the Dockerfile so classic-confinement builds run without manual core setup.
73%
#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.
72%
#5606 schema: add build-for in architectures for core22 snapcraft merged Merged as c9822a38c via snapcraft#5606, adding build-for to the core22 architectures schema in snapcraft.json.
72%
#2122 many: introduce variables for part src and build snapcraft merged Merged in commit 31307b5de via #2122, adding source/build directory variables and centralizing SNAPCRAFT_* environment handling; resolved LP #1763028.
72%