ocaml-lsp icon indicating copy to clipboard operation
ocaml-lsp copied to clipboard

Compilation failure on FreeBSD 13.2

Open avysk opened this issue 2 years ago • 8 comments

opam install ocaml-lsp-server
[blah]
┌─ The following actions failed
│ λ build ocaml-lsp-server 1.15.1-5.0
└─

I believe the relevant error is submodules/lev/lev/vendor/ev.c:510:11: fatal error: sys/statfs.h: No such file or directory. Indeed, there is no sys/statfs.h on FreeBSD; I think it is specific for GNU C library.

🌐 eldanna in ~
❯ uname -srm
FreeBSD 13.2-RELEASE amd64
🌐 eldanna in ~
❯ ocamlc --version
5.0.0

avysk avatar Apr 25 '23 14:04 avysk

statvfs.h is the correct FreeBSD variant, though the struct itself works different so chaning the header doesn't work. Fixed it by commenting out some statfs stuff in lev/vendor/ev.c Works fine.

mutkach avatar Aug 18 '23 12:08 mutkach

Any chance to try the fix?

avysk avatar Aug 19 '23 08:08 avysk

as a hotfix just put these lines

#if __FreeBSD__
#define EV_USE_INOTIFY 0
#define EV_USE_KQUEUE 1
#endif

in the line 509 before #if EV_USE_INOTIFY file submodules/lev/lev/vendor/ev.c Let me know if it worked for you

mutkach avatar Aug 19 '23 10:08 mutkach

I had to install yarn and a bunch of opam packages but then make install worked on 13.2-RELEASE-p2 arm64. Thanks!

avysk avatar Aug 27 '23 19:08 avysk

@rgrinberg is there a reason ocaml-ci is not enabled in the repository? It might help us catch this kind of issues since it runs on a wide variety of platforms and oses.

voodoos avatar Oct 16 '23 16:10 voodoos

No reason. I just don't know how to set it up

rgrinberg avatar Oct 16 '23 16:10 rgrinberg