Skip to content
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

Allow projects to remove dependency on opam-installer #7

Closed
jordwalke opened this issue Oct 22, 2017 · 1 comment
Closed

Allow projects to remove dependency on opam-installer #7

jordwalke opened this issue Oct 22, 2017 · 1 comment

Comments

@jordwalke
Copy link
Member

jordwalke commented Oct 22, 2017

It's possible to remove the dependency on opam-installer for projects that use build systems, that have a deep understanding of ocamlfind. jbuilder is one of these build systems. If it cannot find opam, it will use the $OCAMLFIND_DESTDIR variable. I found one issue, and I suspect another one will emerge:

  1. Even if my project does not depend on opam-installer-bin, even if some other project depends on it, it will be added to my PATH while running build commands, and jbuilder will think that opam is installed, and will try to use opam-installer to install my library. A longer term (harder) fix is to distinguish those "build-time-only" dependencies which won't augment PATH transitively. I'm hoping there's a shorter term fix.
  2. I'm not able to test if this is a problem due to number 1, but I think $OCAMLFIND_DESTDIR variable is configured slightly differently than it should be. Here's what it is for my ReasonNativeProject:
  • Inside of esy build-shell: the variable is set to /Users/jwalke/.esy/3.x.x________________________________________________________________/s/reason_native_project-0.0.1-a00bddbe/lib
  • With esy sh -c 'echo $OCAMLFIND_DESTDIR' it points to the cache: /Users/jwalke/github/ReasonNativeProject/node_modules/.cache/_esy/store/s/reason_native_project-0.0.1-a00bddbe/lib

I'm not sure if build-shell should also be pointing to the local project build cache.
But also notice that they have the trailing /lib. Is this expected? esy sh -c echo $cur__install prints the location of the local build cache but without the lib: /Users/jwalke/github/ReasonNativeProject/node_modules/.cache/_esy/store/s/reason_native_project-0.0.1-a00bddbe. I suspect if I had a workaround for number 1, this trailing /lib would cause a problem.

@jordwalke
Copy link
Member Author

Forget about this issue for now. It's hard to tell what jbuilder promises to do. Even if we remove opam-installer from the environment, I'm not confident jbuilder will even attempt its own solid version of opam-installer. I'm going to instead open another issue to discuss potentially making opam-installer work out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant