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

Opam build failure: menhirLib not found #34

Closed
g15ecb opened this issue Apr 23, 2013 · 8 comments
Closed

Opam build failure: menhirLib not found #34

g15ecb opened this issue Apr 23, 2013 · 8 comments

Comments

@g15ecb
Copy link

g15ecb commented Apr 23, 2013

opam install merlin fails with:

./configure --prefix /Users/gbarnett/.opam/system
make
make install
The compilation of merlin.1.0 failed.
Uninstalling merlin.1.0:
make uninstall

==== ERROR [while installing merlin.1.0] ====

opam-version 1.0.0

os darwin

command make

path /Users/gbarnett/.opam/system/build/merlin.1.0

exit-code 2

env-file /Users/gbarnett/.opam/system/build/merlin.1.0/merlin-1872ec.env

stdout-file /Users/gbarnett/.opam/system/build/merlin.1.0/merlin-1872ec.out

stderr-file /Users/gbarnett/.opam/system/build/merlin.1.0/merlin-1872ec.err

stdout

ocamlbuild -Is .,typing,parsing,utils -use-ocamlfind ocamlmerlin.native
/usr/local/bin/ocamlfind ocamlopt -I /usr/local/lib/ocaml/ocamlbuild unix.cmxa /usr/local/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild_config.ml myocamlbuild.ml /usr/local/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
/usr/local/bin/ocamlfind ocamldep -package menhirLib -package yojson -package findlib -modules ocamlmerlin.ml > ocamlmerlin.ml.depends

  • /usr/local/bin/ocamlfind ocamldep -package menhirLib -package yojson -package findlib -modules ocamlmerlin.ml > ocamlmerlin.ml.depends
    ocamlfind: Package `menhirLib' not found
    Command exited with code 2.

    stderr

    make: *** [ocamlmerlin.native] Error 10
@let-def
Copy link
Contributor

let-def commented Apr 23, 2013

I have some problem understanding your configuration, and I can't reproduce this error.

How did you install the ocaml system? Did you use brew?

@g15ecb
Copy link
Author

g15ecb commented Apr 23, 2013

I used brew to install ocaml and brew to install opam.

@g15ecb
Copy link
Author

g15ecb commented Apr 23, 2013

It seems that compiling ocaml with opam seems to have fixed the error. I must have misunderstood how opam works.

@let-def
Copy link
Contributor

let-def commented Apr 24, 2013

Well, it should have worked with system compiler, so there is a problem somewhere…
Any way, it is safer to use opam managed compiler.

@rgrinberg
Copy link
Member

I've recently came about a similar error. I think the issue was:

  1. Merlin was using the system's ocamlbuild which was using the system's ocamlfind

  2. menhir, etc. were installed using opam's local ocamlfind.

@let-def
Copy link
Contributor

let-def commented May 17, 2013

I plan to tag v1.1 this week-end. It would be nice to close this issue, but I don't understand why this is causing problem…

Normally, make is called from opam, so its environment use opam's PATH ?!

@rgrinberg
Copy link
Member

It is using opam's PATH. But I don't think it's using opam's ocamlbuild. But it's also using the system's ocamlbuild @ /usr/bin/ocamlbuild when using the "system" ocaml installation. For example on the system where I've encountered the problem:

opam switch system followed by eval opam config env (don't know how to escape backquotes in md)

  1. which ocamlbuild -> /usr/bin/ocamlbuild

  2. which ocamlfind -> ~/.opam/system/bin/ocamlfind

Which is obviously wrong...

In any case this is definitely not a bug with merlin so you can safely close this. I'm just wandering whether the OPAM people should be aware of this...

@let-def
Copy link
Contributor

let-def commented May 17, 2013

Oh I see! That's probably what happened.

A solution may be that opam exports OCAMLFIND_CONF / OCAML_PATH variables… I'll ask OPAM people.

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

3 participants