← Back to issue list

grammar: to statement

View original Github issue

Metadata

Project
snapcraft
Number
#1639
Type
pull request
State
merged
Author
kalikiana
Labels
—
Created
Updated
Closed

Current evaluation

Merged in canonical/snapcraft#1639 via f5e82e550, adding “to <arch>:” selectors and target-architecture defaults. Compound “on <arch> to <arch>:” support followed in #2088.

Resolution: closed resolved

Reason: PR #1639 was merged as commit f5e82e550. It implemented target-architecture package selection; the deferred compound selector landed separately in merged PR #2088 (d81e0fa38).

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] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh unit`? ----- This is the implementation of the "to" statement [as discussed in the forum](https://forum.snapcraft.io/t/specifying-architecture-on-cross-compilations/1641/20). This PR implements the **bold items**. Items 7 and 8 are implemented in the follow-up PR #1800 to allow for quicker review (although I can also add them here if that's preferred, whichever is clearer). 1. The existing “on <arch>:” syntax will be accepted under build-packages as well 2. The default architecture for packages under “on <arch>” is the one from the build machine 3. Packages under “on <arch>:” are installed only when the build machine has that architecture 4. **A new “to <arch>:” statement will be supported in build-packages and stage-packages** 5. **The default architecture for packages under “to <arch>:” is the target architecture** 6. **Packages under “to <arch>:” are installed only when the target architecture is the one listed, which includes both a cross-compilation towards that architecture and a native build on that architecture** 7. The two statements may be used together as “on <arch> to <arch>:” to precisely specify the case of a particular cross-compilation 8. The default architecture for packages under “on <arch> to <arch>:” is the target architecture

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged in canonical/snapcraft#1639 via f5e82e550, adding “to <arch>:” selectors and target-architecture defaults. Compound “on <arch> to <arch>:” support followed in #2088.
stealth/space-bunny-alpha — closed resolved Merged in snapcraft#1639 via f5e82e550, adding to <arch>: package selectors for the target architecture. Compound on/to syntax followed in #2088.
qwen/qwen3.6-35b-a3b — — Merged implementation of the to <arch>: grammar statement for build-packages and stage-packages, enabling target architecture specification for cross-compilation. Approved and merged. Remaining features were handled in a follow-up PR.
qwen3.6-35b-a3b-mtp-q6 — — Merged implementation of a to arch grammar statement for build and stage packages, enabling target architecture specification for cross-compilation. Initial CI failures were resolved before merge, with remaining features deferred to PR 1800.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#2088 (confidence 100%)

    Merged follow-up adding compound on/to architecture selection and target-architecture defaults.

Related issues

Issue Project State Summary Similarity
#2088 grammar: support compound on..to statement snapcraft merged Merged PR #2088 in commit d81e0fa38, adding compound on <arch> to <arch> grammar and defaulting packages to the target architecture; fixes #1689.
81%
#1857 grammar: make on statement work with host arch snapcraft merged Merged as b451f48fc: package selectors now distinguish host architecture with on, target architecture with to, and combined on-to cases.
78%
#1689 Implement "on <arch> to" selectors (statements) in project_loader snapcraft closed Compound on <arch> to <arch> selectors were implemented by merged PR #2088 (d81e0fa38); the earlier #1800 attempt closed unmerged.
73%
#1800 grammar: on..to statement snapcraft closed Closed unmerged; its compound on <arch> to <arch> grammar was implemented by merged PR #2088 in commit d81e0fa38.
71%