opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
2921 added the ? operator to allow filters to have expressions like ?foo & foo = "foo", where ?foo is true if and only if foo is a defined variable (or an expression where all the variables have been successfully resolved).
However, it doesn't seem to have been working, which I'd spotted in the ocaml-system updates in https://github.com/ocaml/opam-repository/pull/25861. Unfortunately, the failure means that the repository can't be used with --strict.
The fundamental problem is that the warning about undefined variables is displayed when the variables are being resolved, which sadly includes the moment they are being tested with the ? operator. However, when a filter is partially evaluated, the resulting filter will only contain undefined variables (and the post variable), which allows the check added in #5141 to be co-opted to display the unresolved variables after the filter has been reduced, rather than during the reducing.
2921 added the
?
operator to allow filters to have expressions like?foo & foo = "foo"
, where?foo
is true if and only iffoo
is a defined variable (or an expression where all the variables have been successfully resolved).However, it doesn't seem to have been working, which I'd spotted in the ocaml-system updates in https://github.com/ocaml/opam-repository/pull/25861. Unfortunately, the failure means that the repository can't be used with
--strict
.The fundamental problem is that the warning about undefined variables is displayed when the variables are being resolved, which sadly includes the moment they are being tested with the
?
operator. However, when a filter is partially evaluated, the resulting filter will only contain undefined variables (and thepost
variable), which allows the check added in #5141 to be co-opted to display the unresolved variables after the filter has been reduced, rather than during the reducing.