From f9dfb2ff556ff4d32def138dbb53b54a6187b046 Mon Sep 17 00:00:00 2001 From: Andrey Mokhov Date: Mon, 13 Dec 2021 09:23:47 +0000 Subject: [PATCH] Demonstrate target promotion bug (#5292) Signed-off-by: Andrey Mokhov --- .../promote/promote-only-when-needed.t | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/blackbox-tests/test-cases/promote/promote-only-when-needed.t diff --git a/test/blackbox-tests/test-cases/promote/promote-only-when-needed.t b/test/blackbox-tests/test-cases/promote/promote-only-when-needed.t new file mode 100644 index 00000000000..3f9b571fb12 --- /dev/null +++ b/test/blackbox-tests/test-cases/promote/promote-only-when-needed.t @@ -0,0 +1,23 @@ +Test that targets aren't re-promoted if they are up to date. + + $ echo "(lang dune 3.0)" > dune-project + $ cat >dune < (rule + > (targets promoted) + > (mode promote) + > (action (with-stdout-to promoted (echo "Hello, world!")))) + > EOF + + $ dune build promoted --verbose 2>&1 | grep "Promoting" + Promoting "_build/default/promoted" to "promoted" + $ cat promoted + Hello, world! + +Bug: Dune promotes the file again even though its unchanged. + +# CR-someday amokhov: Fix this. + + $ dune build promoted --verbose 2>&1 | grep "Promoting" + Promoting "_build/default/promoted" to "promoted" + $ cat promoted + Hello, world!