dune
dune copied to clipboard
Unexpected find result concerning included module
Expected Behavior
Dune should build the project or tell me what's wrong.
Actual Behavior
$ dune build
Internal error, please report upstream including the contents of _build/log.
Description:
("Unexpected find result", { found = Not_found; lib.name = "lib_core" })
Raised at Stdune__code_error.raise in file "otherlibs/stdune/code_error.ml",
line 11, characters 30-62
Called from Fiber__scheduler.exec in file "src/fiber/scheduler.ml", line 69,
characters 8-11
-> required by ("<unnamed>", ())
-> required by ("<unnamed>", ())
-> required by ("<unnamed>", ())
-> required by ("load-dir", In_build_dir "default/bin")
-> required by ("<unnamed>", ())
-> required by ("build-alias", { dir = "default"; name = "default" })
-> required by ("toplevel", ())
I must not crash. Uncertainty is the mind-killer. Exceptions are the
little-death that brings total obliteration. I will fully express my cases.
Execution will pass over me and through me. And when it has gone past, I
will unwind the stack along its path. Where the cases are handled there will
be nothing. Only I will remain.
Reproduction
I manage to come up with a minimal example:
- download and unzip dune-bug.zip
-
cd dune-bug
-
dune build
There is a package pack
with
- a private module
lib_core
- a package
pack
containing - a library
lib_dep
that openlib_core
- a top-level library
LIB
with a public name, openinglib_dep
and includinglib_core
And, in another directory bin
, a program depending on this package pack
.
:exclamation: The problem occurs when there is a dune-project
file in the bin
directory.
Specifications
- Version of
dune
(output ofdune --version
): 3.3.1 - Version of
ocaml
(output ofocamlc --version
) 5.0.0~alpha1 - Operating system (distribution and version): Manjaro
Additional information
- Link to gist with verbose output (run
dune
with the--verbose
flag): output ofdune build --verbose
Thanks. I reduced that to:
$ cat > ./dune-project << EOF
> (lang dune 2.9)
> (package (name pub))
> EOF
$ cat > dune << EOF
> (library
> (public_name pub)
> (modules pub)
> (libraries priv))
>
> (library
> (name priv)
> (modules priv)
> (package pub)
> (libraries dep))
>
> (library
> (name dep)
> (modules dep))
> EOF
$ touch pub.ml
$ touch priv.ml
$ touch dep.ml
$ mkdir bin
$ cat > ./bin/dune-project << EOF
> (lang dune 2.9)
> EOF
$ cat > ./bin/dune << EOF
> (executable
> (name prog)
> (libraries pub))
> EOF
$ touch ./bin/prog.ml
$ dune build
priv
is private dependency of a public library, which has special semantics (it gets privately installed) - I suppose that all of its private dependencies should get the same treatment. Not sure why it doesn't work across projects.
See #6157
Fixed.