Hi,
for learning ocaml, I’m writing a program that uses GitHub - vbmithr/ocaml-websocket: Websocket library for OCaml and Lwt. My program is a websocket client. I’m investigating an issue where if the websocket server crashes, my client program will not report an exception until a few writes afterwards (even though I can see using strace
that the OS is returning EPIPE
for the write
calls).
I took this problem as an opportunity to practice my debugging skills. For debugging this problem, I’d like to insert some printfs here and there in my dependencies’ code. I did that succesfully for ocaml-websocket
, where I cloned the repo into my own source repo and dune
was able to pick up my local copy. I tried to do the same for lwt
, but that seems to be harder:
$ dune exec sharer-server --release
Error: Conflict between the following libraries:
- "lwt" in _build/default/vendor/lwt/src/core
- "lwt" in /home/braulio/.opam/4.14.0/lib/lwt
-> required by library "lwt_log" in /home/braulio/.opam/4.14.0/lib/lwt_log
-> required by library "websocket-lwt-unix" in
_build/default/vendor/ocaml-websocket/lwt
-> required by executable server in bin/dune:10
-> required by _build/default/bin/server.exe
-> required by _build/install/default/bin/sharer-server
I’m guessing some of my transitive dependencies (lwt_log
in this case) were built against the version of lwt
that I originally got from opam
, and now that I’m trying to build my code against a local copy of lwt
, there are conflicts between the two lwt
s?
Can you think of any ways to work around this problem? Will I have to build “everything” from source if I want to use a local copy of a somewhat low-level library like lwt?
I’m an ocaml beginner, btw, so I don’t have a very good mental model of how ocaml
builds work.
4 posts - 3 participants