I tried running make without having libev installed. Steps which caused the errors and what I did to resolve them documented below.
Note: errno reports that error code 100 -- on my system -- should stand for ENETDOWN 100 Network is down
$ git clone https://github.com/ocsigen/lwt && cd lwt
$ make
(* ---snip--- *)
Missing C libraries: libev
(* ---snip--- *)
$ sudo apt install libev-dev
$ make
(* ---snip--- *)
Finished, 1 target (0 cached) in 00:00:00.
Exception Not_found.
Compilation unsuccessful after building 0 targets (0 cached) in 00:00:00.
E: Failure("Command ''/home/ubuntu/.opam/4.04.1/bin/ocamlbuild' src/core/lwt.cma src/core/lwt.cmxa src/core/lwt.a src/core/lwt.cmxs src/logger/lwt-log.cma src/logger/lwt-log.cmxa src/logger/lwt-log.a src/logger/lwt-log.cmxs src/unix/liblwt-unix_stubs.a src/unix/dlllwt-unix_stubs.so src/unix/lwt-unix.cma src/unix/lwt-unix.cmxa src/unix/lwt-unix.a src/unix/lwt-unix.cmxs src/simple_top/lwt-simple-top.cma src/simple_top/lwt-simple-top.cmxa src/simple_top/lwt-simple-top.a src/simple_top/lwt-simple-top.cmxs src/preemptive/lwt-preemptive.cma src/preemptive/lwt-preemptive.cmxa src/preemptive/lwt-preemptive.a src/preemptive/lwt-preemptive.cmxs -use-ocamlfind -plugin-tags 'package(cppo_ocamlbuild)' -tag debug' terminated with error code 100")
Makefile:33: recipe for target 'build' failed
make: *** [build] Error 1
$ make clean && make
(* ---snip--- *)
$ make clean && git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
$ rm .gitignore && git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: .gitignore
Untracked files:
(use "git add <file>..." to include in what will be committed)
_build/
setup-dev.exe
setup.data
src/unix/lwt_config.h
src/unix/lwt_config.ml
$ git clean -fd && git checkout .gitignore
$ make
(* ---snip--- *)
Finished, 1 target (0 cached) in 00:00:00.
Finished, 217 targets (0 cached) in 00:00:06.
Perhaps make clean should remove those untracked build artifacts
Can you check with make distclean? I actually typically have only one make clean and no make distclean in my projects, but we inherited distclean from the past, and it's there for now :/
I'll add a note about that to the future CONTRIBUTING.md (#379). Perhaps the jbuilder port (#374) will make this a non-issue.
We should probably also add a note to the error message printed for missing libev and/or other error messages printed by discover.ml or elsewhere. I'll take a look shortly in a container.
Thanks for the report!
Ok, confirmed.
Exception Not_found really is not helpful at all and should be fixed. It's not obvious that you have to run make clean/make distclean after you get that, nor should discover.ml fail like that in the first place.make distclean is a GNUism that we really have no reason to support IMO. Few people seem to expect distclean to be the "real" clean. I certainly wasn't one of them.CONTRIBUTING.md (#379). Lwt can be built without it, but it's better to always use it.It's probably better to see how #374 is working out (cc @andrewray), and fix these in the current discover.ml and Makefile only if #374 is going to take a while.
Should also probably update the installation instructions in the README...
Ok, the jbuilder port #374 was merged earlier today. The new build system seems to have resolved the weird behavior here.
make after a missing libev-dev tells that it's missing again, instead of raising Not_found.libev-dev makes the build succeed on the next call to make.make distclean. make clean cleans everything.README about installing libev before installing Lwt. Lwt can actually be installed without libev on most systems, but it's much better with libev. The formatting of the text in the README is a bit off; I will fix it later (I can't forget it, the visuals annoy me greatly).I followed the original steps after pinning Lwt to master, and the interaction now seems much more sane.
@rdavison let me know if there are further problems with this. The build is going to have to be cleaned up a little still.
Just tested it, and besides a very minor issue with jbuilder's hinting of how to install optional dependencies https://github.com/janestreet/jbuilder/issues/137 it worked wonderfully. Thanks!
Great. I'm closing this issue if you don't mind. Feel free to reopen if necessary, or open new ones for other matters :)