CEP 44: clarify extras matchspec - #177
Conversation
The Specification only showed the scalar form `pkg[extras="group-name"]`
and described the value as "a string or a list of string" without
pinning down the list syntax, whether the `[a-z0-9_.+-]{1,64}` grammar
binds the selector, or how case is handled. This left implementations to
guess (e.g. quoted-list handling, uppercase names).
Clarify that:
- the list form is a bracketed, comma-separated list, e.g. `[extras=[a, b]]`
- names may be optionally single/double quoted; surrounding whitespace is ignored
- selector names must obey the same group-name grammar as `extra-depends`
keys, compared case-sensitively with no normalization
- a non-conforming name makes the MatchSpec invalid (must be rejected)
- referencing an absent group name is a no-op, not an error
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
extras matchspec
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
|
Thank you @jaimergp for fixing the PR up! Idk if we need a vote or more core people to chime in but IMO this is just a clarification and we could merge it (if we agree that quotes are supported). |
|
I don't think we need a vote, but I do want more eyes on this because the diff goes beyond "typo fix". I'll mention it in the next community meeting too and it should be ok. |
|
|
||
| - MAY be quoted with balanced single or double quotes; the quotes carry no semantic difference. | ||
| - MAY be wrapped with whitespace, which MUST be ignored. | ||
| - MUST match the same `[a-z0-9_.+-]{1,64}` grammar as the `extra-depends` keys. A `MatchSpec` whose `extras` value contains a name that does not match this grammar is invalid and MUST be rejected. |
There was a problem hiding this comment.
This rejects glob strings. Is that intended? I think it's a good idea to not allow them for now (why would I want to install extras=["known-prefix-*"]?). In that case, maybe we should mention that these items MUST be string literals matching that grammar.
There was a problem hiding this comment.
yeah globbing was never discussed for extras (Only for flags).
| This new field must be selectable by `MatchSpec` syntax using the `extras` keyword inside square brackets, the value of which MUST be a string or a list of string targeting group names. | ||
|
|
||
| Individual names in the list: |
There was a problem hiding this comment.
| This new field must be selectable by `MatchSpec` syntax using the `extras` keyword inside square brackets, the value of which MUST be a string or a list of string targeting group names. | |
| Individual names in the list: | |
| This new field must be selectable by `MatchSpec` syntax using the `extras` keyword inside square brackets, the value of which MUST be a string or a list of string targeting group names. Each of these strings: |
(so it applies to both scalar and lists)
| - MAY be quoted with balanced single or double quotes; the quotes carry no semantic difference. | ||
| - MAY be wrapped with whitespace, which MUST be ignored. |
There was a problem hiding this comment.
This can go away if we accept the YAML 1.2 suggestion.
…matchspec # Conflicts: # cep-0044.md
Checklist for submitter
cep-0000.mdnamedcep-XXXX.mdin the root level.CEP XX: Amend XYZ.## Changelogsection right above the final "Copyright" section with an item that uses syntaxYYYY-MM-DD: Brief explanation of changes.Checklist for CEP approvals
${greatest-number-in-main} + 1.cep-XXXX.mdfile has been renamed accordingly.# CEP XXXX -header has been edited accordingly.pre-commitchecks are passing.