dune icon indicating copy to clipboard operation
dune copied to clipboard

Using `@ocaml-index` with vendored libraries: `Error: Conflict between the following libraries`

Open copy opened this issue 1 year ago • 0 comments

Expected Behavior

dune build @ocaml-index should work

Actual Behavior

dune build @ocaml-index fails with various errors (see below)

Reproduction

  1. opam source base
  2. echo '(executable (name test) (libraries base)) (vendored_dirs base.v0.17.1)' > dune
  3. touch test.ml
  4. dune build @ocaml-index

Specifications

  • Version of dune: 3.16.0
  • Version of ocaml: 5.2.0

Additional information

% dune build @ocaml-index
Error: Conflict between the following libraries:
- "base" in _build/default/base.v0.17.1/src
- "base" in /home/ocaml/.opam/5.2.0+musl/lib/base
  -> required by library "ppx_cold" in
     /home/ocaml/.opam/5.2.0+musl/lib/ppx_cold
-> required by
   _build/default/base.v0.17.1/lint/.ppx_base_lint.objs/cctx.ocaml-index
-> required by alias ocaml-index
Error: Conflict between the following libraries: 
- "base" in _build/default/base.v0.17.1/src
- "base" in /home/ocaml/.opam/5.2.0+musl/lib/base
  -> required by library "core" in /home/ocaml/.opam/5.2.0+musl/lib/core
  -> required by library "expect_test_helpers_core" in
     /home/ocaml/.opam/5.2.0+musl/lib/expect_test_helpers_core
-> required by
   _build/default/base.v0.17.1/hash_types/test/.base_internalhash_types_test.objs/cctx.ocaml-index
-> required by alias ocaml-index
Error: Conflict between the following libraries: 
- "base" in _build/default/base.v0.17.1/src
- "base" in /home/ocaml/.opam/5.2.0+musl/lib/base
  -> required by library "ppx_compare.runtime-lib" in
     /home/ocaml/.opam/5.2.0+musl/lib/ppx_compare/runtime-lib
-> required by
   _build/default/base.v0.17.1/test/helpers/.base_test_helpers.objs/cctx.ocaml-index
-> required by alias ocaml-index
File "base.v0.17.1/test/map_full_interface/dune", line 4, characters 53-65:
4 |    expect_test_helpers_core.expect_test_helpers_base sexp_grammar)
                                                         ^^^^^^^^^^^^
Error: Library "sexp_grammar" not found.
-> required by library "base_test_map_full_interface" in
   _build/default/base.v0.17.1/test/map_full_interface
-> required by
   _build/default/base.v0.17.1/test/map_full_interface/.base_test_map_full_interface.objs/cctx.ocaml-index
-> required by alias ocaml-index
File "base.v0.17.1/test/dune", line 5, characters 3-26:
5 |    sexp_grammar_validation num stdio)
       ^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "sexp_grammar_validation" not found.
-> required by library "base_test" in _build/default/base.v0.17.1/test
-> required by
   _build/default/base.v0.17.1/test/.base_test.objs/cctx.ocaml-index
-> required by alias ocaml-index
Error: Conflict between the following libraries:   
- "base" in _build/default/base.v0.17.1/src
- "base" in /home/ocaml/.opam/5.2.0+musl/lib/base
  -> required by library "core" in /home/ocaml/.opam/5.2.0+musl/lib/core
  -> required by library "async_kernel.config" in
     /home/ocaml/.opam/5.2.0+musl/lib/async_kernel/config
  -> required by library "async_kernel" in
     /home/ocaml/.opam/5.2.0+musl/lib/async_kernel
  -> required by library "async.async_command" in
     /home/ocaml/.opam/5.2.0+musl/lib/async/async_command
  -> required by library "async" in /home/ocaml/.opam/5.2.0+musl/lib/async
-> required by
   _build/default/base.v0.17.1/test/allocation/.base_test_allocation.objs/cctx.ocaml-index
-> required by alias ocaml-index

copy avatar Sep 09 '24 16:09 copy