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

npm install fails with 4.04.0 installed globally #11

Open
slogsdon opened this issue Dec 30, 2016 · 7 comments
Open

npm install fails with 4.04.0 installed globally #11

slogsdon opened this issue Dec 30, 2016 · 7 comments

Comments

@slogsdon
Copy link

slogsdon commented Dec 30, 2016

Running npm install fails when OCaml 4.04.0 is installed globally:

$ opam switch
--     -- 3.07    Official 3.07 release
--     -- 3.08.0  Official 3.08.0 release
--     -- 3.08.1  Official 3.08.1 release
--     -- 3.08.2  Official 3.08.2 release
--     -- 3.08.3  Official 3.08.3 release
--     -- 3.08.4  Official 3.08.4 release
--     -- 3.09.0  Official 3.09.0 release
--     -- 3.09.1  Official 3.09.1 release
--     -- 3.09.2  Official 3.09.2 release
--     -- 3.09.3  Official 3.09.3 release
--     -- 3.10.0  Official 3.10.0 release
--     -- 3.10.1  Official 3.10.1 release
--     -- 3.10.2  Official 3.10.2 release
--     -- 3.11.0  Official 3.11.0 release
--     -- 3.11.1  Official 3.11.1 release
--     -- 3.11.2  Official 3.11.2 release
--     -- 3.12.0  Official 3.12.0 release
--     -- 3.12.1  Official 3.12.1 release
--     -- 4.00.0  Official 4.00.0 release
--     -- 4.00.1  Official 4.00.1 release
--     -- 4.01.0  Official 4.01.0 release
--     -- 4.02.0  Official 4.02.0 release
--     -- 4.02.1  Official 4.02.1 release
--     -- 4.02.2  Official 4.02.2 release
4.02.3  C 4.02.3  Official 4.02.3 release
--     -- 4.03.0  Official 4.03.0 release
--     -- 4.04.0  Official 4.04.0 release
system  I system  System compiler (4.04.0)
# 244 more patched or experimental compilers, use '--all' to show
$ opam switch system
$ eval `opam config env`
$ git clone https://github.com/reasonml/ReasonProject HelloReason
$ cd HelloReason
$ npm install
# ... later
ocamlc -I +compiler-libs -g -c fl_lint.ml
ocamlc -I +compiler-libs -a -o findlib.cma findlib_config.cmo fl_split.cmo fl_metatoken.cmo fl_meta.cmo fl_metascanner.cmo fl_topo.cmo fl_package_base.cmo findlib.cmo fl_args.cmo fl_lint.cmo
ocamlc -I +compiler-libs -g -c ocaml_args.ml
ocamlc -I +compiler-libs -g -c frontend.ml
File "frontend.ml", line 1787, characters 16-29:
Warning 3: deprecated: String.create
Use Bytes.create instead.
ocamlc -I +compiler-libs  -o ocamlfind -g findlib.cma unix.cma \
                   ocaml_args.cmo frontend.cmo
File "_none_", line 1:
Error: Error on dynamically loaded library: /usr/local/lib/ocaml/stublibs/dllunix.so: dlopen(/usr/local/lib/ocaml/stublibs/dllunix.so, 138): Symbol not found: _caml_string_is_c_safe
  Referenced from: /usr/local/lib/ocaml/stublibs/dllunix.so
  Expected in: flat namespace
 in /usr/local/lib/ocaml/stublibs/dllunix.so
make[1]: *** [ocamlfind] Error 2
make: *** [all] Error 2
[email protected] /Users/shane.logsdon/Code/reason/HelloReason
├─┬ @opam-alpha/[email protected]
│ └─┬ [email protected]  (git://github.com/npm-opam/merlin.git#5b236062b3cceff3e653ba47283159cf6895a93b)
│   ├─┬ @opam-alpha/[email protected]
│   │ └─┬ [email protected]  (git://github.com/npm-opam/yojson.git#a72727dd8899c53153fd8a7cea06c626d0a71faf)
│   │   ├─┬ @opam-alpha/[email protected]
│   │   │ └─┬ [email protected]  (git://github.com/npm-opam/biniou.git#198ece6041aa0853bc1637475796840b3daae5a9)
│   │   │   └─┬ @opam-alpha/[email protected]
│   │   │     └── [email protected]  (git://github.com/npm-opam/conf-which.git#0b798e035ea41e43744ff28075b15d1a5dc9ac99)
│   │   ├─┬ @opam-alpha/[email protected]
│   │   │ └─┬ [email protected]  (git://github.com/npm-opam/cppo.git#f93baf17d8099c5866df939264ddddb6457aa7d2)
│   │   │   └── @opam-alpha/[email protected]
│   │   └─┬ @opam-alpha/[email protected]
│   │     └── [email protected]  (git://github.com/npm-opam/easy-format.git#9a61ee2ca3cff40b50a36dc66dcb7761d096a451)
│   ├─┬ [email protected]  (git+https://github.com/yunxing/opam-installer-bin.git#689ede681217f76fb2f82a9f4528e192a5b543ba)
│   │ ├── [email protected]  (git+https://github.com/npm-ml/dependency-env.git#94c75aff3a71587afb570d89bcf2eef7996bb67f)
│   │ └── [email protected]  (git+https://github.com/yunxing/nopam.git#7cd19f068ac9aaf75010cd6961f7c65c779a1d4a)
│   └── [email protected]  (git+https://github.com/yunxing/substs.git#fd480dcdb4aed3fa9128fd819a546e3a7770040f)
├─┬ @opam-alpha/[email protected]
│ └── [email protected]  (git+https://github.com/npm-opam/ocaml.git#0bb98be8e5233a02282ed8de0c8965677ddbde33)
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
└── [email protected]

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/7.3.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v7.3.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `eval $(dependencyEnv) && nopam && ./configure -no-camlp4 -bindir $opam_bin -sitelib $opam_lib -mandir $opam_man -config $opam_lib/findlib.conf -no-custom && make all && make opt && make install`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'eval $(dependencyEnv) && nopam && ./configure -no-camlp4 -bindir $opam_bin -sitelib $opam_lib -mandir $opam_man -config $opam_lib/findlib.conf -no-custom && make all && make opt && make install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ocamlfind-actual package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eval $(dependencyEnv) && nopam && ./configure -no-camlp4 -bindir $opam_bin -sitelib $opam_lib -mandir $opam_man -config $opam_lib/findlib.conf -no-custom && make all && make opt && make install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ocamlfind-actual
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ocamlfind-actual
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/shane.logsdon/Code/reason/HelloReason/npm-debug.log

Switching to 4.02.3 seems to correct the issue:

$ cd ..
$ rm -rf HelloReason
$ opam switch
--     -- 3.07    Official 3.07 release
--     -- 3.08.0  Official 3.08.0 release
--     -- 3.08.1  Official 3.08.1 release
--     -- 3.08.2  Official 3.08.2 release
--     -- 3.08.3  Official 3.08.3 release
--     -- 3.08.4  Official 3.08.4 release
--     -- 3.09.0  Official 3.09.0 release
--     -- 3.09.1  Official 3.09.1 release
--     -- 3.09.2  Official 3.09.2 release
--     -- 3.09.3  Official 3.09.3 release
--     -- 3.10.0  Official 3.10.0 release
--     -- 3.10.1  Official 3.10.1 release
--     -- 3.10.2  Official 3.10.2 release
--     -- 3.11.0  Official 3.11.0 release
--     -- 3.11.1  Official 3.11.1 release
--     -- 3.11.2  Official 3.11.2 release
--     -- 3.12.0  Official 3.12.0 release
--     -- 3.12.1  Official 3.12.1 release
--     -- 4.00.0  Official 4.00.0 release
--     -- 4.00.1  Official 4.00.1 release
--     -- 4.01.0  Official 4.01.0 release
--     -- 4.02.0  Official 4.02.0 release
--     -- 4.02.1  Official 4.02.1 release
--     -- 4.02.2  Official 4.02.2 release
4.02.3  I 4.02.3  Official 4.02.3 release
--     -- 4.03.0  Official 4.03.0 release
--     -- 4.04.0  Official 4.04.0 release
system  C system  System compiler (4.04.0)
# 244 more patched or experimental compilers, use '--all' to show
$ opam switch 4.02.3
$ eval `opam config env`
$ git clone https://github.com/reasonml/ReasonProject HelloReason
$ cd HelloReason
$ npm install
# ... later
> [email protected] postinstall /Users/shane.logsdon/Code/reason/HelloReason
> npm run reasonBuild


> [email protected] reasonBuild /Users/shane.logsdon/Code/reason/HelloReason
> eval $(dependencyEnv) && nopam && rebuild -I src ./src/Test.native 2>&1 | refmterr

/Users/shane.logsdon/Code/reason/HelloReason/node_modules/ocaml/bin/ocamldep.opt -modules -pp refmt -impl src/Test.re | tee src/Test.re.depends > src/Test.ml.depends
env OCAMLC="ocamlc.opt" /Users/shane.logsdon/code/reason/HelloReason/node_modules/reason/_build/ocamlfind/bin/rec -c -I src -pp refmt -o src/Test.cmo -intf-suffix .rei -impl src/Test.re
env OCAMLOPT="ocamlopt.opt" /Users/shane.logsdon/code/reason/HelloReason/node_modules/reason/_build/ocamlfind/bin/reopt -c -I src -pp refmt -o src/Test.cmx -intf-suffix .rei -impl src/Test.re
env OCAMLOPT="ocamlopt.opt" /Users/shane.logsdon/code/reason/HelloReason/node_modules/reason/_build/ocamlfind/bin/reopt src/Test.cmx -o src/Test.native
✔ Seems fine!
[email protected] /Users/shane.logsdon/Code/reason/HelloReason
├─┬ @opam-alpha/[email protected]
│ └─┬ [email protected]  (git://github.com/npm-opam/merlin.git#5b236062b3cceff3e653ba47283159cf6895a93b)
│   └─┬ @opam-alpha/[email protected]
│     └─┬ [email protected]  (git://github.com/npm-opam/yojson.git#a72727dd8899c53153fd8a7cea06c626d0a71faf)
│       └─┬ @opam-alpha/[email protected]
│         └─┬ [email protected]  (git://github.com/npm-opam/biniou.git#198ece6041aa0853bc1637475796840b3daae5a9)
│           └─┬ @opam-alpha/[email protected]
│             └── [email protected]  (git://github.com/npm-opam/conf-which.git#0b798e035ea41e43744ff28075b15d1a5dc9ac99)
├─┬ @opam-alpha/[email protected]
│ └── [email protected]  (git+https://github.com/npm-opam/ocaml.git#0bb98be8e5233a02282ed8de0c8965677ddbde33)
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
└─┬ [email protected]
  ├─┬ @opam-alpha/[email protected]
  │ └─┬ [email protected]  (git://github.com/npm-opam/BetterErrors.git#3a8c29bb67089b4b615ced135f3bd608be0e5aa0)
  │   └─┬ @opam-alpha/[email protected]
  │     └── [email protected]  (git://github.com/npm-opam/ANSITerminal.git#787c809f7b3e0d6445b803805f81a74a2af7b503)
  ├─┬ @opam-alpha/[email protected]
  │ └── [email protected]  (git://github.com/npm-opam/easy-format.git#9a61ee2ca3cff40b50a36dc66dcb7761d096a451)
  ├─┬ @opam-alpha/[email protected]
  │ └─┬ [email protected]  (git://github.com/npm-opam/menhir.git#8d6905e8eeb4bedcec501a14fdc7a7d950f85874)
  │   └── @opam-alpha/[email protected]
  ├─┬ @opam-alpha/[email protected]
  │ └─┬ [email protected]  (git://github.com/npm-opam/merlin-extend.git#8d01d124db27f46a27e04f25d0e1c54bab0d0f48)
  │   └─┬ @opam-alpha/[email protected]
  │     └── [email protected]  (git://github.com/npm-opam/cppo.git#f93baf17d8099c5866df939264ddddb6457aa7d2)
  ├─┬ @opam-alpha/[email protected]
  │ └─┬ [email protected]  (git+https://github.com/npm-opam/ocamlfind.git#f6ea48c7628210d477ead863d32feba2357b9afe)
  │   └─┬ @opam-alpha/[email protected]
  │     └── [email protected]  (git://github.com/npm-opam/conf-m4.git#75e353ae7ae97a988319ddb0e97ecfa25bce4739)
  ├─┬ @opam-alpha/[email protected]
  │ └── [email protected]  (git://github.com/npm-opam/re.git#9da39424a8a4a12a768f90b1e5cc4401102b6834)
  ├── [email protected]  (git+https://github.com/reasonml/dependency-env.git#94c75aff3a71587afb570d89bcf2eef7996bb67f)
  ├── [email protected]  (git+https://github.com/reasonml/nopam.git#7cd19f068ac9aaf75010cd6961f7c65c779a1d4a)
  ├─┬ [email protected]  (git+https://github.com/yunxing/opam-installer-bin.git#689ede681217f76fb2f82a9f4528e192a5b543ba)
  │ ├── [email protected]  (git+https://github.com/npm-ml/dependency-env.git#94c75aff3a71587afb570d89bcf2eef7996bb67f)
  │ └── [email protected]  (git+https://github.com/yunxing/nopam.git#7cd19f068ac9aaf75010cd6961f7c65c779a1d4a)
  ├── [email protected]  (git+https://github.com/yunxing/substs.git#fd480dcdb4aed3fa9128fd819a546e3a7770040f)
  └─┬ [email protected]  (git+https://github.com/reasonml/utop-bin.git#5e9e322c1f264c0d9e8abb9f85e5472de1c8147d)
    ├── [email protected]  (git+https://github.com/reasonml/camomile-bin.git#08f5d6115b76d46897af47b9ee8e70a55973b40f)
    ├─┬ [email protected]  (git+https://github.com/reasonml/lambda-term-bin.git#72137b68f22af1fd2d1e52afbb02ff45b494908a)
    │ └── [email protected]  (git+https://github.com/reasonml/zed-bin.git#7d2f0677a4a73c1b51ecbf05589e1f7b5bd76705)
    ├── [email protected]  (git+https://github.com/reasonml/lwt-bin.git#96859b56091d3b46d3c36e80522a137bb768fee5)
    └── [email protected]  (git+https://github.com/reasonml/react-bin.git#b9868712a9e76af9de52e726912bdd99f9a66e87)

I'm checking into the following things but wanted to get this logged beforehand:

  • Remove all versions of OCaml and test
  • Reinstall 4.04.0 to see if the issue persists
  • If so, Reinstall 4.02.3 to see if the issue is resolved again by switching to that version.

Edit: Adding version numbers:

  • Mac OS X 10.11.6
  • npm 3.10.10
  • node v7.3.0
  • opam 1.2.2
@slogsdon
Copy link
Author

Removing OCaml and related tools from the system seems to allow npm install to work without issue:

$ brew uninstall opam
Uninstalling /usr/local/Cellar/opam/1.2.2_2... (30 files, 14.9M)
$ brew uninstall ocaml camlp4 ocamlbuild
Uninstalling /usr/local/Cellar/ocaml/4.04.0... (1,730 files, 194.0M)
Uninstalling /usr/local/Cellar/camlp4/4.04+1... (165 files, 143M)
Uninstalling /usr/local/Cellar/ocamlbuild/0.9.3_1... (27 files, 6.9M)
$ brew uninstall --force ocaml camlp4 ocamlbuild
$ brew uninstall opam --force
$ ± rm -rf ~/.opam/
$ cd ..
$ rm -rf HelloReason
$ which opam
opam not found
$ which ocaml
ocaml not found
$ which ocamlbuild
ocamlbuild not found
$ git clone https://github.com/reasonml/ReasonProject HelloReason
$ cd HelloReason
$ npm install
# ... later
> [email protected] postinstall /Users/shane.logsdon/Code/reason/HelloReason
> npm run reasonBuild


> [email protected] reasonBuild /Users/shane.logsdon/Code/reason/HelloReason
> eval $(dependencyEnv) && nopam && rebuild -I src ./src/Test.native 2>&1 | refmterr

/Users/shane.logsdon/Code/reason/HelloReason/node_modules/ocaml/bin/ocamldep.opt -modules -pp refmt -impl src/Test.re | tee src/Test.re.depends > src/Test.ml.depends
env OCAMLC="ocamlc.opt" /Users/shane.logsdon/code/reason/HelloReason/node_modules/reason/_build/ocamlfind/bin/rec -c -I src -pp refmt -o src/Test.cmo -intf-suffix .rei -impl src/Test.re
env OCAMLOPT="ocamlopt.opt" /Users/shane.logsdon/code/reason/HelloReason/node_modules/reason/_build/ocamlfind/bin/reopt -c -I src -pp refmt -o src/Test.cmx -intf-suffix .rei -impl src/Test.re
env OCAMLOPT="ocamlopt.opt" /Users/shane.logsdon/code/reason/HelloReason/node_modules/reason/_build/ocamlfind/bin/reopt src/Test.cmx -o src/Test.native
✔ Seems fine!
[email protected] /Users/shane.logsdon/Code/reason/HelloReason
├─┬ @opam-alpha/[email protected]
│ └─┬ [email protected]  (git://github.com/npm-opam/merlin.git#5b236062b3cceff3e653ba47283159cf6895a93b)
│   └─┬ @opam-alpha/[email protected]
│     └─┬ [email protected]  (git://github.com/npm-opam/yojson.git#a72727dd8899c53153fd8a7cea06c626d0a71faf)
│       └─┬ @opam-alpha/[email protected]
│         └─┬ [email protected]  (git://github.com/npm-opam/biniou.git#198ece6041aa0853bc1637475796840b3daae5a9)
│           └─┬ @opam-alpha/[email protected]
│             └── [email protected]  (git://github.com/npm-opam/conf-which.git#0b798e035ea41e43744ff28075b15d1a5dc9ac99)
├─┬ @opam-alpha/[email protected]
│ └── [email protected]  (git+https://github.com/npm-opam/ocaml.git#0bb98be8e5233a02282ed8de0c8965677ddbde33)
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
└─┬ [email protected]
  ├─┬ @opam-alpha/[email protected]
  │ └─┬ [email protected]  (git://github.com/npm-opam/BetterErrors.git#3a8c29bb67089b4b615ced135f3bd608be0e5aa0)
  │   └─┬ @opam-alpha/[email protected]
  │     └── [email protected]  (git://github.com/npm-opam/ANSITerminal.git#787c809f7b3e0d6445b803805f81a74a2af7b503)
  ├─┬ @opam-alpha/[email protected]
  │ └── [email protected]  (git://github.com/npm-opam/easy-format.git#9a61ee2ca3cff40b50a36dc66dcb7761d096a451)
  ├─┬ @opam-alpha/[email protected]
  │ └─┬ [email protected]  (git://github.com/npm-opam/menhir.git#8d6905e8eeb4bedcec501a14fdc7a7d950f85874)
  │   └── @opam-alpha/[email protected]
  ├─┬ @opam-alpha/[email protected]
  │ └─┬ [email protected]  (git://github.com/npm-opam/merlin-extend.git#8d01d124db27f46a27e04f25d0e1c54bab0d0f48)
  │   └─┬ @opam-alpha/[email protected]
  │     └── [email protected]  (git://github.com/npm-opam/cppo.git#f93baf17d8099c5866df939264ddddb6457aa7d2)
  ├─┬ @opam-alpha/[email protected]
  │ └─┬ [email protected]  (git+https://github.com/npm-opam/ocamlfind.git#f6ea48c7628210d477ead863d32feba2357b9afe)
  │   └─┬ @opam-alpha/[email protected]
  │     └── [email protected]  (git://github.com/npm-opam/conf-m4.git#75e353ae7ae97a988319ddb0e97ecfa25bce4739)
  ├─┬ @opam-alpha/[email protected]
  │ └── [email protected]  (git://github.com/npm-opam/re.git#9da39424a8a4a12a768f90b1e5cc4401102b6834)
  ├── [email protected]  (git+https://github.com/reasonml/dependency-env.git#94c75aff3a71587afb570d89bcf2eef7996bb67f)
  ├── [email protected]  (git+https://github.com/reasonml/nopam.git#7cd19f068ac9aaf75010cd6961f7c65c779a1d4a)
  ├─┬ [email protected]  (git+https://github.com/yunxing/opam-installer-bin.git#689ede681217f76fb2f82a9f4528e192a5b543ba)
  │ ├── [email protected]  (git+https://github.com/npm-ml/dependency-env.git#94c75aff3a71587afb570d89bcf2eef7996bb67f)
  │ └── [email protected]  (git+https://github.com/yunxing/nopam.git#7cd19f068ac9aaf75010cd6961f7c65c779a1d4a)
  ├── [email protected]  (git+https://github.com/yunxing/substs.git#fd480dcdb4aed3fa9128fd819a546e3a7770040f)
  └─┬ [email protected]  (git+https://github.com/reasonml/utop-bin.git#5e9e322c1f264c0d9e8abb9f85e5472de1c8147d)
    ├── [email protected]  (git+https://github.com/reasonml/camomile-bin.git#08f5d6115b76d46897af47b9ee8e70a55973b40f)
    ├─┬ [email protected]  (git+https://github.com/reasonml/lambda-term-bin.git#72137b68f22af1fd2d1e52afbb02ff45b494908a)
    │ └── [email protected]  (git+https://github.com/reasonml/zed-bin.git#7d2f0677a4a73c1b51ecbf05589e1f7b5bd76705)
    ├── [email protected]  (git+https://github.com/reasonml/lwt-bin.git#96859b56091d3b46d3c36e80522a137bb768fee5)
    └── [email protected]  (git+https://github.com/reasonml/react-bin.git#b9868712a9e76af9de52e726912bdd99f9a66e87)

@slogsdon
Copy link
Author

Attempting again from scratch with 4.04.0 sees the exact same result as before:

$ brew install opam
==> Installing dependencies for opam: ocaml, ocamlbuild, camlp4
==> Installing opam dependency: ocaml
==> Downloading https://homebrew.bintray.com/bottles/ocaml-4.04.0.el_capitan.bottle.tar.gz
Already downloaded: /Users/shane.logsdon/Library/Caches/Homebrew/ocaml-4.04.0.el_capitan.bottle.tar.gz
==> Pouring ocaml-4.04.0.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/ocaml/4.04.0: 1,730 files, 194.0M
==> Installing opam dependency: ocamlbuild
==> Downloading https://homebrew.bintray.com/bottles/ocamlbuild-0.9.3_1.el_capitan.bottle.tar.gz
Already downloaded: /Users/shane.logsdon/Library/Caches/Homebrew/ocamlbuild-0.9.3_1.el_capitan.bottle.tar.gz
==> Pouring ocamlbuild-0.9.3_1.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/ocamlbuild/0.9.3_1: 27 files, 6.9M
==> Installing opam dependency: camlp4
==> Downloading https://homebrew.bintray.com/bottles/camlp4-4.04+1.el_capitan.bottle.tar.gz
Already downloaded: /Users/shane.logsdon/Library/Caches/Homebrew/camlp4-4.04+1.el_capitan.bottle.tar.gz
==> Pouring camlp4-4.04+1.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/camlp4/4.04+1: 165 files, 143M
==> Installing opam
==> Downloading https://homebrew.bintray.com/bottles/opam-1.2.2_2.el_capitan.bottle.tar.gz
Already downloaded: /Users/shane.logsdon/Library/Caches/Homebrew/opam-1.2.2_2.el_capitan.bottle.tar.gz
==> Pouring opam-1.2.2_2.el_capitan.bottle.tar.gz
==> Caveats
OPAM uses ~/.opam by default for its package database, so you need to
initialize it first by running (as a normal user):

$  opam init

Run the following to initialize your environment variables:

$  eval `opam config env`

To export the needed variables every time, add them to your dotfiles.
  * On Bash, add them to `~/.bash_profile`.
  * On Zsh, add them to `~/.zprofile` or `~/.zshrc` instead.

Documentation and tutorials are available at https://opam.ocaml.org, or
via "man opam" and "opam --help".

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/opam/1.2.2_2: 30 files, 14.9M
$ opam init
Checking for available remotes: rsync and local, git, mercurial.
  - you won't be able to use darcs repositories unless you install the darcs command on your system.


=-=- Fetching repository information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫
[default] synchronized from https://opam.ocaml.org

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫
∗  installed base-bigarray.base
∗  installed base-threads.base
∗  installed base-unix.base
Done.

In normal operation, OPAM only alters files within ~/.opam.

During this initialisation, you can allow OPAM to add information to two
other files for best results. You can also make these additions manually
if you wish.

If you agree, OPAM will modify:

  - ~/.zshrc (or a file you specify) to set the right environment
    variables and to load the auto-completion scripts for your shell (zsh)
    on startup. Specifically, it checks for and appends the following line:

    . /Users/shane.logsdon/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true


  - ~/.ocamlinit to ensure that non-system installations of `ocamlfind`
    (i.e. those installed by OPAM) will work correctly when running the
    OCaml toplevel. It does this by adding $OCAML_TOPLEVEL_PATH to the list
    of include directories.

If you choose to not configure your system now, you can either configure
OPAM manually (instructions will be displayed) or launch the automatic setup
later by running:

   opam config setup -a


Do you want OPAM to modify ~/.zshrc and ~/.ocamlinit?
(default is 'no', use 'f' to name a file other than ~/.zshrc)
    [N/y/f] y

User configuration:
  ~/.ocamlinit is already up-to-date.
  ~/.zshrc is already configured for another OPAM root.
Global configuration:
  Updating ~/.opam/opam-init/init.sh
  Updating ~/.opam/opam-init/init.zsh
  Updating ~/.opam/opam-init/init.csh
  Updating ~/.opam/opam-init/init.fish
# To setup the new switch in the current shell, you need to run:
eval `opam config env`
$ eval `opam config env`
$ cd ..
$ rm -rf HelloReason
$ git clone https://github.com/reasonml/ReasonProject HelloReason
$ cd HelloReason
$ npm install

Using opam switch 4.02.3 also corrects the issue.


Funny enough, installing 4.04.0 through Opam (with opam switch 4.04.0) works, so the issue seems to be caused by system installed OCaml 4.04.0.

@jordwalke
Copy link
Member

Great repro documentation. esy and we're looking at making esy the standard way of building packages. But what can we do in the mean time to prevent this from happening (a quicker fix?)

@slogsdon
Copy link
Author

I would say that updating the README would be a good start, letting users know to opam switch to a non-system version if they experience issues. Thoughts?

@jordwalke
Copy link
Member

Updated the docs, and we are working on a legit fix to this issue. Thank you for reporting.

@graforlock
Copy link

+1 Same issue here.

@jordwalke
Copy link
Member

Very close to getting big fix that prevents any global environment from even being perceived by the package install.

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