fix: use `build-for` when evaluating project variables
Metadata
Current evaluation
Merged fix for BUILD_FOR variable evaluation by passing the build-for architecture to craft-parts. Resolves snapcraft issue #4770. Approved by two reviewers, passed CI, and merged after rebasing onto the hotfix/2.6 branch.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the guidelines for contributing?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `tox`?
-----
As raised in Matrix ([source](https://matrix.to/#/!GGqzbFAUQprdPgYYCM:ubuntu.com/$ZP99NnFr-54yU3HEmz_LtWcaNtp8oxgHJ4pnix1uvNQ?via=ubuntu.com&via=matrix.org&via=kde.org)), `BUILD_FOR` variables aren't evaluated correctly because the `build-for` arch was not passed to craft-parts.
Builds on #334, so review last 2 commits only.
Fixes https://github.com/canonical/snapcraft/issues/4770
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for BUILD_FOR variable evaluation by passing the build-for architecture to craft-parts. Resolves snapcraft issue #4770. Approved by two reviewers, passed CI, and merged after rebasing onto the hotfix/2.6 branch. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix ensuring the build-for architecture is passed to craft-parts during project variable evaluation. Resolves issue #4770. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4150 meta: use build-for in snap.yaml architecture | snapcraft | merged | Merged fix correcting snap.yaml architecture generation. When build-for is set to all, the file now correctly outputs architectures: all instead of the previous incorrect build-on value. Resolves CRAFT-1535. | |
| #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. |