Conversation
AltGr
left a comment
There was a problem hiding this comment.
Thanks!
A few notes:
- please avoid hardcoding specific paths at several places, it's not maintainable; we use the
OpamPathmodule to centralise such definitions. Especially here since it's expected as an interface with plugins. - maybe a cleaner interface would be to provide the
opamfile location as a variable to the hook. - with a variable, since we should already have the opam file stored somewhere, maybe we could even provide its location directly and avoid the extra file write?
da2df97 to
9090304
Compare
|
I have done the fix using |
AltGr
left a comment
There was a problem hiding this comment.
Suggested changes mostly for style, but there is a reason for not computing the path relative to build_dir, for cases where e.g. --inplace-build was used and build_dir can be outside of the opam-controlled dirs.
Co-authored-by: Louis Gesbert <louis.gesbert@ocamlpro.com>
4814e6b to
84bb121
Compare
Co-authored-by: R. Boujbel <rjbou@ocamlpro.com>
|
Closing as #4402 merged. Thanks for the PR! |
With the latest version of
opam,opam-binfails because an internal call (toopam showto get theopamfile corresponding to the built package) fails because of the global lock (it happens only when creating a switch).This PR makes
opamcreate anopamdescription file in the build directory called$OPAMROOT/$SWITCH/.opam-switch/build/$PACKAGE.opamthat can be used by hooks, andopam-binin particular, avoiding the recursive call toopam.