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

gen_js_api fails to build during install #5

Open
glennsl opened this issue Jan 4, 2022 · 3 comments · May be fixed by #6
Open

gen_js_api fails to build during install #5

glennsl opened this issue Jan 4, 2022 · 3 comments · May be fixed by #6

Comments

@glennsl
Copy link

glennsl commented Jan 4, 2022

This fails during spin new with error:

🎁  Installing packages. This might take a couple minutes.
spin: [ERROR] The template generation failed:
The command make dev did not run successfully: exited with code 2

Running make dev yields:

[ERROR] The compilation of gen_js_api.1.0.6 failed at "dune build -p gen_js_api -j 4".

#=== ERROR while compiling gen_js_api.1.0.6 ===================================#
# context     2.1.1 | linux/x86_64 | ocaml-system.4.13.1 | pinned(git+https://github.com/jchavarri/gen_js_api.git#typ_var#1e629a51)
# path        ~/.opam/4.13.1/.opam-switch/build/gen_js_api.1.0.6
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p gen_js_api -j 4
# exit-code   1
# env-file    ~/.opam/log/gen_js_api-2334477-4a6bad.env
# output-file ~/.opam/log/gen_js_api-2334477-4a6bad.out
### output ###
#       ocamlc ppx-lib/.gen_js_api_ppx.objs/byte/gen_js_api_ppx.{cmi,cmti} (exit 2)
# (cd _build/default && /usr/bin/ocamlc.opt -w -40 -g -bin-annot -I ppx-lib/.gen_js_api_ppx.objs/byte -I /home/glennsl/.opam/4.13.1/lib/ocaml-migrate-parsetree -I /usr/lib/ocaml/compiler-libs -no-alias-deps -o ppx-lib/.gen_js_api_ppx.objs/byte/gen_js_api_ppx.cmi -c -intf ppx-lib/gen_js_api_ppx.mli)
# File "ppx-lib/gen_js_api_ppx.mli", line 9, characters 13-56:
# 9 | val mapper : Migrate_parsetree.Ast_408.Ast_mapper.mapper
#                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Error: Unbound module Migrate_parsetree.Ast_408.Ast_mapper

Looking at the Makefile suggests this was made for OCaml 4.10, but switching to that yields the same error:

[ERROR] The compilation of gen_js_api.1.0.6 failed at "dune build -p gen_js_api -j 4".

#=== ERROR while compiling gen_js_api.1.0.6 ===================================#
# context     2.1.1 | linux/x86_64 | ocaml-base-compiler.4.10.2 | pinned(git+https://github.com/jchavarri/gen_js_api.git#typ_var#1e629a51)
# path        ~/.opam/4.10.2/.opam-switch/build/gen_js_api.1.0.6
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p gen_js_api -j 4
# exit-code   1
# env-file    ~/.opam/log/gen_js_api-2336308-3e08ae.env
# output-file ~/.opam/log/gen_js_api-2336308-3e08ae.out
### output ###
#       ocamlc ppx-lib/.gen_js_api_ppx.objs/byte/gen_js_api_ppx.{cmi,cmti} (exit 2)
# (cd _build/default && /home/glennsl/.opam/4.10.2/bin/ocamlc.opt -w -40 -g -bin-annot -I ppx-lib/.gen_js_api_ppx.objs/byte -I /home/glennsl/.opam/4.10.2/lib/ocaml-migrate-parsetree -I /home/glennsl/.opam/4.10.2/lib/ocaml/compiler-libs -no-alias-deps -o ppx-lib/.gen_js_api_ppx.objs/byte/gen_js_api_ppx.cmi -c -intf ppx-lib/gen_js_api_ppx.mli)
# File "ppx-lib/gen_js_api_ppx.mli", line 9, characters 13-56:
# 9 | val mapper : Migrate_parsetree.Ast_408.Ast_mapper.mapper
#                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Error: Unbound module Migrate_parsetree.Ast_408.Ast_mapper

cc @jchavarri as this is what jsoo-react suggests for getting started.

@jchavarri
Copy link
Contributor

Hm sorry about this, I have not updated this template for some time. I will try to take a look soon.

In the meantime, as a workaround I can suggest checking https://github.com/ml-in-barcelona/jsoo-react-template, which does not have the convenience of this spin template, but has been updated quite recently.

@glennsl
Copy link
Author

glennsl commented Jan 4, 2022

Thanks, will give that a shot!

Also, if it helps, it fails with 4.08 too, but with a slightly different error:

#=== ERROR while compiling gen_js_api.1.0.6 ===================================#
# context     2.1.1 | linux/x86_64 | ocaml-base-compiler.4.08.1 | pinned(git+https://github.com/jchavarri/gen_js_api.git#typ_var#1e629a51)
# path        ~/.opam/4.08.1/.opam-switch/build/gen_js_api.1.0.6
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p gen_js_api -j 4
# exit-code   1
# env-file    ~/.opam/log/gen_js_api-2355154-c3b56c.env
# output-file ~/.opam/log/gen_js_api-2355154-c3b56c.out
### output ###
#       ocamlc ppx-driver/.gen_js_api_ppx_driver.objs/byte/gen_js_api_ppx_driver.{cmi,cmo,cmt} (exit 2)
# (cd _build/default && /home/glennsl/.opam/4.08.1/bin/ocamlc.opt -w -40 -g -bin-annot -I ppx-driver/.gen_js_api_ppx_driver.objs/byte -I /home/glennsl/.opam/4.08.1/lib/base -I /home/glennsl/.opam/4.08.1/lib/base/base_internalhash_types -I /home/glennsl/.opam/4.08.1/lib/base/caml -I /home/glennsl/.opam/4.08.1/lib/base/shadow_stdlib -I /home/glennsl/.opam/4.08.1/lib/ocaml-compiler-libs/common -I [...]
# File "ppx-driver/gen_js_api_ppx_driver.ml", line 22, characters 4-39:
# 22 |     Ppxlib.Driver.enable_location_check ()
#          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Error: Unbound value Ppxlib.Driver.enable_location_check

@jchavarri
Copy link
Contributor

I checked the template and it seems it was created at a time where we had to pin gen_js_api to a custom fork.

That's not the case anymore, as jsoo-react uses the published version of gen_js_api. So I don't think we need to pin gen_js_api like the spin template is doing here:

opam pin add -y gen_js_api https://github.com/jchavarri/gen_js_api.git#typ_var

@jchavarri jchavarri linked a pull request Jan 4, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants