dune
dune copied to clipboard
dune exec: support pform syntax
This supports things like dune exec time %{bin:e}
.
The syntax is consistent with what support in dune build
and backwards compatible in cases where no arguments start with %
.
The resolution mechanism is slightly different for the program and the rest of the arguments:
- the program is always considered a possible dependency, either in pform syntax (
%{bin:e}
or in string syntax (./path/to/e
,_build/default/path/to/e
). - arguments are only interpreted as dependencies if they are in pform syntax.
Closes #2691
This is an alternative to #6029.
TODO:
- [ ] check what happens with other pforms
- [ ] add a test that shows that several executables are built
- [x] changelog entry
The limitations seem sensible to me.
Can you add some tests for arguments/program names that don't start with a %
but still include variables? I would expect the percent forms to be respected in such cases as well.
Replaced by #8474