I expected dune
to automatically download dependencies when running dune build
, but that doesn't happen.
I've tried multiple variants of this, and I tried with ocaml versions 4.14 and 5.0, and with different dune versions written in the dune-project
file (although I didn't try to manually download specific dune
versions, I wasn't sure that would happen automatically), my globally installed dune
version is the latest, 3.10.
This specific set of instructions below was tried in an empty directory, and following the instructions of dune's official documentation.
~> echo '(lang dune 3.10)'> dune-project~> echo '(executable (name hello_world) (libraries core) (preprocess (pps ppx_jane)))'> dune~> echo 'open Core let () = Sexp.to_string_hum [%sexp ([3;4;5] : int list)] |> print_endline'> hello_world.ml'~> dune buildFile "dune", line 3, characters 12-16:3 | (libraries core) ^^^^Error: Library "core" not found.-> required by _build/default/hello_world.exe-> required by alias all-> required by alias defaultFile "dune", line 4, characters 18-26:4 | (preprocess (pps ppx_jane))) ^^^^^^^^Error: Library "ppx_jane" not found.-> required by _build/default/hello_world.pp.ml-> required by alias all-> required by alias default
The error I get is always related to dependencies not ever being found. I tried copying other projects, running other tutorials with different sets of dependencies and whatnot, it's always the same error. I tried to manually meddle with an .opam
file, but it looks like dune
just ignores that and rewrites it.
Running a project without any dependencies works fine.