What are possible "selectors" for the "on:" snapcraft.yaml directive?

Just noticed in snapcraft schema file that the “on:” directive is of the form:

“usage”: “on <selector>[,<selector>…]:”

which normally selects among some architecture, but the above refers to a more general “selector” for that conditional – what can be a selector other than an architecture?

P.S. The above suggests one can have something like:

on: amd64,arm64:

Yes?

1 Like

Currently Snapcraft only supports the host architecture selectors you already know about:

The documentation references generic selectors so that the syntax could be reused if we need something other than host architecture selectors.

The comments suggest that if multiple selectors are specified in a single statement, then the block should only be processed if they are all true. So writing a block like on amd64,arm64: would be a bit useless, since those two selectors are mutually exclusive.

Ah, it is suddenly all clear, thanks. I think I will add that to the appropriate docs and courseware.