@Kenji Maillard proposes that dune-workspace
files can actually contain configuration of working projects, so it is not necessary to bring all sources under the same dir. This should be easy to do, dune already has the dirs
notion, and some proposals of this style have arisen, as of example to allow:
(package
(name foo)
(git repos branch)
....)
You still need to "root" at a directory where the object files will be stored, as indeed you may need a common build dir for the composed objects.
I still have troubles to understand how that should work. I have often repos that are not pure coq (there is a mix of coq code, agda code, some tex, other things...) so I'm usually relying on specific opam switches. Could I set up a dune workspace by specifying that it has to work with a specific opam switch and fetch all dependencies there ?
Yup, dune workspaces allow you to define already the concrete opam switch or switches you want that to be compiled. Dune is at its core a generic build system, so anything that can be expressed as a rule {deps} -[action]-> {targets}
should work, with some limitations, such as targets should be in the same dir as the incremental engine works at a directory-level granularity for lazily evaluating /loading rule changes
So there is still missing support in the sense that the workspace is build from scanning from the root
that is what we could lift
and specify a grafting on the directory tree
"workspace" indeed contains stuff such as the path, etc....
@Kenji Maillard note that you can already do switch selection in a workspace file. So what Emilio describes is a reasonable extension.
Last updated: Jun 03 2023 at 18:01 UTC