ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.24k stars 353 forks source link

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

Open kit-ty-kate opened 4 months ago

kit-ty-kate commented 4 months ago

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 commented 4 months ago

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

lukstafi commented 4 months ago

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.