This fails because I am including the same module in two executable (which is exactly what I want to do). If I remove the modules stanza, I get an error about arith_interp being used in both executable (which is false, only the first one needs it).
What is the dune way to have a project with several executable files sharing some modules?
Yes, you can use the (executables ...) stanza Stanza Reference — dune documentation. Dune automatically knows which modules to link to each executable by using ocamldep.
Ya, i ran into this learning too. Jarring at first, but it’s actually fast and simple. “dune init” your lib into a new folder and that’s all there is to it. Not bad! It pays dividends for testing too. Recommend to give it a try sooner than later if the project is more than a toy