Armael / marracheck

Gotta check them all!
10 stars 3 forks source link

Cmdliner 1.1.0 and Opam global/build options #9

Closed art-w closed 2 years ago

art-w commented 2 years ago

The main motivation was to enable opam's --debug --verbose to get more feedback when opam is hanging for minutes, but there are a few more settings that may be interesting:

Opam's --switch could cause conflicts with marracheck's positional argument, so the proposed fix is to use the opam argument (with an arbitrary default of 4.13.1 if missing):

dune exec -- ./src/marracheck.exe run --debug --verbose --no-depexts \
  /path/to/opam-repository \
  /path/to/marracheck-data \
  --switch=ocaml-base-compiler.4.13.1 # <-- syntax breaking change!

While the extra settings are convenient, I'm not 100% happy that the --help becomes noisy with all the random opam options... And it's very likely that some of these options will interact badly with marracheck, although I'm really not sure which one should be forbidden / provide no value.

Armael commented 2 years ago

Thanks for the PR!

Wrt lifting opam options to marracheck options: our workflow until now was to use environment variables for that. Most (every?) --foo option you can pass to opam has an equivalent OPAMFOO environment variable you can use instead. Defining these environment variables alsos work with marracheck (it got broken at some point in the past but should now work again). So launching marracheck with OPAMDEBUG=1 OPAMVERBOSE=1 should work for instance.

Granted, this is sort of a hidden feature at the moment. I'm not sure how much we should try to lift (a subset of) opam options into marracheck options, or instead just mention in the README a list of opam-related environment variables that one can use and that are generally useful.

art-w commented 2 years ago

Oh nice, I completely forgot about environment variables but they solve all my issues! I've removed the lifting of opam options in favor of more explanations in the README (but feel free to close this PR, I've no attachment to what remains)

Armael commented 2 years ago

thanks! the rest of the PR is still very good to have! merging.