-
Notifications
You must be signed in to change notification settings - Fork 470
Bad interaction between '(mode promote-until-clean)' and tests ran with '-p <pkg>' #4401
Description
Expected Behavior
When using a file (let's say test) that is "promoted until clean" as a dep for a test defined for a specific package foo, dune build @runtest -p foo should succeed.
Actual Behavior
dune build @runtest -p foo fails with Error: No rule found for test.
The conjunction of (mode promote-until-clean) and -p <pkg> seems to make dune "forget" about how to build some targets. I don't know if that is expected and if so, what is the correct way to do things.
Reproduction
See https://gist.github.com/Gbury/598f0b6f751767e8a66fe9c508704976
dune file:
(rule
(target test)
(mode promote-until-clean) ; without this, everything runs fine
; but with it, dune complains about "No rule found for test"
(action (with-stdout-to %{target} (run echo foobar)))
)
(rule
(alias runtest)
(package foo)
(deps (:test test))
(action (diff %{test} reference))
)
dune build @runtestsucceeds as can be expecteddune build @runtest -p foofails with "Error: No rule found for test" (make sure todune cleanbetween attempts, particularly after a successful run)- If the
(mode promote-until-clean)is commented out,dune build @runtest -p foosucceeds
Specifications
- Version of
dune(output ofdune --version): 2.8.4 - Version of
ocaml(output ofocamlc --version): 4.11.1 - Operating system (distribution and version): archlinux 5.11.9-arch1-1
Additional information
- Link to gist with verbose output (run
dunewith the--verboseflag):
Output ofdune build @runtest -p foo --verbose:
https://gist.github.com/Gbury/80ed0220ccdd729781b35d445731de90
In practice, this happens to me in the dolmen project (see e.g. this dune file), where a rule is defined to generate an updated version of menhir's error message file (which is promoted-until-clean, since it is meant to be used as a reference when updating the error messages after changing the grammar), and another rule is defined to use that file to check that all error states have an error message written.