dune icon indicating copy to clipboard operation
dune copied to clipboard

dune exec: support pform syntax

Open emillon opened this issue 1 year ago • 2 comments

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

emillon avatar Aug 03 '22 16:08 emillon

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

emillon avatar Aug 03 '22 16:08 emillon

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.

rgrinberg avatar Aug 03 '22 22:08 rgrinberg

Replaced by #8474

rgrinberg avatar Aug 31 '23 14:08 rgrinberg