bsansouci / reprocessing-example

79 stars 29 forks source link

Running `npm run build` fails on OS X #10

Open feihong opened 6 years ago

feihong commented 6 years ago

Here's the output I see in my terminal:

> reprocessing-example@ build /Users/fhsu/reference/reprocessing-example
> bsb -make-world

[2/2] Building fake_src/sdl_index.mlast.d
[2/2] Building lib.cma
[4/4] Building run_build_script
FAILED: run_build_script
/Users/fhsu/reference/reprocessing-example/node_modules/Tsdl/lib/bs/bytecode/build_script.exe /Users/fhsu/reference/reprocessing-example/node_modules/bs-platform/vendor /Users/fhsu/reference/reprocessing-example/node_modules/bs-platform/vendor/ocaml/lib/ocaml /Users/fhsu/reference/reprocessing-example/node_modules/Tsdl /Users/fhsu/reference/reprocessing-example
Fatal error: cannot load shared library dllunix
Reason: dlopen(/usr/local/lib/ocaml/stublibs/dllunix.so, 138): Symbol not found: _caml_ba_compare
  Referenced from: /usr/local/lib/ocaml/stublibs/dllunix.so
  Expected in: flat namespace
 in /usr/local/lib/ocaml/stublibs/dllunix.so
ninja: error: rebuilding 'build.ninja': subcommand failed
Failure: /Users/fhsu/reference/reprocessing-example/node_modules/bs-platform/lib/ninja.exe
 Location: /Users/fhsu/reference/reprocessing-example/node_modules/Tsdl/lib/bs/bytecode
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! reprocessing-example@ build: `bsb -make-world`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the reprocessing-example@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/fhsu/.npm/_logs/2018-07-02T18_39_59_156Z-debug.log
bsansouci commented 6 years ago

You wouldn't happen to have a global version of ocaml installed by any chance?

Asking because idk why it'd be using a global path like /usr/local/lib/ocaml/stublibs/dllunix.so

feihong commented 6 years ago

Ah, yes, that was the problem. I wasn't using ocaml so I just uninstalled it and the build succeeds. Is this a common problem that people are running into? If so then it might be nice to put a note about it in the README. If not, then I'll just close this issue.

bsansouci commented 6 years ago

No this isn't suppose to happen. I'll fix this bug when I come back home. Thanks for finding it.

joshmhanson commented 5 years ago

I ran into this as well on Ubuntu Linux. I didn't have to uninstall OCaml, however, to fix it; I only had to switch the installed OCaml compiler to the BuckleScript fork.

sjqtentacles commented 5 years ago

Can confirm this is still an issue. Running linux mint. It worked after uninstalling opam/ocaml and also removing the hidden ~/.opam directory.

bsansouci commented 5 years ago

@Nixonite @hanjiexi Could you guys re-try now. We published a new version of bsb-native (4.0.1100) which should fix this.