opam icon indicating copy to clipboard operation
opam copied to clipboard

Lint check use of package variables in depends/depopts/conflicts/depexts

Open kit-ty-kate opened this issue 1 year ago • 2 comments

Currently package variables are not allowed in the depends, depopts, conflicts or depexts field (see https://github.com/ocaml/opam/pull/5455 for the latter). However opam doesn't warn of their uses in these fields which confuses users (see https://github.com/ocaml/opam-repository/pull/25863)

It would be nice to have them trigger a warning during linting. It would be nice to also mention this in the documentation in the section on package variables. As far as i know, the only mention of it in the documentation is in the description of the depends field

kit-ty-kate avatar May 13 '24 11:05 kit-ty-kate

As noted by @rjbou, W29 does that already but only misses depexts

kit-ty-kate avatar May 14 '24 10:05 kit-ty-kate

Note that it is not unreasonable to think that depexts might have more lenient restrictions than depends, since they cannot depend on opam packages or have exclusion conflicts.

lukstafi avatar May 19 '24 09:05 lukstafi