Advanced grammar doesn't support multiple selectors (v8.0)

Bug #2066280 reported by Michał Sawicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Invalid
Undecided
Unassigned

Bug Description

Following https://snapcraft.io/docs/snapcraft-advanced-grammar

Given the following snapcraft.yaml:

```yaml
name: my-snap-name
base: core24
version: '0.1'
summary: Summary
description: Description
grade: devel
confinement: strict

parts:
  my-part:
    plugin: nil
    stage-packages:
    - on amd64: [cowsay]
    - on amd64,arm64: [sl]
```

Only `cowsay` is staged:
```
$ ls -d /snap/my-snap-name/current/usr/share/{cowsay,sl}
ls: cannot access '/snap/my-snap-name/current/usr/share/sl': No such file or directory
/snap/my-snap-name/current/usr/share/cowsay
```

Revision history for this message
Callahan Kovacs (mr-cal) wrote :

The key statement in the documentation is, "The body of the on clause is taken into account if every (AND, not OR) selector is true for the build environment."

Right now, advanced grammar only supports architectures so there is currently not a scenario where `on arch1,arch2` will ever be true.

It would be a better UX if snapcraft didn't allow multiple `on` selectors or logged a warning.

Revision history for this message
Michał Sawicz (saviq) wrote :

I suppose that ship sailed, but that's far from intuitive… especially because it's _only_ supported for arches, there's never a scenario where you would need `AND` ;)

Oh well, my bad.

Changed in snapcraft:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.