← Back to issue list

Unexpected behavior for multiple `to` statements

View original Github issue

Metadata

Project
craft-grammar
Number
#89
Type
issue
State
open
Author
mr-cal
Labels
Created
2025-04-21 18:53:17+00:00
Updated
2025-06-11 20:42:37+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

Given the following: ```yaml parts: my-part: build-packages: - to armhf: - foo - to riscv64: - bar - else: - baz ``` Building for armhf will evaluate to `["foo", "baz"]` and building for riscv64 will evaluate to `["bar"]`. This is an unexpected UX and there are no warnings or errors to explain the behavior. Either craft-grammar should error when given multiple `to` statements with an `else` or it should properly handle this scenario. A reproducer in the unit test suite can be seen here: https://github.com/canonical/craft-grammar/commit/12c031a207eaec4e1c345ad8a9ad2444ec4429ae Source: https://github.com/canonical/snapcraft/issues/5255

Evaluation history

No evaluation history available.