Open Timmmm opened 1 year ago
=== ERROR while compiling ocaml-lsp-server.1.4.1 =============================
Can you try installing a newer version? This one is quite ancient.
Ah yeah a newer version worked. I was using an older version of OCaml because a project told me to use 4.08 or something, but I checked again and it actually said that was the minimum in a slightly ambiguous way.
Anyway it works. Carry on. :-)
Oh sorry, I don't know why I thought it had worked. It actually didn't. :-/
❯ opam install ocaml-lsp-server
The following actions will be performed:
↘ downgrade omd 2.0.0~alpha3 to 1.3.2 [required by ocaml-lsp-server]
∗ install ocaml-lsp-server 1.15.1-5.0
===== ∗ 1 ↘ 1 =====
Do you want to continue? [Y/n] y
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved omd.1.3.2 (cached)
Processing 2/7: [ocaml-lsp-server.1.15.1-5.0: dl]
⬇ retrieved ocaml-lsp-server.1.15.1-5.0 (https://opam.ocaml.org/cache)
⊘ removed omd.2.0.0~alpha3
∗ installed omd.1.3.2
[ERROR] The compilation of ocaml-lsp-server.1.15.1-5.0 failed at "dune build -j 11 ocaml-lsp-server.install --release".
#=== ERROR while compiling ocaml-lsp-server.1.15.1-5.0 ========================#
# context 2.1.4 | linux/x86_64 | ocaml.5.0.0 | https://opam.ocaml.org#a5e664bc
# path ~/.opam/default/.opam-switch/build/ocaml-lsp-server.1.15.1-5.0
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -j 11 ocaml-lsp-server.install --release
# exit-code 1
# env-file ~/.opam/log/ocaml-lsp-server-45119-5ba721.env
# output-file ~/.opam/log/ocaml-lsp-server-45119-5ba721.out
### output ###
# [...]
# automatically added to the search path, but you should add -I +unix to the
# command-line to silence this alert (e.g. by adding unix to the list of
# libraries in your dune file, or adding use_unix to your _tags file for
# ocamlbuild, or using -package unix for ocamlfind).
# (cd _build/default && /home/mycompany.com/timothy.hutt/.opam/default/bin/ocamlopt.opt -w -40 -alert -unstable -g -I ocaml-lsp-server/src/.ocaml_lsp_server.objs/byte -I ocaml-lsp-server/src/.ocaml_lsp_server.objs/native -I /home/mycompany.com/timothy.hutt/.opam/default/lib/chrome-trace -I /home/mycompany.com/timothy.hutt/.opam/default/lib/csexp -I /home/mycompany.com/timothy.hutt/.opam/default/lib/dun[...]
# File "_none_", line 1:
# Alert ocaml_deprecated_auto_include:
# OCaml's lib directory layout changed in 5.0. The unix subdirectory has been
# automatically added to the search path, but you should add -I +unix to the
# command-line to silence this alert (e.g. by adding unix to the list of
# libraries in your dune file, or adding use_unix to your _tags file for
# ocamlbuild, or using -package unix for ocamlfind).
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build ocaml-lsp-server 1.15.1-5.0
└─
┌─ The following changes have been performed
│ ↘ downgrade omd 2.0.0~alpha3 to 1.3.2
└─
The former state can be restored with:
/usr/local/bin/opam switch import "/home/mycompany.com/timothy.hutt/.opam/default/.opam-switch/backup/state-20230127195743.export"
The error is the same:
Error: /home/mycompany.com: Permission denied
-> required by
_build/default/ocaml-lsp-server/bin/.main.eobjs/build_info_data.ml-gen
-> required by
_build/default/ocaml-lsp-server/bin/.main.eobjs/native/build_info__Build_info_data.cmx
-> required by _build/default/ocaml-lsp-server/bin/main.exe
-> required by _build/install/default/bin/ocamllsp
-> required by _build/default/ocaml-lsp-server.install
I strace
d it and it turns out there is some thing scanning all parent directories:
262848 stat("/home/company.com/timothy.hutt/.cabal/bin/js_of_ocaml", 0x7ffcff76a530) = -1 ENOENT (No such file or directory)
262848 openat(AT_FDCWD, "/home/company.com/timothy.hutt/.opam/default/.opam-switch/build", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
262848 fstat(5, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
262848 getdents64(5, 0x29f9b70 /* 11 entries */, 32768) = 448
262848 getdents64(5, 0x29f9b70 /* 0 entries */, 32768) = 0
262848 close(5) = 0
262848 openat(AT_FDCWD, "/home/company.com/timothy.hutt/.opam/default/.opam-switch", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
262848 fstat(5, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
262848 getdents64(5, 0x29f9b70 /* 16 entries */, 32768) = 504
262848 getdents64(5, 0x29f9b70 /* 0 entries */, 32768) = 0
262848 close(5) = 0
262848 openat(AT_FDCWD, "/home/company.com/timothy.hutt/.opam/default", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
262848 fstat(5, {st_mode=S_IFDIR|0755, st_size=95, ...}) = 0
262848 getdents64(5, 0x29f9b70 /* 9 entries */, 32768) = 232
262848 getdents64(5, 0x29f9b70 /* 0 entries */, 32768) = 0
262848 close(5) = 0
262848 openat(AT_FDCWD, "/home/company.com/timothy.hutt/.opam", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
262848 fstat(5, {st_mode=S_IFDIR|0755, st_size=128, ...}) = 0
262848 getdents64(5, 0x29f9b70 /* 10 entries */, 32768) = 288
262848 getdents64(5, 0x29f9b70 /* 0 entries */, 32768) = 0
262848 close(5) = 0
262848 openat(AT_FDCWD, "/home/company.com/timothy.hutt", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
262848 fstat(5, {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
262848 getdents64(5, 0x29f9b70 /* 68 entries */, 32768) = 2176
262848 getdents64(5, 0x29f9b70 /* 0 entries */, 32768) = 0
262848 close(5) = 0
262848 openat(AT_FDCWD, "/home/company.com", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 EACCES (Permission denied)
262848 stat("/home/company.com/timothy.hutt/.cabal/bin/cinaps", 0x7ffcff76a530) = -1 ENOENT (No such file or directory)
262848 stat("/home/company.com/timothy.hutt/.ghcup/bin/js_of_ocaml", 0x7ffcff76a530) = -1 ENOENT (No such file or directory)
262848 stat("/home/company.com/timothy.hutt/.ghcup/bin/cinaps", 0x7ffcff76a530) = -1 ENOENT (No such file or directory)
Maybe related to cinaps
or js_of_ocaml
whatever those are. Anyway it fails because /home/company.com
is not accessible (don't ask my why it is set up like this!). I don't have time to wade through OCaml dependencies unfortunately so I just chmod
ed it and that works around the issue.
❯ ls -ld /home/company.com
drwx--x--x. 4 root root 46 Dec 8 13:47 /home/company.com
❯ sudo chmod go+r /home/company.com
I'm using the global opam switch (I think; I don't really know OCaml). If I run
It gives this output:
Bit weird. I guess it is due to the fact that my
$HOME
is /home/mycompany.com/timohty.hutt` and some code assumes that is impossible.