ocaml-sf / learn-ocaml

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

Bug: does not install when following instructions #579

Open jbulow opened 11 months ago

jbulow commented 11 months ago

Related user(s):

No response

Related issue(s) or PR(s):

No response

Related project scope(s):

build

Bug description:

Error when installing following instructions:

[ERROR] The compilation of learn-ocaml-client.0.16.0 failed at "dune build @install -p learn-ocaml-client -j 30".
[ERROR] The compilation of learn-ocaml.0.16.0 failed at "dune build -p learn-ocaml -j 30".

#=== ERROR while compiling learn-ocaml-client.0.16.0 ==========================#
# context     2.1.2 | linux/x86_64 |  | pinned(git+file:///big/ocaml/learn-ocaml-beta#master#fb300f68)
# path        /big/ocaml/learn-ocaml-beta/_opam/.opam-switch/build/learn-ocaml-client.0.16.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build @install -p learn-ocaml-client -j 30
# exit-code   1
# env-file    ~/.opam/log/learn-ocaml-client-1390654-482f60.env
# output-file ~/.opam/log/learn-ocaml-client-1390654-482f60.out
### output ###
# linking_flags src/main/linking_client.sexp
# ;; linking_client.sexp
# ;; generated by ./linking_flags.sh
# ()
#         opam VERSION (exit 99)
# (cd _build/default && /usr/bin/opam show --color=never ./learn-ocaml.opam -f version --normalise) > _build/default/VERSION
# Fatal error:
# /usr/bin/opam: "open" failed on /home/jonasbu/.opam/log/log-1420099-cd1629.out: Read-only file system

#=== ERROR while compiling learn-ocaml.0.16.0 =================================#
# context     2.1.2 | linux/x86_64 |  | pinned(git+file:///big/ocaml/learn-ocaml-beta#master#fb300f68)
# path        /big/ocaml/learn-ocaml-beta/_opam/.opam-switch/build/learn-ocaml.0.16.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p learn-ocaml -j 30
# exit-code   1
# env-file    ~/.opam/log/learn-ocaml-1390654-8a6191.env
# output-file ~/.opam/log/learn-ocaml-1390654-8a6191.out
### output ###
# Missing primitives:
# [...]
#   unix_truncate
#   unix_truncate_64
#   unix_umask
#   unix_utimes
#   unix_wait
#   unix_waitpid
#   unix_write
#         opam VERSION (exit 99)
# (cd _build/default && /usr/bin/opam show --color=never ./learn-ocaml.opam -f version --normalise) > _build/default/VERSION
# Fatal error:
# /usr/bin/opam: "open" failed on /home/jonasbu/.opam/log/log-1420225-02585c.out: Read-only file system

To reproduce:

Follow instructions on https://discuss.ocaml.org/t/learn-ocaml-1-0-approaching-call-for-testers/13621

Expected behavior:

Working installation

learn-ocaml --version

No response

git describe --long --always --abbrev=40 --tags

No response

What OS do you use?

GNU/Linux

What OS version/distribution do you use?

22.04.3

What browser(s) do you use with learn-ocaml?

Chrome

What browser(s) version did you used to reproduce the issue?

None

Screenshots (if need be):

No response

Additional context:

No response

AltGr commented 8 months ago

Sorry for the lag. This might be due to an issue with your version of opam, would you mind trying to update to 2.1.5 ?

jbulow commented 8 months ago

Could not find any documentation on how to upgrade opam. The latest published version of opam for ubuntu (22.04) is 2.1.2.

erikmd commented 8 months ago

Hi. To install the latest release of opam on Ubuntu GNU/Linux, you can do:

(instructions adapted from https://opam.ocaml.org/doc/Install.html)

jbulow commented 8 months ago

Could now run the first part but there is no learn-ocaml binary available to run:

learn-ocaml build serve --repo=./learn-ocaml-corpus
zsh: command not found: learn-ocaml

Maybe some step is missing from the instructions?

AltGr commented 8 months ago

Did you setup the opam shell hooks so that your PATH variable is correctly updated ? You can do so with opam init --reinit --enable-shell-hook -i (and then restart your shell)

Otherwise, you will need to run eval $(opam env) in your shell every time you enter the learn-ocaml directory to make the installed program available.