lwt build fails on Arch Linux

Created on 6 Nov 2017  ยท  21Comments  ยท  Source: ocsigen/lwt

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[lwt] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of lwt failed at "jbuilder build -p lwt -j 4".

#=== ERROR while installing lwt.3.1.0 =========================================#
# opam-version 1.2.2
# os           linux
# command      jbuilder build -p lwt -j 4
# path         /home/marcoonroad/.opam/4.05.0/build/lwt.3.1.0
# compiler     4.05.0
# exit-code    1
# env-file     /home/marcoonroad/.opam/4.05.0/build/lwt.3.1.0/lwt-29771-d2c37b.env
# stdout-file  /home/marcoonroad/.opam/4.05.0/build/lwt.3.1.0/lwt-29771-d2c37b.out
# stderr-file  /home/marcoonroad/.opam/4.05.0/build/lwt.3.1.0/lwt-29771-d2c37b.err
### stderr ###
# [...]
# found config var system: ....................... linux
# found config var os_type: ...................... Unix
# found config var use_libev: .................... false
# not checking for pkg-config
# 
# Error: failed to compile a trivial ocaml toplevel.
# You may be missing core components (compiler, ncurses, etc)
# 
# Run with DEBUG=y for more details.
#       



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
  - install lwt 3.1.0
No changes have been performed

=-=- lwt.3.1.0 troubleshooting =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> Lwt 4.0.0 will make some breaking changes to packaging in late 2017. See
     https://github.com/ocsigen/lwt/issues/453

bug

All 21 comments

$ cat /home/marcoonroad/.opam/4.05.0/build/lwt.3.1.0/lwt-29771-d2c37b.env
PATH=/home/marcoonroad/.opam/4.05.0/bin:/home/marcoonroad/torch/install/bin:/home/marcoonroad/Documentos/Blockchain/bin:/usr/bin/env:/home/marcoonroad/torch/install/bin:/home/marcoonroad/torch/install/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
OCAML_TOPLEVEL_PATH=/home/marcoonroad/.opam/4.05.0/lib/toplevel
PERL5LIB=/home/marcoonroad/.opam/4.05.0/lib/perl5
MANPATH=:/home/marcoonroad/.opam/4.05.0/man
OPAMSWITCH=4.05.0
CAML_LD_LIBRARY_PATH=/home/marcoonroad/.opam/4.05.0/lib/stublibs
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
LD_LIBRARY_PATH=/home/marcoonroad/torch/install/lib:/home/marcoonroad/torch/install/lib:/home/marcoonroad/torch/install/lib:
XDG_MENU_PREFIX=xfce-
LANG=pt_BR.utf8
DISPLAY=:0.0
OLDPWD=/home/marcoonroad/Documentos/Projetos/mythril
COLORTERM=truecolor
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
LUA_PATH=/home/marcoonroad/.luarocks/share/lua/5.1/?.lua;/home/marcoonroad/.luarocks/share/lua/5.1/?/init.lua;/home/marcoonroad/torch/install/share/lua/5.1/?.lua;/home/marcoonroad/torch/install/share/lua/5.1/?/init.lua;./?.lua;/home/marcoonroad/torch/install/share/luajit-2.1.0-beta1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua
DYLD_LIBRARY_PATH=/home/marcoonroad/torch/install/lib:/home/marcoonroad/torch/install/lib:/home/marcoonroad/torch/install/lib:
XDG_VTNR=7
SSH_AUTH_SOCK=/tmp/ssh-6Ce174ufbv7I/agent.8387
GLADE_CATALOG_PATH=:
XDG_SESSION_ID=c2
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/marcoonroad
USER=marcoonroad
GLADE_MODULE_PATH=:
DESKTOP_SESSION=xfce
LUA_CPATH=/home/marcoonroad/torch/install/lib/?.so;/home/marcoonroad/.luarocks/lib/lua/5.1/?.so;/home/marcoonroad/torch/install/lib/lua/5.1/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so
PWD=/home/marcoonroad/Documentos/Projetos
HOME=/home/marcoonroad
SSH_AGENT_PID=8388
XDG_SESSION_TYPE=x11
XDG_DATA_DIRS=/usr/local/share:/usr/share
XDG_SESSION_DESKTOP=xfce
GLADE_PIXMAP_PATH=:
GTK_MODULES=canberra-gtk-module:canberra-gtk-module
MAIL=/var/spool/mail/marcoonroad
TERM=xterm-256color
SHELL=/bin/bash
VTE_VERSION=5002
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CURRENT_DESKTOP=XFCE
XDG_SEAT=seat0
SHLVL=2
WINDOWID=33554484
MAVEN_OPTS=-Xmx512m
GDMSESSION=xfce
LOGNAME=marcoonroad
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/home/marcoonroad/.Xauthority
ANT_HOME=/usr/share/apache-ant
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_CONFIG_DIRS=/etc/xdg
SESSION_MANAGER=local/marcoonroad:@/tmp/.ICE-unix/8381,unix/marcoonroad:/tmp/.ICE-unix/8381
_=/usr/local/bin/opam
OPAM_PACKAGE_VERSION=3.1.0
OPAM_PACKAGE_NAME=lwt
MAKELEVEL=
MAKEFLAGS=


$ cat /home/marcoonroad/.opam/4.05.0/build/lwt.3.1.0/lwt-29771-d2c37b.err
File "src/unix/jbuild", line 33, characters 0-81:
Warning: File lwt_config is both generated by a rule and present in the source tree.
As a result, the rule is currently ignored, however this will become an error in the future.
To keep the current behavior and get rid of this warning, add a field (fallback) to the rule.
    ocamllex src/logger/lwt_log_rules.ml
    ocamldep src/logger/lwt_log.dependsi.ocamldep-output
    ocamldep src/core/lwt.dependsi.ocamldep-output
    ocamldep src/preemptive/lwt_preemptive.depends.ocamldep-output
    ocamldep src/preemptive/lwt_preemptive.dependsi.ocamldep-output
    ocamldep src/simple_top/lwt_simple_top.depends.ocamldep-output
    ocamldep src/core/lwt.depends.ocamldep-output
   camlp4oof src/camlp4/log/pa_lwt_log.pp.ml
   camlp4oof src/camlp4/log/pa_lwt_log.pp.mli
    ocamldep src/camlp4/options/lwt_syntax_options.depends.ocamldep-output
   camlp4oof src/camlp4/pa_lwt.pp.mli
      ocamlc src/unix/ocamlc_config
    ocamldep src/unix/config/discover.depends.ocamldep-output
   camlp4oof src/camlp4/pa_lwt.pp.ml
        cppo src/unix/lwt_unix.mli
    ocamldep src/unix/stubs/gen_stubs.depends.ocamldep-output
    ocamldep src/logger/lwt_log.depends.ocamldep-output
      ocamlc src/core/lwt_pqueue.{cmi,cmti}
    ocamldep src/camlp4/log/lwt_syntax_log.depends.ocamldep-output
        cppo src/unix/lwt_unix.ml
      ocamlc src/core/lwt_sequence.{cmi,cmti}
    ocamldep src/camlp4/log/lwt_syntax_log.dependsi.ocamldep-output
    ocamldep src/camlp4/lwt_syntax.dependsi.ocamldep-output
    ocamldep src/camlp4/lwt_syntax.depends.ocamldep-output
    ocamldep src/unix/lwt_unix.dependsi.ocamldep-output
      ocamlc src/unix/config/discover.{cmi,cmo,cmt}
      ocamlc src/core/lwt_pqueue.{cmo,cmt}
      ocamlc src/camlp4/options/pa_lwt_options.{cmi,cmo,cmt}
    ocamlopt src/core/lwt_pqueue.{cmx,o}
      ocamlc src/unix/stubs/gen_stubs.{cmi,cmo,cmt}
      ocamlc src/core/lwt_sequence.{cmo,cmt}
      ocamlc src/core/lwt.{cmi,cmti}
    ocamlopt src/core/lwt_sequence.{cmx,o}
      ocamlc src/camlp4/options/lwt_syntax_options.cma
      ocamlc src/camlp4/log/pa_lwt_log.{cmi,cmti}
      ocamlc src/camlp4/pa_lwt.{cmi,cmti}
    ocamlopt src/camlp4/options/pa_lwt_options.{cmx,o}
File "_none_", line 1:
Warning 58: no cmx file was found in path for module Camlp4, and its interface was not compiled with -opaque
    ocamlopt src/unix/config/discover.{cmx,o}
      ocamlc src/core/lwt_list.{cmi,cmti}
      ocamlc src/core/lwt_mutex.{cmi,cmti}
      ocamlc src/core/lwt_mvar.{cmi,cmti}
      ocamlc src/core/lwt_pool.{cmi,cmti}
      ocamlc src/core/lwt_result.{cmi,cmti}
      ocamlc src/core/lwt_stream.{cmi,cmti}
    ocamlopt src/unix/stubs/gen_stubs.{cmx,o}
      ocamlc src/core/lwt_switch.{cmi,cmti}
      ocamlc src/core/lwt.{cmo,cmt}
    ocamlopt .ppx/ppx_tools_versioned.metaquot_404/ppx.exe
      ocamlc src/camlp4/log/pa_lwt_log.{cmo,cmt}
    ocamlopt src/camlp4/options/lwt_syntax_options.{a,cmxa}
    ocamlopt src/core/lwt.{cmx,o}
      ocamlc src/camlp4/pa_lwt.{cmo,cmt}
      ocamlc src/core/lwt_list.{cmo,cmt}
      ocamlc src/core/lwt_mutex.{cmo,cmt}
      ocamlc src/core/lwt_condition.{cmi,cmti}
      ocamlc src/core/lwt_mvar.{cmo,cmt}
      ocamlc src/core/lwt_pool.{cmo,cmt}
    ocamlopt src/camlp4/log/pa_lwt_log.{cmx,o}
      ocamlc src/core/lwt_result.{cmo,cmt}
    ocamlopt src/unix/config/discover.exe
      ocamlc src/core/lwt_stream.{cmo,cmt}
      ocamlc src/core/lwt_switch.{cmo,cmt}
         ppx src/ppx/ppx_lwt.pp.mli
         ppx src/ppx/ppx_lwt.pp.ml
      ocamlc src/camlp4/log/lwt_syntax_log.cma
    ocamlopt src/camlp4/pa_lwt.{cmx,o}
File "_none_", line 1:
Warning 58: no cmx file was found in path for module Camlp4, and its interface was not compiled with -opaque
    ocamlopt src/core/lwt_list.{cmx,o}
    ocamlopt src/camlp4/options/lwt_syntax_options.cmxs
    ocamlopt src/unix/stubs/gen_stubs.exe
    ocamlopt src/core/lwt_result.{cmx,o}
    ocamlopt src/core/lwt_switch.{cmx,o}
    ocamlopt src/core/lwt_mutex.{cmx,o}
    ocamlopt src/core/lwt_mvar.{cmx,o}
      ocamlc src/camlp4/lwt_syntax.cma
      ocamlc src/core/lwt_condition.{cmo,cmt}
    ocamlopt src/core/lwt_pool.{cmx,o}
      ocamlc src/logger/lwt_log_rules.{cmi,cmti}
      ocamlc src/logger/lwt_log_core.{cmi,cmti}
    ocamldep src/ppx/ppx_lwt.dependsi.ocamldep-output
    ocamldep src/ppx/ppx_lwt.depends.ocamldep-output
    ocamlopt src/camlp4/log/lwt_syntax_log.{a,cmxa}
   gen_stubs src/unix/lwt_unix_job_access.c,src/unix/lwt_unix_job_chdir.c,src/unix/lwt_unix_job_chmod.c,src/unix/lwt_unix_job_chown.c,src/unix/lwt_unix_job_chroot.c,src/unix/lwt_unix_job_close.c,src/unix/lwt_unix_job_fchmod.c,src/unix/lwt_unix_job_fchown.c,src/unix/lwt_unix_job_fdatasync.c,src/unix/lwt_unix_job_fsync.c,src/unix/lwt_unix_job_ftruncate.c,src/unix/lwt_unix_job_link.c,src/unix/lwt_unix_job_lseek.c,src/unix/lwt_unix_job_mkdir.c,src/unix/lwt_unix_job_mkfifo.c,src/unix/lwt_unix_job_rename.c,src/unix/lwt_unix_job_rmdir.c,src/unix/lwt_unix_job_symlink.c,src/unix/lwt_unix_job_tcdrain.c,src/unix/lwt_unix_job_tcflow.c,src/unix/lwt_unix_job_tcflush.c,src/unix/lwt_unix_job_tcsendbreak.c,src/unix/lwt_unix_job_truncate.c,src/unix/lwt_unix_job_unlink.c,src/unix/lwt_unix_jobs_generated.ml
    ocamlopt src/core/lwt_stream.{cmx,o}
    ocamlopt src/core/lwt_condition.{cmx,o}
      ocamlc src/core/lwt.cma
      ocamlc src/logger/lwt_log_rules.{cmo,cmt}
    ocamlopt src/camlp4/lwt_syntax.{a,cmxa}
      ocamlc src/unix/lwt_gc.{cmi,cmti}
      ocamlc src/unix/lwt_main.{cmi,cmti}
    discover src/unix/lwt_config.{h,ml},src/unix/unix_c_flags.sexp,src/unix/unix_c_library_flags.sexp (exit 1)
(cd _build/default/src/unix && ./config/discover.exe -ocamlc-config ocamlc_config -lwt-config lwt_config)
found config var ext_obj: ...................... .o
found config var default_executable_name: ...... a.out
found config var ccomp_type: ................... cc
found config var system: ....................... linux
found config var os_type: ...................... Unix
found config var use_libev: .................... false
not checking for pkg-config

Error: failed to compile a trivial ocaml toplevel.
You may be missing core components (compiler, ncurses, etc)

Run with DEBUG=y for more details.

Log of $ DEBUG=y opam install lwt:

$ cat /tmp/lwt_output149481.log
/usr/bin/ld: /home/marcoonroad/.opam/4.05.0/lib/ocaml/libcamlrun.a(terminfo.o): undefined reference to symbol 'tgetnum'
/usr/lib/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
File "/tmp/lwt_caml7cd4e0.ml", line 1:
Error: Error while building custom runtime system
$ uname -a
Linux marcoonroad 4.13.11-1-ARCH #1 SMP PREEMPT Thu Nov 2 10:25:56 CET 2017 x86_64 GNU/Linux

I believe this is usually caused by not having ncurses installed. See #33 and #313. ncurses is needed by the deprecated lwt.simple-top package, which will be removed soon (#371).

I already have ncurses installed. :)

$ ncursesw6-config --libs --cflags --prefix --exec-prefix --version --abi-version
-lncursesw -ltinfo
-D_GNU_SOURCE -D_DEFAULT_SOURCE
/usr
/usr
6.0.20170902
6

Hmm, this seems to be system-specific enough that I can't reproduce/debug it over here.

You may already know some subset of this information, but it's triggered by this function (where opt and lib are empty lists):

https://github.com/ocsigen/lwt/blob/5c1eea5fcfdeabf6c4506e0823cea0c219ad2f9d/src/unix/config/discover.ml#L351-L373

compiling this code (in stub_file):

https://github.com/ocsigen/lwt/blob/5c1eea5fcfdeabf6c4506e0823cea0c219ad2f9d/src/unix/config/discover.ml#L96-L103

You may be able to reproduce the problem outside the Lwt process this way.

There are also several StackOverflow questions about the error you are seeing from the linker, e.g. this one. I'm not really able to experiment with this on my system.

Thanks. Tomorrow I will check that carefully on my job computer (which is where the build fails).

Well, this seems not the source of the bug here. I will try to upgrade lwt on my own home machine to check that on another environment.

See ya soon!

It compiles without any problems on my home machine (Mandriva Linux):

$ uname -a
Linux SIM 3.6.3 #1 SMP PREEMPT Fri Mar 1 15:24:30 BRT 2013 i686 i686 i386 GNU/Linux

I've changed the issue title to help other fellows with the same sort of problem to reach here.

Full output:

$ opam install lwt
The following actions will be performed:
  โˆ—  install conf-m4                 1           [required by ocamlfind]
  โˆ—  install result                  1.2         [required by lwt]
  โˆ—  install ocamlbuild              0.11.0      [required by cppo]
  โˆ—  install ocamlfind               1.7.3       [required by lwt]
  โˆ—  install jbuilder                1.0+beta16  [required by lwt]
  โˆ—  install cppo                    1.4.0       [required by lwt]
  โˆ—  install ocaml-migrate-parsetree 1.0.7       [required by lwt]
  โˆ—  install ppx_tools_versioned     5.0.1       [required by lwt]
  โˆ—  install lwt                     3.1.0     
===== โˆ—  9 =====
Do you want to continue ? [Y/n] y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[lwt] Archive in cache
[default] https://opam.ocaml.org/archives/cppo.1.4.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ocaml-migrate-parsetree.1.0.7+opam.tar.gz downloaded
[jbuilder.1.0+beta16] https://github.com/kayceesrk/jbuilder/archive/multicore.tar.gz downloaded
[ppx_tools_versioned] Archive in cache
[result] Archive in cache
[default] https://opam.ocaml.org/archives/ocamlfind.1.7.3+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ocamlbuild.0.11.0+opam.tar.gz downloaded

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
โˆ—  installed conf-m4.1
โˆ—  installed result.1.2
โˆ—  installed ocamlfind.1.7.3
โˆ—  installed ocamlbuild.0.11.0
โˆ—  installed cppo.1.4.0
โˆ—  installed jbuilder.1.0+beta16
โˆ—  installed ocaml-migrate-parsetree.1.0.7
โˆ—  installed ppx_tools_versioned.5.0.1
โˆ—  installed lwt.3.1.0
Done.
=-=- lwt.3.1.0 installed successfully -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> Lwt 4.0.0 will make some breaking changes to packaging in late 2017. See
     https://github.com/ocsigen/lwt/issues/453

$ ocaml --version
The OCaml toplevel, version 4.05.0

It's really Operating System specific, I could check again that problem on my work machine later.

Thanks for continuing to look into it. Let us know if you need any general information that can be helpful.

@marcoonroad Are you still having this problem on your work machine?

Hi, I think I got the same bug in here.

my current opam switch :

โ‹Š> ~/R/o/sample opam switch show                                                                                                                                                                                                                                          23:07:15
4.06.0+musl+static+flambda
โ‹Š> ~/R/o/sample uname -r                                                                                                                                                                                                                                                  23:07:17
4.14.15-1-ARCH
โ‹Š> ~/R/o/sample ocaml -version                                                                                                                                                                                                                                            23:07:25
The OCaml toplevel, version 4.06.0
โ‹Š> ~/R/o/sample                                                                                                                                                                                                                                                           23:07:30

Trying to install conf-libev

โ‹Š> ~/R/o/sample env C_INCLUDE_PATH=/usr/include LIBRARY_PATH=/usr/lib opam install conf-libev lwt                                                                                                                                                                         23:07:30

=-=- Synchronising pinned packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[lwt] https://github.com/ocsigen/lwt.git already up-to-date
The following actions will be performed:
  โˆ—  install conf-libev 4-11
  โˆ—  install lwt        dev*
       For the PPX, please install package lwt_ppx
       For the Camlp4 syntax, please install package lwt_camlp4
       For Lwt_log and Lwt_daemon, please install package lwt_log
===== โˆ—  2 =====

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[lwt] https://github.com/ocsigen/lwt.git already up-to-date

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of conf-libev failed at "sh ./build.sh".

#=== ERROR while installing conf-libev.4-11 ===================================#
# opam-version 1.2.2
# os           linux
# command      sh ./build.sh
# path         /home/zerosign/.opam/4.06.0+musl+static+flambda/build/conf-libev.4-11
# compiler     4.06.0+musl+static+flambda
# exit-code    1
# env-file     /home/zerosign/.opam/4.06.0+musl+static+flambda/build/conf-libev.4-11/conf-libev-2764-d2d111.env
# stdout-file  /home/zerosign/.opam/4.06.0+musl+static+flambda/build/conf-libev.4-11/conf-libev-2764-d2d111.out
# stderr-file  /home/zerosign/.opam/4.06.0+musl+static+flambda/build/conf-libev.4-11/conf-libev-2764-d2d111.err
### stdout ###
# testing for libev: ............................. unavailable

# [...]
#       The following recquired C libraries are missing: libev.
# Please install them and retry. If they are installed in a non-standard location, set the environment variables C_INCLUDE_PATH and LIBRARY_PATH accordingly and retry.
# 
# For example, if they are installed in /opt/local, you can type:
# 
# export C_INCLUDE_PATH=/opt/local/include
# export LIBRARY_PATH=/opt/local/lib
# 
# To compile without libev support, use ./configure --disable-libev ...

Seems that conf-libev couldn't find libev, even though I already installing it.

in ocaml repl (try to test the function to detect libev) :

# test_feature "libev" "HAVE_LIBEV" ~args:"-cclib -lev" libev_code;;
testing for libev: ............................. unavailable
# test_code "-cclib -lev" libev_code;;
- : bool = false

Currently, archlinux are using :

โ‹Š> ~/R/o/sample cat /usr/include/ev.h | grep EV_VERSION                                                                                                                                                                                                                     
#define EV_VERSION_MAJOR 4
#define EV_VERSION_MINOR 24

Is it related to libev version ?

I don't think it's directly related to the libev version, since the script doesn't directly check for it.

I recommend printing the variable cmd in this function: https://github.com/ocaml/opam-repository/blob/ae5efe10f3c127b8679dd02aa8f17f595d60a740/packages/conf-libev/conf-libev.4-11/files/discover.ml#L121-L129. If it looks reasonable, then what happens when you run the same command yourself?

If it looks wrong, in particular the include path, then I guess it would likely be due to not finding the header for some reason, so we would look in https://github.com/ocaml/opam-repository/blob/ae5efe10f3c127b8679dd02aa8f17f595d60a740/packages/conf-libev/conf-libev.4-11/files/discover.ml#L102-L113.

I think it does related to, in Archlinux libev are being linked as -levent

[zerosign@flat sample]$ pkg-config --cflags --libs libevent
-levent

while in the script it's actually using -lev for linking to libevent.

# test_feature "libev" "HAVE_LIBEV" ~args:"-cclib -lev" libev_code  ;;
testing for libev:ocamlc -custom -ccopt -I/usr/include -ccopt -L/usr/lib '/tmp/lwt_stube6cf69.c' -cclib -lev '/tmp/lwt_camla648c8.ml' > '/tmp/lwt_output0445ce.log' 2>&1
 ............................. unavailable

Could we patch by adding -levent as an alternative if it fails to find using -lev ?

@zerosign I'd assume -levent is for linking with libevent, not libev. Can you confirm you have libev installed, and are able to link with it (and definitely not libevent), and conf-libev is constructing a sensible command for linking with libev as well?

I'm sorry my bad.

No worries :)

Closing this issue as "too elusive" :) Please feel free to reopen if needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

foretspaisibles picture foretspaisibles  ยท  8Comments

m4b picture m4b  ยท  4Comments

idkjs picture idkjs  ยท  5Comments

aantron picture aantron  ยท  8Comments

aantron picture aantron  ยท  8Comments