Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 520

Finding the root of a Dune project (request for comments)

$
0
0

@grayswandyr wrote:

Hi there,

I’m reporting on a discussion I had with @diml on dune’s issue tracker.

As of now, when dune is run, it looks for the root of the project to be built. This is done by recursing upwards in the file hierarchy, looking for dune-workspace/dune-project files, until there aren’t anymore.

Which means that if you happen to have such a file in a parent directory, your build may break because this directory has other descendants that fail building. Like this:

R/dune-workspace
R/P/ ... my perfectly fine project ...
R/F/ ... a failing project ...

If you run dune from P, your build will fail due to F and the root being inferred to be R.

To prevent this, you may pass a --root command-line option to dune, but of course it means that you should be aware that there are dune-workspace files upper in the hierarchy.

As I already had build failures, such as the one sketched above, several times, I’d like to be able to set the root of a project explicitly. For instance by stopping at the first dune-workspace upward (incl. the current directory). @diml told me this question comes again from time to time so he suggested I’d poll the community about this, so here I am.

What are your thoughts?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 520

Trending Articles