Inferring empty library files when they are missing
Similar to https://github.com/ocaml/dune/issues/11798, it would be great to have a mode where if a library file (my_lib.ml for the library my_lib) is missing nothing is exported from the library.
This is trivial to achieve simply by adding an empty my_lib.ml. Not sure a special mode brings anything to the table. Note that you would still need to do something per library, adding a file does not seem more work than adding a flag to the stanza.
@ddickstein are you perhaps also hinting that this mode would be the better default than the current default of exporting everything? Otherwise, I agree with Nicolas that adding a feature or this is not going to be materially easier than writing (rule (write-file lib.mli "")) in your dune file.
I do think it's the better default but I at least wanted to have something I could put in all my dune files, which that rule would do. Could some sort of %{lib} variable be added (or is there one already) to make this easier (so all the files could just have (rule (write-file %{lib}.ml ""))?
It's worth remembering that dune allows for more than one library per dune file. So there's no good value to pick for %{lib} in some cases.
I suppose adding a project based default value would be a good idea.