-
Notifications
You must be signed in to change notification settings - Fork 575
check opam switch - compatible #11569
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
check opam switch - compatible #11569
Conversation
3f31097
to
e71ce26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but see question in comments.
@@ -51,6 +51,7 @@ inputs: pkgs: { | |||
buildPhase = "make check-format"; | |||
installPhase = "touch $out"; | |||
meta.checkDescription = "that OCaml code is formatted properly"; | |||
DISABLE_CHECK_OPAM_SWITCH = "true"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely convinced that we should skip the check here: using the wrong opam.export
may give us different formatting, depending on the version of ocamlformat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(btw I think the ocamlformat version should be enforced with an .ocamlformat file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this check, the environment is managed via nix and not opam, so the check_opam_switch
tool does not work in this case.
It should not be needed however as nix directly reads the opam.export
file to setup the environment.
…_opam_switch-compatible
…_opam_switch-compatible
See #11570 for the develop version of this PR.
This PR enables the check_opam_switch tool, that provides two binaries to check that the current opam switch contains the packages from the
opam.export
file (at the same version):check_opam_switch
simply does the check,dune_wrapper
does the check before invoking dune (so it is possible to keep using dune as usual (with an alias) but notice early when the switch needs to be updated).Other changes:
The
opam.export
file was moved to the root of the dune project, as expected bydune_wrapper
by default (this way it is simpler to usedune_wrapper
in multiple projects).The check was added to the
ocaml_checks
rule of the makefile (to notice early that the switch needs to be updated when compiling the project from the makefile).See issue #10982 and PR #11450 for context.