New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assertion failed when using computed versions #3716
Comments
possible cause of ocaml/opam#3716
It looks like this is due to a reference to an undefined variable ( |
Indeed, that seems to be the error ; still, assert failing is not the best handing of this case ^ ^ |
To handle this case, we could hard fail with a better message, or just print a warning and ignore the constraint. However, the general policy is to avoid polluting users with errors from package definition files. What actually happens in most places is that undefined variable errors are silently ignored. This is consistent in a way, since we have well-defined semantics for handling undefined variables (at least in the boolean case), but has led to confusion and time lost in debugging mistakes quite a few times already. This is not easy to solve, though: packages are allowed to depend on user-defined variables. The best compromise is probably to have a list of variable names known to be normally defined, and output a warning on linting for other names. This would be a proper solution for global variables, but less so for package variables, which are more commonly custom (using |
I'm not a fan of having lint issue unfixable warnings. One observation is that I've seen many instances of typoed variables (e.g. |
I'm trying to use computed versions in opam 2.0.2 to make multi-repository packages easier, but it leads to an assertion failure in opam:
Full log: https://travis-ci.com/avsm/mirage-clock/jobs/167225256
Example of an opam file causing this:
And the full tree that has the offending versions: https://github.com/mirage/mirage-clock/tree/d57102ff19e43b02791ec67070f3ee315df3b147
The text was updated successfully, but these errors were encountered: