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

ERROR while compiling ocaml-lsp-server.1.20.1-4.14 #1459

Open
mro opened this issue Jan 30, 2025 · 5 comments
Open

ERROR while compiling ocaml-lsp-server.1.20.1-4.14 #1459

mro opened this issue Jan 30, 2025 · 5 comments

Comments

@mro
Copy link

mro commented Jan 30, 2025

#=== ERROR while compiling ocaml-lsp-server.1.20.1-4.14 =======================#
# context     2.3.0 | freebsd/x86_64 | ocaml-base-compiler.4.14.2 | https://opam.ocaml.org#f665120a12cde1268c7f02fa4acf6502cc04c78b
# path        /usr/home/mro/.opam/4.14.2b/.opam-switch/build/ocaml-lsp-server.1.20.1-4.14
# command     /usr/home/mro/.opam/4.14.2b/bin/dune build -p ocaml-lsp-server -j 3 @install
# exit-code   1
# env-file    /usr/home/mro/.opam/log/ocaml-lsp-server-79804-424831.env
# output-file /usr/home/mro/.opam/log/ocaml-lsp-server-79804-424831.out
### output ###
# File "ocaml-lsp-server/dune", line 43, characters 21-23:
# 43 |     (names lev_stubs ev)))))
#                           ^^
# (cd _build/default/ocaml-lsp-server/vendor/lev && /usr/local/bin/gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64 -fdiagnostics-color=always -g -I /usr/home/mro/.opam/4.14.2b/lib/ocaml -o ev.o -c ev.c)
# submodules/lev/lev/vendor/ev.c:510:11: fatal error: sys/statfs.h: No such file or directory
# compilation terminated.

$ uname -aKU
FreeBSD mx250.local 14.2-RELEASE FreeBSD 14.2-RELEASE releng/14.2-n269506-c8918d6c7412 GENERIC amd64 1402000 1402000
@mro
Copy link
Author

mro commented Jan 30, 2025

similar happens on a 5.2.1 switch.

@mro
Copy link
Author

mro commented Jan 30, 2025

Hi @rgrinberg,
whenever I come back after some days to continue ocaml work and do a opam upgrade, ocaml-lsp-server breaks my toolchain. What do you recommend to have a stable toolchain?

How can I help?

mro added a commit to mro/ocaml-lsp that referenced this issue Feb 5, 2025
@mro
Copy link
Author

mro commented Feb 5, 2025

adding the appropriate headers on FreeBSD hits a compiler error then:

File "ocaml-lsp-server/src/merlin_config.ml", line 96, characters 38-48:
96 |     List.fold_left ~init:(config, []) directives ~f:(fun (config, errors) ->
                                           ^^^^^^^^^^
Error: This expression has type
         Merlin_dot_protocol.Directive.Processed.t list
       but an expression was expected of type
         [< `B of string
          | `CMI of string
          | `CMT of string
          | `ERROR_MSG of 'a
          | `EXCLUDE_QUERY_DIR
          | `EXT of string list
          | `FLG of string list
          | `READER of string list
          | `S of string
          | `STDLIB of string
          | `SUFFIX of string
          | `UNKNOWN_TAG of 'b
          | `USE_PPX_CACHE ]
         list
       Type
         Merlin_dot_protocol.Directive.Processed.t =
           [ `B of string
           | `CMI of string
           | `CMT of string
           | `ERROR_MSG of string
           | `EXCLUDE_QUERY_DIR
           | `EXT of string list
           | `FLG of string list
           | `READER of string list
           | `S of string
           | `SOURCE_ROOT of string
           | `STDLIB of string
           | `SUFFIX of string
           | `UNIT_NAME of string
           | `UNKNOWN_TAG of string
           | `USE_PPX_CACHE
           | `WRAPPING_PREFIX of string ]
       is not compatible with type
         [< `B of string
          | `CMI of string
          | `CMT of string
          | `ERROR_MSG of 'a
          | `EXCLUDE_QUERY_DIR
          | `EXT of string list
          | `FLG of string list
          | `READER of string list
          | `S of string
          | `STDLIB of string
          | `SUFFIX of string
          | `UNKNOWN_TAG of 'b
          | `USE_PPX_CACHE ] 
       The second variant type does not allow tag(s)
       `SOURCE_ROOT, `UNIT_NAME, `WRAPPING_PREFIX

Help very much appreciated.

@voodoos
Copy link
Collaborator

voodoos commented Feb 5, 2025

Your branch with the patch is named 1.18.0-freebsd, which suggest it is not based on the latest commit from the 4.14 branch: https://github.com/ocaml/ocaml-lsp/commits/414-LTS

@mro
Copy link
Author

mro commented Feb 5, 2025

thanks @voodoos, I wasn't aware of the existence. Will re-check tomorrow!

mro added a commit to mro/ocaml-lsp that referenced this issue Feb 6, 2025
mro added a commit to mro/ocaml-lsp that referenced this issue Feb 6, 2025
@mro mro mentioned this issue Feb 6, 2025
mro added a commit to mro/ocaml-lsp that referenced this issue Feb 6, 2025
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

No branches or pull requests

2 participants