You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following setup: I'm writing a compiler xcomp from language X to C; I have an examples folder, which contains prog1 … progN. To run an example, I run xcomp examples/progN -o examples/_objects/progN/, which produces plenty of output files, including a progN.c file and a Makefile. Some of these example programs don't take further inputs; others need extra data, so there are a few folders progN.etc/, containing extra files.
In my Makefile-based setup, I run xcomp examples/progN -o examples/_objects/progN/, then cp -R examples/progN.etc/* examples/_objects/progN/, and finally make run in examples/_objects/progN/.
I'm moving this to Dune. I wrote a script to generate a long Dune file with one subdir stanza per example, like this:
But I can't find a way to also copy everything from examples/prog8.etc/ into examples/_objects/prog8. I could list all files from examples/prog8.etc in the target section, but that's going to get messy fairly quick (and unpleasant during development, when the set of files changes regularly), and Dune seems to already know how to do this for dependencies with glob_files. Basically I'd like something like this:
… but obviously this doesn't work. I'm not too sure how to proceed. Is there an alternative approach I could take, using currently supported features? I think the key difficulty is telling dune to promote all files that end up in the examples/_objects/prog8 directory; that is, if I could just tell dune that my target is a complete folder, it would also work perfectly:
Consider the following setup: I'm writing a compiler
xcomp
from language X to C; I have anexamples
folder, which containsprog1
…progN
. To run an example, I runxcomp examples/progN -o examples/_objects/progN/
, which produces plenty of output files, including aprogN.c
file and aMakefile
. Some of these example programs don't take further inputs; others need extra data, so there are a few foldersprogN.etc/
, containing extra files.In my Makefile-based setup, I run
xcomp examples/progN -o examples/_objects/progN/
, thencp -R examples/progN.etc/* examples/_objects/progN/
, and finallymake run
inexamples/_objects/progN/
.I'm moving this to Dune. I wrote a script to generate a long Dune file with one
subdir
stanza per example, like this:But I can't find a way to also copy everything from
examples/prog8.etc/
intoexamples/_objects/prog8
. I could list all files fromexamples/prog8.etc
in thetarget
section, but that's going to get messy fairly quick (and unpleasant during development, when the set of files changes regularly), and Dune seems to already know how to do this for dependencies withglob_files
. Basically I'd like something like this:… but obviously this doesn't work. I'm not too sure how to proceed. Is there an alternative approach I could take, using currently supported features? I think the key difficulty is telling dune to promote all files that end up in the
examples/_objects/prog8
directory; that is, if I could just tell dune that my target is a complete folder, it would also work perfectly:The text was updated successfully, but these errors were encountered: