Schmavery / FlappyBird

61 stars 2 forks source link

Fail to build #3

Closed broerjuang closed 6 years ago

broerjuang commented 6 years ago

Hi thanks for live streaming, it really helps me to play with reason 😍 . I try to start this but get following error.

> FlappyBird@0.0.0 build /Users/Me/weekend/reason/learningReprocessing/FlappyBird
> bsb -make-world

[2/2] Building fake_src/sdl_index.mlast.d
[2/2] Building lib.cma
[3/3] Building build.ninja
ocamlopt.opt -c -ccopt -I -ccopt ../sdl2/include/ src/tsdl_new.c
[2/2] Building lib.cma
[3/3] Building build.ninja
ocamlopt.opt -c src/tgls_new.c
[2/2] Building lib.cma
[17/17] Building build.ninja
FAILED: build.ninja
cd ../../.. && export BSLIB=/Users/Me/weekend/reason/learningReprocessing/FlappyBird/node_modules/bs-platform/vendor/ocaml/lib/ocaml && export OCAML_SYSTHREADS=/Users/Me/weekend/reason/learningReprocessing/FlappyBird/node_modules/bs-platform/vendor/ocaml/otherlibs/systhreads && export PATH=/Users/Me/weekend/reason/learningReprocessing/FlappyBird/node_modules/.bin:/Users/Me/weekend/reason/learningReprocessing/FlappyBird/node_modules/bs-platform/vendor/ocaml:/Users/Me/weekend/reason/learningReprocessing/FlappyBird/node_modules/bs-platform/bin:$PATH && make lib
gcc -I -c src/native/soil_wrapper.c -o _build/lib/libsoil_wrapper.a
src/native/soil_wrapper.c:3:10: fatal error: 'caml/alloc.h' file not found
#include <caml/alloc.h>
         ^
1 error generated.
make: *** [_build/lib/libsoil_wrapper.a] Error 1
ninja: error: rebuilding 'build.ninja': subcommand failed
Failure: /Users/Me/weekend/reason/learningReprocessing/FlappyBird/node_modules/bs-platform/lib/ninja.exe
 Location: /Users/Me/weekend/reason/learningReprocessing/FlappyBird/node_modules/Reasongl/lib/bs/bytecode
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! FlappyBird@0.0.0 build: `bsb -make-world`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the FlappyBird@0.0.0 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/Me/.npm/_logs/2018-01-16T15_27_25_136Z-debug.log

still not sure how to fix this. I installed npm 4 as you suggested or yarn, but the build still failed.

bsansouci commented 6 years ago

Hey! Could you check that there is a folder called caml in Users/Me/weekend/reason/learningReprocessing/FlappyBird/node_modules/bs-platform/vendor/ocaml/lib/ocaml? Also do you have ocaml installed globally through opam? Do you have Reason-cli? Not sure what’s going on here yet.

broerjuang commented 6 years ago

There's no lib in Users/Me/weekend/reason/learningReprocessing/FlappyBird/node_modules/bs-platform/vendor/ocaml/

β”œβ”€β”€ Changes
β”œβ”€β”€ INSTALL
β”œβ”€β”€ LICENSE
β”œβ”€β”€ Makefile
β”œβ”€β”€ Makefile.nt
β”œβ”€β”€ README
β”œβ”€β”€ README.win32
β”œβ”€β”€ VERSION
β”œβ”€β”€ asmcomp
β”œβ”€β”€ asmrun
β”œβ”€β”€ boot
β”œβ”€β”€ bytecomp
β”œβ”€β”€ byterun
β”œβ”€β”€ compilerlibs
β”œβ”€β”€ config
β”œβ”€β”€ configure
β”œβ”€β”€ debugger
β”œβ”€β”€ driver
β”œβ”€β”€ emacs
β”œβ”€β”€ experimental
β”œβ”€β”€ lex
β”œβ”€β”€ man
β”œβ”€β”€ ocamlbuild
β”œβ”€β”€ ocamldoc
β”œβ”€β”€ otherlibs
β”œβ”€β”€ parsing
β”œβ”€β”€ stdlib
β”œβ”€β”€ testsuite
β”œβ”€β”€ tools
β”œβ”€β”€ toplevel
β”œβ”€β”€ typing
β”œβ”€β”€ utils
└── yacc

Yes, I have reasoncli and ocaml installed. The version of Ocaml installed is 4.02.3

bsansouci commented 6 years ago

What OS are you using?

Did the install process go smoothly? This looks like master of bsb-native... Here's what's supposed to be in /vendor/ocaml when using the release of bsb-native #2.1.1 :

node_modules/bs-platform/vendor/ocaml/
β”œβ”€β”€ bin
β”œβ”€β”€ lib
β”œβ”€β”€ ocamlc.opt
└── ocamlopt.opt
bsansouci commented 6 years ago

Ok I was able to repro, and I pushed a fix https://github.com/bsansouci/reasongl/commit/616a193eff6386b30639cb1771d5e8a932158782 try it now. Make sure to nuke node_modules and any lock files.

broerjuang commented 6 years ago

Yes install process goes as usual. No error produced while using yarn or npm, I use macOS Sierra version 10.12.4.

broerjuang commented 6 years ago

Thanks @bsansouci ! it fixes now πŸ’― and thanks again for awesome live stream!

bsansouci commented 6 years ago

Great! Sorry for the trouble :)