Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAbility to control the meaning of :standard dirs at workspace level. #3271
Comments
|
I had a look at this now, and it would actually be possible to set this at the project level (inside dune-project files). However, it seems somewhat confusing to me to have multiple defaults in a single workspace. Would setting it in workspace file be enough? |
|
A workspace file would be lovely, we could have a workspace include some more dirs, for example for extended testing under |
|
Honestly, any possible way to allow Dune to see directories underscore directories by default (and have them be seen by things like |
|
Workspace files are for settings that are dependant on the user configurations. Such as opam switch names. That's why they are not meant to be committed and they are not composable. In the case described here, the |
|
@diml in some sense I was understanding the set of considered directories as a kind of But indeed maybe you are right that the best way to handle this is using some symlinks to place into scope the desired extended setup. [The use case for us in Coq is actually multi-repos composition. When we break Coq API, we first work in Coq. Once we are happy, we want |
|
@ejgallego your use case seems valid to me, and maybe we should also support it in Dune. But @jordwalke's case seems orthogonal to me. It's really just: dune thinks these directories contain ancillary data, I'm putting real stuff in there, how do I convince Dune that they are normal directories once and for all? |
|
@diml You described my case correctly. The thing is they can't go in
It's very nice for monorepos to be able to declare it once per large monorepo (in one dune file or dune-project, or workspace config) |
|
It's somewhat annoying that we already have I'm also not sure if modifying the meaning of
Where |
|
@rgrinberg That would work if it only requires having to specify it once, but I'm not sure if that would work with the OCaml syntax for Dune or whatever replaces it. |
|
That would work with dune files in OCaml syntax, however what happens if a sub-directory also has a |
|
@jordwalke, is this still an issue? If yes, do you want write a PR for it? We can also take it on our stack, but it will be low-priority. Regarding the design, let's not generalise prematurely in a given direction. All we need here is the ability to change the meaning of |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Currently directories with leading underscores are ignored by dune by default, even in cases when specifying
(include_subdirs unqualified). There is a pattern in the JS community with the most popular testing library (Jest), where developers put a directory called__tests__right next to the code that it tests. That pattern doesn't translate to Dune because it ignores all directories with a leading underscore. There are ways around it, but there are some downsides to those workarounds.__tests__in its(dirs).(dirs)isn't respected when it is generated using the "include" or Tuareg mode features.I might suggest it would be better if Dune was not so opinionated to ignore directories starting with underscore, but that's probably a more invasive breaking change.
Instead, could we allow projects to specify at the dune-project or dune-workspace level, the meaning of
:standarddirs? For example, you could override the default definition of:standard. Right nowstandardis a regex[^_\.].*, but this could be overridden so be.*for this Jest style pattern.