doomeer / factorio

Factorio Planner
MIT License
137 stars 40 forks source link

Error building #72

Closed sbliven closed 5 years ago

sbliven commented 5 years ago

I tried building from a fresh opam switch (4.07.1) and got the following error:

~/git/factorio $ make
ocamlbuild -no-links -use-ocamlfind -tag annot factoriojs.byte
+ ocamlfind ocamldep -package js_of_ocaml.syntax -syntax camlp4o -package js_of_ocaml -modules factoriojs.ml > factoriojs.ml.depends
ocamlfind: Package `js_of_ocaml.syntax' not found
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
make: *** [_build/factoriojs.byte] Error 10

I tried installing js_of_ocaml-camlp4 but get the same error.

Sorry if this is an obvious ocaml question, I'm new to the language.

sbliven commented 5 years ago

It looks like this might be an ocaml version problem. After downgrading to 4.01.0 I see the js_of_ocaml.syntax package with ocamlfind list. However I get some other errors. Which ocaml version is required for this project?

sbliven commented 5 years ago

From readme, 4.03.0 is required but I think the js_of_ocaml-camlp4 package should be used instead of js_of_ocaml.syntax.

doomeer commented 5 years ago

You are right, I discovered recently that the package name has changed... I think you can edit file _tags and replace js_of_ocaml.syntax with js_of_ocaml-camlp4 (note the dash instead of the dot) and it should work. Can you try it?

Once I better understand which version to use, I should update the README accordingly. Ideally, this should be configured automatically by detecting the version, but oh well…

doomeer commented 5 years ago

Oh, actually you made a pull request with this exact fix :D

doomeer commented 5 years ago

Side note: I think I had a weird situation with OCaml version 4.03 but with the older js_of_ocaml syntax package. When I reinstalled it on a new computer (for another project), I encountered the same problem as you and it took me a while to figure it out. Sorry you had to go through the same troubles.