Nikos Mavrogiannopoulos <[email protected]> writes:

> On Mon, 2017-05-22 at 19:09 +0200, Niels Möller wrote:
>
>> Ouch, I think that indicates a real problem with the change I made, a
>> ./configure && make && make check build will now always remake the
>> .test-rules.make file, because it depends on Makefile, which
>> obviously
>> is modified by configure. That's pretty bad.
>> 
>> I think I saw a problem with having it depend only on Makefile.in, I
>> have to investigate and probably change back.

I'm about to commit the below patch. Seems to work for me, I tried
removing and readding entries to TS_NETTLE_SOURCES, and .test-rules.make
was updates as expected. And also make distcheck still works.

> Do you see the gitlab notifications about broken builds?

I get occasional notifications, but I'm not really familiar with that process.

> An approach to
> avoid broken builds in master, may be to wait for a successful build
> prior to committing to master. For example committing to a branch first
> and waiting for the gitlab.com mirror sync and the CI results.

If I create a branch for that purpose, will it be picked up
automatically? Roughly how long is the latency for sync + build?

Regards,
/Niels

diff --git a/ChangeLog b/ChangeLog
index 8269e6b..e730110 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-05-23  Niels Möller  <[email protected]>
+
+       Rework the previous change, which had the unintended effect of
+       always regenerating .test-rules.make after ./configure is run.
+       * testsuite/Makefile.in (test-rules.stamp): New stamp file target,
+       depend on Makefile.in, and run $(MAKE) test-rules.
+       (.test-rules.make): Add a level of indirection, by depending on
+       test-rules.stamp.
+
 2017-05-20  Niels Möller  <[email protected]>
 
        * testsuite/Makefile.in (test-rules): Use $(srddir)/-prefix for
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index cc8dea3..c1ac7d2 100644
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -67,6 +67,7 @@ EXTRA_TARGETS = $(EXTRA_SOURCES:.c=$(EXEEXT))
 SOURCES = $(TS_SOURCES) $(EXTRA_SOURCES) testutils.c dlopen-test.c
 
 DISTFILES = $(SOURCES) $(CXX_SOURCES) Makefile.in .test-rules.make \
+           test-rules.stamp \
            $(TS_SH) setup-env teardown-env \
            gold-bug.txt testutils.h sha3.awk
 
@@ -96,9 +97,7 @@ dlopen-test$(EXEEXT): dlopen-test.$(OBJEXT) 
testutils.$(OBJEXT)
        $(LINK) dlopen-test.$(OBJEXT) -ldl -o dlopen-test$(EXEEXT)
 
 .PHONY: test-rules
-test-rules: $(srcdir)/.test-rules.make
-
-$(srcdir)/.test-rules.make: Makefile
+test-rules:
        (for f in $(TS_NETTLE) $(TS_HOGWEED) $(EXTRA_TARGETS) ; do \
          echo $$f'$$(EXEEXT): '$$f'.$$(OBJEXT)' ; \
          echo '        $$(LINK) '$$f'.$$(OBJEXT) $$(TEST_OBJS) -o 
'$$f'$$(EXEEXT)' ; \
@@ -109,10 +108,14 @@ $(srcdir)/.test-rules.make: Makefile
          echo '        $$(LINK_CXX) '$$f'.$$(OBJEXT) $$(TEST_OBJS) -o 
'$$f'$$(EXEEXT)' ; \
          echo ; \
        done) > $(srcdir)/.test-rules.make
-       @echo 
"******************************************************************"
-       @echo "testsuite Makefile rules have been regenerated; please re-run 
make"
-       @echo 
"******************************************************************"
-       false
+
+$(srcdir)/.test-rules.make: $(srcdir)/test-rules.stamp
+
+# Updates the stamp file *first*, so that this rule isn't triggered
+# again and again by the recursive $(MAKE).
+$(srcdir)/test-rules.stamp: Makefile.in
+       echo stamp > $(srcdir)/test-rules.stamp
+       $(MAKE) test-rules
 
 include $(srcdir)/.test-rules.make
 
diff --git a/testsuite/test-rules.stamp b/testsuite/test-rules.stamp
new file mode 100644
index 0000000..859afb1
--- /dev/null
+++ b/testsuite/test-rules.stamp
@@ -0,0 +1 @@
+stamp

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to