Control: tag -1 patch

On Tue, 13 Feb 2018 11:05:21 +0100 Matthias Klose <d...@debian.org>
wrote:
> Package: src:make-dfsg
> Version: 4.2.1-1
> Severity: serious
> 
> according to https://buildd.debian.org/status/package.php?p=make-dfsg
> make-dfsg fails tests on at least arm64, armhf, armel, i386, mipsel.
> 
> Test timed out after 30 seconds
> Error running /<<PKGBUILDDIR>>/debian/build-make/tests/../make (expected 0; 
> got
> 14): /<<PKGBUILDDIR>>/debian/build-make/tests/../make -f
> work/features/output-sync.mk -j -Orecurse
> 
> Caught signal 14!
> FAILED (14/15 passed)
> 
> I see it failing on amd64 and ppc64el as well here:
> https://launchpad.net/ubuntu/+source/make-dfsg/4.2.1-1

I can reliably reproduce this on my laptop if I run other CPU-intensive 
tasks, but not if it's otherwise mostly idle.  It is always this group
of tests that fails, either testing the -Orecurse or -Otarget option
(and this matches the failures on buildds).

There are some fixes upstream for race conditions in job handling that
I thought could account for this, but they don't seem to be sufficient
to fix this.  The kluge I came up with is to treat -Orecurse and
-Otarget the same as -Oline (which still seems reliable) and to disable
the tests that verify that the output ordering is as expected with
these options.

Yes, this is horrible.

Ben.

-- 
Ben Hutchings
The world is coming to an end.  Please log off.

From ecf5a58ac9b282330f15eb7687465f709b2b665a Mon Sep 17 00:00:00 2001
From: Ben Hutchings <b...@decadent.org.uk>
Date: Wed, 11 Jul 2018 05:22:30 +0100
Subject: [PATCH] Treat -Otarget and -Orecurse as -Oline, to avoid a hang

Disable test cases that specifically depend on -Otarget or -Orecurse.
---
 main.c                             |  9 +++++++--
 tests/scripts/features/output-sync | 13 +++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c
index cff1d9828983..4c7e438389b1 100644
--- a/main.c
+++ b/main.c
@@ -795,10 +795,15 @@ decode_output_sync_flags (void)
         output_sync = OUTPUT_SYNC_NONE;
       else if (streq (output_sync_option, "line"))
         output_sync = OUTPUT_SYNC_LINE;
+      /*
+       * benh: -Otarget and -Orecurse can currently cause make to hang
+       * (#890309).  For now, do the best we can and treat them like
+       * -Oline.
+       */
       else if (streq (output_sync_option, "target"))
-        output_sync = OUTPUT_SYNC_TARGET;
+        output_sync = OUTPUT_SYNC_LINE;
       else if (streq (output_sync_option, "recurse"))
-        output_sync = OUTPUT_SYNC_RECURSE;
+        output_sync = OUTPUT_SYNC_LINE;
       else
         OS (fatal, NILF,
             _("unknown output-sync type '%s'"), output_sync_option);
diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync
index 7237e65bfd6e..4655e6988d87 100644
--- a/tests/scripts/features/output-sync
+++ b/tests/scripts/features/output-sync
@@ -122,6 +122,9 @@ baz: baz-base
 EOF
 close(MAKEFILE);
 
+# benh: Skip tests of -Orecurse and -Otarget which are broken
+if (0) {
+
 # Test per-make synchronization.
 unlink(@syncfiles);
 run_make_test(qq!
@@ -211,6 +214,8 @@ foo-fail: end
 #MAKE#: *** [#MAKEFILE#:4: make-foo-fail] Error 2\n",
 512);
 
+}
+
 # Test the per-job synchronization.
 # For this we'll have bar-job:
 #   print start, invoke bar-start, wait for foo-start, print end, print-bar-end
@@ -252,7 +257,9 @@ run_make_test(qq!
 !,
               '-j -Oline', "foo\nbar\n");
 
+if (0) {
 run_make_test(undef, '-j -Otarget', "foo\nbar\n");
+}
 
 # Ensure when make writes out command it's not misordered
 run_make_test(qq!
@@ -262,7 +269,9 @@ run_make_test(qq!
 !,
               '-j -Oline', "foobar\ntrue\n");
 
+if (0) {
 run_make_test(undef, '-j -Otarget', "foobar\ntrue\n");
+}
 
 # Ensure that shell functions inside recipes write stderr to the sync file
 run_make_test(q!
@@ -270,6 +279,8 @@ all: ; @: $(shell echo foo 1>&2)
 !,
               '-w -Oline', "#MAKE#: Entering directory '#PWD#'\nfoo\n#MAKE#: Leaving directory '#PWD#'\n");
 
+if (0) {
+
 # Ensure that output generated while parsing makefiles is synced
 # when appropriate.
 run_make_test(q!
@@ -278,6 +289,8 @@ all: ; echo bar
 !,
               '-s -w -Otarget', "#MAKE#: Entering directory '#PWD#'\nfoo\n#MAKE#: Leaving directory '#PWD#'\n#MAKE#: Entering directory '#PWD#'\nbar\n#MAKE#: Leaving directory '#PWD#'\n");
 
+}
+
 # Test recursion
 $m1 = get_tmpfile();
 $m2 = get_tmpfile();

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to