aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Gross2020-06-24 13:24:26 -0400
committerJason Gross2020-06-24 13:29:21 -0400
commit9690b138b13c0bb591c8c4aa6bb18cff5c79f655 (patch)
tree2cc8bd6a31e8a4e94fa0a25f263264b0d584a017
parent82485e9f2a36a7a52a56622a553817436636b00b (diff)
[test-suite] Fix dependencies of modules/ files
Fixes #12582 The previous code said that `Nat.v.log` (and therefore `Nat.vo`) should be rebuilt anytime `Nat.v.log` is older than `plik.v.vo`, and also says that `plik.v.log` (and therefore `plik.vo`) should be rebuilt anytime `plik.v.log` is older than `Nat.vo`. This is circular, and results in `make` considering all of the `modules/` tests out-of-date on any fresh run.
-rw-r--r--doc/changelog/11-infrastructure-and-dependencies/12583-fix-remake.rst5
-rw-r--r--test-suite/Makefile9
2 files changed, 13 insertions, 1 deletions
diff --git a/doc/changelog/11-infrastructure-and-dependencies/12583-fix-remake.rst b/doc/changelog/11-infrastructure-and-dependencies/12583-fix-remake.rst
new file mode 100644
index 0000000000..d9c8b634d6
--- /dev/null
+++ b/doc/changelog/11-infrastructure-and-dependencies/12583-fix-remake.rst
@@ -0,0 +1,5 @@
+- **Fixed:**
+ Running ``make`` in ``test-suite/`` twice (or more) in a row will no longer
+ rebuild the ``modules/`` tests on subsequent runs, if they have not been
+ modified in the meantime (`#12583 <https://github.com/coq/coq/pull/12583>`_,
+ fixes `#12582 <https://github.com/coq/coq/issues/12582>`_, by Jason Gross).
diff --git a/test-suite/Makefile b/test-suite/Makefile
index d4ad438d61..59cc3e5a38 100644
--- a/test-suite/Makefile
+++ b/test-suite/Makefile
@@ -629,7 +629,14 @@ $(addsuffix .log,$(wildcard ideal-features/*.v)): %.v.log: %.v $(PREREQUISITELOG
} > "$@"
# Additional dependencies for module tests
-$(addsuffix .log,$(wildcard modules/*.v)): %.v.log: modules/Nat.vo modules/plik.vo
+COMMON_MODULE_DEPENDENCIES := modules/plik.v modules/Nat.v
+# We exclude Nat.v.log and plik.v.log because these log files do not
+# depend on having the corresponding .vo files built first, and we end
+# up with pseudo-cyclic build rules if we don't exclude them (See
+# COQBUG(https://github.com/coq/coq/issues/12582)). Additionally, we
+# impose order-only dependencies to ensure that we won't rebuild the
+# .vo files in the .log target after we've already built them.
+$(addsuffix .log,$(filter-out $(COMMON_MODULE_DEPENDENCIES),$(wildcard modules/*.v))): %.v.log: $(COMMON_MODULE_DEPENDENCIES:.v=.vo) | $(COMMON_MODULE_DEPENDENCIES:.v=.v.log)
modules/%.vo: modules/%.v
$(HIDE)$(coqc) -R modules Mods $<