robur-coop / happy-eyeballs

An implementation of happy eyeballs (RFC 8305) in OCaml with lwt
ISC License
22 stars 4 forks source link

`dune b` results in compilation error #23

Closed bikallem closed 2 years ago

bikallem commented 2 years ago

I have dns-client package installed in my opam switch. While trying to build this repo, I get an error as below:

Error: Conflict between the following libraries:
- "happy-eyeballs" in _build/default/src
- "happy-eyeballs" in /home/user1/.opam/4.12.0+domains/lib/happy-eyeballs
  -> required by library "dns-client.lwt" in
     /home/user1/.opam/4.12.0+domains/lib/dns-client/lwt
  -> required by library "happy-eyeballs-lwt" in _build/default/lwt
-> required by executable test in app/dune:2
-> required by _build/default/app/test.exe
-> required by alias app/all
-> required by alias default
Error: Conflict between the following libraries:
- "happy-eyeballs" in _build/default/src
- "happy-eyeballs" in /home/user1/.opam/4.12.0+domains/lib/happy-eyeballs
  -> required by library "dns-client.lwt" in
     /home/user1/.opam/4.12.0+domains/lib/dns-client/lwt
-> required by
   _build/default/lwt/.happy_eyeballs_lwt.objs/byte/happy_eyeballs_lwt.cmi
-> required by
   _build/install/default/lib/happy-eyeballs-lwt/happy_eyeballs_lwt.cmi
-> required by _build/default/happy-eyeballs-lwt.install
-> required by alias all
-> required by alias default
Error: Conflict between the following libraries:
- "happy-eyeballs" in _build/default/src
- "happy-eyeballs" in /home/user1/.opam/4.12.0+domains/lib/happy-eyeballs
  -> required by library "dns-client.mirage" in
     /home/user1/.opam/4.12.0+domains/lib/dns-client/mirage
-> required by
   _build/default/mirage/.happy_eyeballs_mirage.objs/byte/happy_eyeballs_mirage.cmi
-> required by
   _build/install/default/lib/happy-eyeballs-mirage/happy_eyeballs_mirage.cmi
-> required by _build/default/happy-eyeballs-mirage.install
-> required by alias all
-> required by alias default

It seems there is a circular reference in between dns-client and happy-eyeballs since dns-client.lwt depends on happy-eyeballs and happy-eyeballs.lwt depends on dns-client.lwt.

hannesm commented 2 years ago

I'm sorry that you encountered that issue. This may be a deficiency in the dune build system. A workaround is to opam source dns-client after the git clone of happy-eyeballs. I put these instructions into the README.