The build fails while compiling the dependency ocaml-extlib 1.5.3.
Not sure if this is 10.12 specific, I didn't try to install it on 10.11.
Error
File "extlib/extString.ml", line 1:
Error: The implementation extlib/extString.ml
does not match the interface extlib/extString.cmi:
...
In module String:
Values do not match:
external unsafe_set : bytes -> int -> char -> unit
= "%bytes_unsafe_set"
is not included in
external unsafe_set : string -> int -> char -> unit
= "%string_unsafe_set"
make[4]: *** [extlib/extString.cmo] Error 2
make[3]: *** [byte-code-library] Error 2
make[2]: *** [subproj_extlib] Error 2
make[1]: *** [build] Error 2
make: *** [lib-ext] Error 2
gist-logs: https://gist.github.com/niieani/c621bed7f19851ce8f7822d66f238453
Warning: Your Xcode (7.3) is outdated
Please update to Xcode 8.0.
Xcode can be updated from
https://developer.apple.com/xcode/downloads/
That's the most likely cause. Try upgrading Xcode and installing again.
@dunn Nope, I have both Xcode 7.3 and 8.0 and tested using both toolings, the error is the same.
gist-logs when run with Xcode 8.0
Oh, gotcha. I can't replicate it on 10.11, though, so this is probably a Sierra issue. Could you report it to the developers?
Report it to developers of opam or ocaml-extlib? Cause ocaml-extlib is already on 1.7.0.
Submitted upstream as https://github.com/ocaml/opam/issues/2654
I'm unable to reproduce on 10.12.
==> Summary
馃嵑 /usr/local/Cellar/opam/1.2.2_2: 30 files, 14.9M, built in 55 seconds
https://gist.github.com/anonymous/009a06d991ebcc3245422a59dd7a4171
I'm guessing it's because of this:
OCaml library path is /usr/local/lib/node_modules/bs-platform/lib/ocaml
checking for ocamlopt... ocamlopt
Fatal error: unknown C primitive `caml_add_debug_info'
versions differs from ocamlc != 4.02.3+dev1-2016-05-24; ocamlopt discarded.
Looks like it's picking up the BuckleScript ocaml installation which probably isn't what you want. If you have node stuff in your path, that may be the cause of it.
@freebroccolo yep! That was it!
Could we somehow ensure that the homebrew compilation don't pick up the ocaml compilation from node_modules so that others won't face the same problem in the future?
Do you have OCAMLC or OCAMLLIB set in your environment?
@mistydemeo no, I didn't set anything aside from globally npm installing bs-platform, which I don't think would alter the environment globally. The issue has been resolved for me, we only need to ensure that other people don't encounter this problem in the future - i.e. when trying to brew opam after installing bs-platform.
Closing since the OP's issue has been resolved and no one is actively working on follow-up. PRs welcome.
Most helpful comment
@mistydemeo no, I didn't set anything aside from globally npm installing bs-platform, which I don't think would alter the environment globally. The issue has been resolved for me, we only need to ensure that other people don't encounter this problem in the future - i.e. when trying to brew opam after installing bs-platform.