Closed Mbodin closed 5 years ago
At this point you should be able to use driver.html in the build path as well as in ~/.opam/jsexplain/share/jsexplain/driver.html
Thanks for the tips. Unfortunately, it still doesn’t work.
During the compilation of fjs_of_fml (step 1):
$ make opam_install
eval $(opam env)
ocamlbuild -j 4 -classic-display -use-ocamlfind -I src -I src/stdlib_fml -no-hygiene fjs_of_fml.byte
ocamlfind ocamlc -c -bin-annot -package str -package compiler-libs.common -I src -I src/stdlib_fml -o src/fjs_of_fml.cmi src/fjs_of_fml.mli
+ ocamlfind ocamlc -c -bin-annot -package str -package compiler-libs.common -I src -I src/stdlib_fml -o src/fjs_of_fml.cmi src/fjs_of_fml.mli
findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /usr/lib/ocaml/compiler-libs, /usr/lib/ocaml
File "src/fjs_of_fml.mli", line 1:
Error: /usr/lib/ocaml/compiler-libs/env.cmi
is not a compiled interface for this version of OCaml.
It seems to be for an older version of OCaml.
Command exited with code 2.
Makefile:96: recipe for target 'fjs_of_fml.byte' failed
make: *** [fjs_of_fml.byte] Error 10
It seems that the Makefile of fjs_of_fml is shortcutting Opam’s links to directly use the system’s libraries with Opam’s OCaml compiler. As they are from different OCaml version and it doesn’t work.
My next step was to remove my system’s ocaml-compiler-libs library and install it in Opam for OCaml 4.07.1:
# apt remove ocaml-compiler-libs
$ opam install ocaml-compiler-libs
Now I get this error:
$ make opam_install
eval $(opam env)
ocamlbuild -j 4 -classic-display -use-ocamlfind -I src -I src/stdlib_fml -no-hygiene fjs_of_fml.byte
make: ocamlbuild: Command not found
Makefile:96: recipe for target 'fjs_of_fml.byte' failed
make: *** [fjs_of_fml.byte] Error 127
So installing ocamlbuild within Opam:
$ opam install ocamlbuild
I now get this error:
$ make opam_install
eval $(opam env)
ocamlbuild -j 4 -classic-display -use-ocamlfind -I src -I src/stdlib_fml -no-hygiene fjs_of_fml.byte
ocamlfind ocamlc -c -bin-annot -package str -package compiler-libs.common -I src -I src/stdlib_fml -o src/fjs_of_fml.cmi src/fjs_of_fml.mli
+ ocamlfind ocamlc -c -bin-annot -package str -package compiler-libs.common -I src -I src/stdlib_fml -o src/fjs_of_fml.cmi src/fjs_of_fml.mli
File "src/fjs_of_fml.mli", line 5, characters 26-31:
Error: Unbound module Env
Command exited with code 2.
Makefile:96: recipe for target 'fjs_of_fml.byte' failed
make: *** [fjs_of_fml.byte] Error 10
I have no idea which path I am missing to compile this Env module ☹
For step 2, I got this error message:
$ opam pin -yn add JS_Parser "https://github.com/resource-reasoning/JS_Parser.git#v0.1.0"
Package JS_Parser does not exist, create as a NEW package? [Y/n] y
[JS_Parser.~dev] synchronised from git+https://github.com/resource-reasoning/JS_Parser.git#v0.1.0
[WARNING] Failed checks on JS_Parser package definition from source at git+https://github.com/resource-reasoning/JS_Parser.git#v0.1.0:
error 57: Synopsis and description must not be both empty
JS_Parser is now pinned to git+https://github.com/resource-reasoning/JS_Parser.git#v0.1.0 (version 0.1.0)
I use Opam 2.0.4: do you think that it might be the reason why I get this error?
The command line opam install -y JS_Parser
then seems to work.
make clean
command is removing any cmi, cmo from previous
build with any other compiler.Thanks for the swift answer! The error must indeed have been from an uncleaned repository: after the clean-up, it now builds. Thanks again! ☺
We need to update the README on this repo, but jsexplain is now hosted at https://gitlab.inria.fr/star-explain
I tried to make the project compile and failed. Here are some comments:
OPAM ~1.2.2 (2.0.0 may also work)
is fine, but the commandopam switch create jsexplain 4.04.2
is an opam 2 command.4.04.2
is ambiguous and thatocaml-base-compiler.4.04.2
should be used instead.opam install -y jsexplain
command, I get the following error:=== ERROR while compiling jsexplain.1.0 ======================================
context 2.0.4 | linux/x86_64 | ocaml-base-compiler.4.04.2 | git+https://github.com/jscert/opam-repository.git#add-pkg-fjs_of_fml
path /path/to/opam/jsexplain/.opam-switch/build/jsexplain.1.0
command /path/to/opam/opam-init/hooks/sandbox.sh build make
exit-code 2
env-file /path/to/opam/log/jsexplain-15557-8415c4.env
output-file /path/to/opam/log/jsexplain-15557-8415c4.out
output
[...]
checking for ocamllex.opt... ocamllex.opt
checking for ocamlyacc... ocamlyacc
checking for ocamlweb... true
checking platform... configure: creating ./config.status
config.status: creating Makefile
make -C jsref mljsref
make[1]: Entering directory '/path/to/opam/jsexplain/.opam-switch/build/jsexplain.1.0/jsref'
Makefile:59: .depends: No such file or directory
Makefile:52: *** Missing generator tools, build from project root, or set paths.. Stop.
make[1]: Leaving directory '/path/to/opam/jsexplain/.opam-switch/build/jsexplain.1.0/jsref'
Makefile:36: recipe for target 'mljsref' failed
make: *** [mljsref] Error 2