ocaml-sf / learn-ocaml

A Web Application for Learning OCaml
https://ocaml-sf.org/learn-ocaml/
MIT License
298 stars 66 forks source link

Fail to build on Debian GNU/Linux 10.2 #340

Open mthl opened 4 years ago

mthl commented 4 years ago

Hello,

I am unable to build learn-ocaml master branch (7f3ce568000b042986d735745b27fb5b53a56dfb) on my system with opam 2.0.3 and ocaml-4.05.0. Here is the error message I am getting when doing make

$ make
make[1] : on entre dans le répertoire « /home/mthl/src/learn-ocaml/static »
make[2] : on entre dans le répertoire « /home/mthl/src/learn-ocaml/static/icons »
make[2]: rien à faire pour « all ».
make[2] : on quitte le répertoire « /home/mthl/src/learn-ocaml/static/icons »
make[1] : on quitte le répertoire « /home/mthl/src/learn-ocaml/static »
File "src/server/dune", line 10, characters 12-22:
10 |             cohttp.lwt
                 ^^^^^^^^^^
Error: Library "cohttp.lwt" not found.
Hint: try: dune external-lib-deps --missing --profile release @@default
File "src/main/dune", line 34, characters 12-22:
34 |             cohttp.lwt
                 ^^^^^^^^^^
Error: Library "cohttp.lwt" not found.
Hint: try: dune external-lib-deps --missing --profile release @@default
File "src/app/dune", line 15, characters 4-29:
15 |     ocplib-json-typed.browser
         ^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "ocplib-json-typed.browser" not found.
Hint: try: dune external-lib-deps --missing --profile release @@default
File "src/grader/dune", line 163, characters 12-37:
163 |             ocplib-json-typed.browser
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "ocplib-json-typed.browser" not found.
Hint: try: dune external-lib-deps --missing --profile release @@default
File "src/grader/dune", line 179, characters 12-37:
179 |             ocplib-json-typed.browser
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "ocplib-json-typed.browser" not found.
Hint: try: dune external-lib-deps --missing --profile release @@default
File "src/toploop/toploop_jsoo.ml", line 23, characters 30-49:
Error: Unbound module Option
File "src/utils/js_utils.mli", line 41, characters 7-21:
Error: Unbound module Tyxml_js
File "src/utils/lwt_request.ml", line 13, characters 35-48:
Error: Unbound module Url
make: *** [Makefile:11: build] Error 1

Any clue how to solve this?

yurug commented 4 years ago

Hi!

did you perform:

opam install --deps-only .

to install the dependencies? Did you properly configure your environment with eval $(opam env)?

mthl commented 4 years ago

I have used the following commands before running make

opam switch create . --deps-only --locked
opam install opam-installer
eval $(opam env)

Thanks for your quick reply.

diogit commented 4 years ago

Hi!

did you perform:

opam install --deps-only .

to install the dependencies? Did you properly configure your environment with eval $(opam env)?

Had the same issue in macOS 10.15.2 and this command solved it.

mthl commented 4 years ago

Hello, I gave up on this issue. the time required to run opam related command take way too long for me to continue investigating more.

the last time I tried, I noticed that there was an issue in the opam install opam-installer step.

# ...
#=== ERROR while compiling opam-installer.2.0.6 ===============================#
# context              2.0.3 | linux/x86_64 | ocaml-system.4.05.0 | https://opam.ocaml.org#f1b6c3c1
# path                 ~/src/learn-ocaml/_opam/.opam-switch/build/opam-installer.2.0.6
# command              ~/.opam/opam-init/hooks/sandbox.sh build make opam-installer.install
# exit-code            2
# env-file             ~/.opam/log/opam-installer-29057-f7c249.env
# output-file          ~/.opam/log/opam-installer-29057-f7c249.out
### output ###
# dune build --profile=release  opam-installer.install
# Error: mkdir: _build: Read-only file system
# make: *** [Makefile:110: opam-installer.install] Error 1
# ...

Maybe unrelated but I noticed that when installing opam on debian it installs an older version of opam-installer which might be related.

Anyway thanks to everyone who have provided some input on that issue.

hannelita commented 4 years ago

Hi! I got the environment properly set up on MacOS with

opam switch create . 4.05.0 --deps-only //I got problems with newer versions
opam install opam-installer.2.0.5 //I got problems with newer versions
eval $(opam env)
opam install --deps-only .