-
Notifications
You must be signed in to change notification settings - Fork 469
diff? error: Rule failed to generate the following targets #2990
Copy link
Copy link
Closed
ocaml/opam-repository
#16585Description
Please consider the following self-contained example in the form of a dune file:
(executable
(name print)
(modules print))
(rule
(with-stdout-to print.ml
(echo "let () = print_endline \"MESSAGE\"")))
(rule
(alias runtest)
(action
(progn
(with-stdout-to output.expected (echo "MESSAGE\n"))
(with-stdout-to output.actual (run ./print.exe))
(diff? output.expected output.actual))))
When I run dune runtest it generates the following error message which I find confusing:
$ dune runtest
File "dune", line 9, characters 0-195:
9 | (rule
10 | (alias runtest)
11 | (action
12 | (progn
13 | (with-stdout-to output.expected (echo "MESSAGE\n"))
14 | (with-stdout-to output.actual (run ./print.exe))
15 | (diff? output.expected output.actual))))
Error: Rule failed to generate the following targets:
- output.actualAccording to the manual,
(diff? ) is similar to (diff ) except that should be produced by a part of the same action rather than be a dependency, is optional and will be consumed by diff?.
In this case (please correct me if I'm wrong) is produced as a part of the same action, so I would expect no error. Changing (diff? ... to (diff ... works as expected. Perhaps it's a documentation issue?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels