Should the meson plugin allow non-uniqueItems?

I thought that the following syntax is valid:

    meson-parameters:
    - --prefix
    - /
    - --libdir
    - /lib
    - -D
    - tests=false
    - -D
    - x11=true

However it is rejected by snapcraft due to uniqueItems: True in the schema:

Failed to load plugin: properties failed to load for epoxy: The 'meson-parameters' property does not match the required schema: ['--prefix', '/', '--libdir', '/lib', '-D', 'tests=false', '-D', 'x11=true'] has non-unique elements

is there any valid reason to prevent this syntax?

Relevant Source

https://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/meson.py

I do acknowledge that the following syntax is valid, but I’d like to follow the --help syntax as close as possible:

    meson-parameters:
    - --prefix
    - /
    - --libdir
    - /lib
    - -Dtests=false
    - -Dx11=true

also note that you might find it more convenient to use yaml’s inline format, something like

meson-parameters: [ --prefix=/, --libdir=/lib, -Dtests=false, -Dx11=true ]

i do know this format, just intentionally avoid using it for version control convenience.

1 Like

yes, in a single line it’s not vcs-friendly, but it can be multiline:

meson-parameters: [
   --prefix=/,
   --libdir=/lib,
   -Dtests=false,
   -Dx11=true,
]

(this seems to confuse the colorizer though)

1 Like