opam install opaml-lsp-server
fails
#1512
-
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
This is actually an issue related to opam that happens in some (not-yet clear) circumstances (@kit-ty-kate, @dra27). Your environment variable might have wrong values:
Both Usually opening a new terminal and retrying the installation should work. If not you can manually set the environment variables. |
Beta Was this translation helpful? Give feedback.
-
On Thu Apr 3, 2025 at 4:18 AM PDT, Kate wrote:
```
opam switch set-invariant --formula '"ocaml-base-compiler" {>= "5.3.0"}'
```
I tried the command and now there seems to be an issue with topkg.
```
$ opam install ocaml-lsp-server
The following actions will be performed:
=== install 5 packages
∗ astring 0.8.5 [required by ocaml-lsp-server]
∗ lsp 1.22.0 [required by ocaml-lsp-server]
∗ ocaml-lsp-server 1.22.0
∗ topkg 1.0.8 [required by astring]
∗ uutf 1.0.4 [required by lsp]
Proceed with ∗ 5 installations? [y/n] y
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved astring.0.8.5 (cached)
⬇ retrieved uutf.1.0.4 (cached)
⬇ retrieved topkg.1.0.8 (cached)
⬇ retrieved lsp.1.22.0, ocaml-lsp-server.1.22.0 (cached)
[ERROR] The compilation of topkg.1.0.8 failed at "ocaml pkg/pkg.ml build --pkg-name topkg --dev-pkg false".
#=== ERROR while compiling topkg.1.0.8 ========================================#
# context 2.3.0 | linux/x86_64 | ocaml-base-compiler.5.3.0 | https://opam.ocaml.org#07a22d1525d3ff370885818e89f9f7028e4639cc
# path ~/.opam/default/.opam-switch/build/topkg.1.0.8
# command ~/.opam/opam-init/hooks/sandbox.sh build ocaml pkg/pkg.ml build --pkg-name topkg --dev-pkg false
# exit-code 125
# env-file ~/.opam/log/topkg-658071-7587c4.env
# output-file ~/.opam/log/topkg-658071-7587c4.out
### output ###
# Exception: Fl_package_base.No_such_package ("findlib", "").
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build topkg 1.0.8
└─
╶─ No changes have been performed
```
Thank you for your help
Avid
|
Beta Was this translation helpful? Give feedback.
-
On Thu Apr 3, 2025 at 4:15 PM PDT, Kate wrote:
Could you show what's in your environment (`env | grep -E 'OPAM|CAML'`), and also the result of `opam env`?
```
$ env | grep -E 'OPAM|OCAML'
OPAMNOENVNOTICE=true
OPAM_SWITCH_PREFIX=/home/user/.opam/default
OCAMLTOP_INCLUDE_PATH=/home/user/.opam/default/lib/toplevel
OCAML_TOPLEVEL_PATH=/home/user/.opam/default/lib/toplevel
OPAM_LAST_ENV=/home/user/.opam/.last-env/env-188d0543f48f4aac6402ebc353845d2c-0
$ opam env
OPAM_LAST_ENV='/home/user/.opam/.last-env/env-188d0543f48f4aac6402ebc353845d2c-0'; export OPAM_LAST_ENV;
OPAM_SWITCH_PREFIX='/home/user/.opam/default'; export OPAM_SWITCH_PREFIX;
OCAMLTOP_INCLUDE_PATH='/home/user/.opam/default/lib/toplevel'; export OCAMLTOP_INCLUDE_PATH;
CAML_LD_LIBRARY_PATH='/home/user/.opam/default/lib/stublibs:/home/user/.opam/default/lib/ocaml/stublibs:/home/user/.opam/default/lib/ocaml'; export CAML_LD_LIBRARY_PATH;
OCAML_TOPLEVEL_PATH='/home/user/.opam/default/lib/toplevel'; export OCAML_TOPLEVEL_PATH;
MANPATH=':/home/user/.opam/default/man'; export MANPATH;
PATH='/home/user/.opam/default/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/user/.local/bin'; export PATH;
```
If debugging via IRC would make it easier for you, I'm avidseeker on
libera.chat
Thanks again
|
Beta Was this translation helpful? Give feedback.
-
```
$ which ocamlfind
/home/user/.opam/default/bin/ocamlfind
$ ocamlfind printconf
Effective configuration:
Configuration file:
/home/user/.opam/default/lib/findlib.conf
Search path:
/home/user/.opam/default/lib/ocaml
/home/user/.opam/default/lib
Packages will be installed in/removed from:
/home/user/.opam/default/lib
META files will be installed in/removed from:
the corresponding package directories
The standard library is assumed to reside in:
/home/user/.opam/default/lib/ocaml
The ld.conf file can be found here:
/home/user/.opam/default/lib/ocaml/ld.conf
$ env | grep -E 'OPAM|CAML'
OPAMNOENVNOTICE=true
OPAM_SWITCH_PREFIX=/home/user/.opam/default
CAML_LD_LIBRARY_PATH=/home/user/.opam/default/lib/stublibs:/home/user/.opam/default/lib/ocaml/stublibs:/home/user/.opam/default/lib/ocaml
OCAMLTOP_INCLUDE_PATH=/home/user/.opam/default/lib/toplevel
OCAML_TOPLEVEL_PATH=/home/user/.opam/default/lib/toplevel
OPAM_LAST_ENV=/home/user/.opam/.last-env/env-188d0543f48f4aac6402ebc353845d2c-0
$ opam exec -- env | grep -E 'OPAM|CAML'
CAML_LD_LIBRARY_PATH=/home/user/.opam/default/lib/stublibs:/home/user/.opam/default/lib/ocaml/stublibs:/home/user/.opam/default/lib/ocaml
OCAMLTOP_INCLUDE_PATH=/home/user/.opam/default/lib/toplevel
OCAML_TOPLEVEL_PATH=/home/user/.opam/default/lib/toplevel
OPAMNOENVNOTICE=true
OPAM_LAST_ENV=/home/user/.opam/.last-env/env-188d0543f48f4aac6402ebc353845d2c-0
OPAM_SWITCH_PREFIX=/home/user/.opam/default
```
|
Beta Was this translation helpful? Give feedback.
If anyone sees this in the future, we've debugged this via IRC and this stemmed from a segfault in
/bin/sh
which was ignored by ocamlfind and continued installation in a broken state.I've detailed a improvement to ocamlfind in ocaml/ocamlfind#101 (comment) so that if a similar error happens in the future, it would at least show up earlier while building ocamlfind and not while building downstream projects.