-
Notifications
You must be signed in to change notification settings - Fork 349
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
Provide opam during build #4387
Provide opam during build #4387
Conversation
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.
Thanks!
A few notes:
- please avoid hardcoding specific paths at several places, it's not maintainable; we use the
OpamPath
module to centralise such definitions. Especially here since it's expected as an interface with plugins. - maybe a cleaner interface would be to provide the
opam
file 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 |
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.
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-bin
fails because an internal call (toopam show
to get theopam
file corresponding to the built package) fails because of the global lock (it happens only when creating a switch).This PR makes
opam
create anopam
description file in the build directory called$OPAMROOT/$SWITCH/.opam-switch/build/$PACKAGE.opam
that can be used by hooks, andopam-bin
in particular, avoiding the recursive call toopam
.