-
Notifications
You must be signed in to change notification settings - Fork 401
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
pkg: Set OCAMLFIND_DESTDIR for install actions #10267
Conversation
d8093be
to
5d6cc5c
Compare
I wonder whether it wouldn't make more sense to set (The relocatable patch should probably make the |
I just noticed that when I use dune with this patch to build zarith it still installs its files to the wrong location. My little test library that installs with ocamlfind installs as expected but zarith does not. I'll do more testing with zarith next week. |
Did you confirm that zarith uses |
The problem with zarith turns out to be that it explicitly passes |
d422ece
to
170dc96
Compare
I've applied review feedback and fixed the failing test. @Leonidas-from-XIV regarding setting |
We already set OPAM_SWITCH_PREFIX. The issue is that it's not relocated and some packages do not respect it |
91c034e
to
2f8c3a9
Compare
Makes sense. I realized the test still had some stuff specific to my machine in it. That's now fixed. Does anything else need to be changed about this PR? |
If a package uses ocamlfind to install its files then ocamlfind will consult its config file to determine where in the filesystem the installed files ought to go. In dune, each package is built in an isolated sandbox, and so by default ocamlfind won't install files to the correct location. The OCAMLFIND_DESTDIR environment variable can be used to override ocamlfind's default behaviour for determining where to install files. This change sets the OCAMLFIND_DESTDIR variable to the "target/lib" directory within a package's build sandbox when executing a package's build and install commands. Signed-off-by: Stephen Sherratt <[email protected]>
2f8c3a9
to
bcbc4e2
Compare
If a package uses ocamlfind to install its files then ocamlfind will consult its config file to determine where in the filesystem the installed files ought to go. In dune, each package is built in an isolated sandbox, and so by default ocamlfind won't install files to the correct location. The OCAMLFIND_DESTDIR environment variable can be used to override ocamlfind's default behaviour for determining where to install files. This change sets the OCAMLFIND_DESTDIR variable to the "target/lib" directory within a package's build sandbox when executing a package's build and install commands. Signed-off-by: Stephen Sherratt <[email protected]>
If a package uses ocamlfind to install its files then ocamlfind will consult its config file to determine where in the filesystem the installed files ought to go. In dune, each package is built in an isolated sandbox, and so by default ocamlfind won't install files to the correct location. The OCAMLFIND_DESTDIR environment variable can be used to override ocamlfind's default behaviour for determining where to install files.
This change sets the OCAMLFIND_DESTDIR variable to the "target/lib" directory within a package's build sandbox when executing a package's install command. Build commands are unaffected by this change.
Fixes #10252.
Necessary for fixing #8931, but we also need to merge ocaml/ocamlfind#72 (relocatable ocamlfind) to fix that issue.
In addition to the simple test included in this change, I've also manually tested this change by building zarith using a patched version of ocamlfind (patched with ocaml/ocamlfind#72).