Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Ensure PrintOnError always reports 'stopped in'...



details:   https://anonhg.NetBSD.org/src/rev/8e657fe9b932
branches:  trunk
changeset: 958504:8e657fe9b932
user:      sjg <sjg%NetBSD.org@localhost>
date:      Fri Jan 08 21:46:50 2021 +0000

description:
Ensure PrintOnError always reports 'stopped in' on first call.

We may still suppress the rest of the noise if shouldDieQuietly
says to, but the 'stopped in' output is too important to lose.
Avoid repeating it though in the same process.

For the case of aborting due to failure detected elsewhere,
exit 6 so we have a clue.

PR: 55578
Reviewed by:

diffstat:

 usr.bin/make/job.c                                 |   6 +++---
 usr.bin/make/main.c                                |  14 +++++++-------
 usr.bin/make/unit-tests/jobs-error-nested-make.exp |   2 ++
 3 files changed, 12 insertions(+), 10 deletions(-)

diffs (77 lines):

diff -r 4bd7ff13f422 -r 8e657fe9b932 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Fri Jan 08 21:25:03 2021 +0000
+++ b/usr.bin/make/job.c        Fri Jan 08 21:46:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.393 2021/01/08 04:36:44 sjg Exp $    */
+/*     $NetBSD: job.c,v 1.394 2021/01/08 21:46:50 sjg Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.393 2021/01/08 04:36:44 sjg Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.394 2021/01/08 21:46:50 sjg Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -2864,7 +2864,7 @@
                       errno == EAGAIN)
                        continue;
                if (shouldDieQuietly(NULL, 1))
-                       exit(2);
+                       exit(6);        /* we aborted */
                Fatal("A failure has been detected "
                      "in another branch of the parallel make");
        }
diff -r 4bd7ff13f422 -r 8e657fe9b932 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Fri Jan 08 21:25:03 2021 +0000
+++ b/usr.bin/make/main.c       Fri Jan 08 21:46:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.508 2020/12/31 17:39:36 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.509 2021/01/08 21:46:50 sjg Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -110,7 +110,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.508 2020/12/31 17:39:36 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.509 2021/01/08 21:46:50 sjg Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -2132,16 +2132,16 @@
                Var_Stats();
        }
 
-       /* we generally want to keep quiet if a sub-make died */
-       if (shouldDieQuietly(gn, -1))
-               return;
+       if (errorNode != NULL)
+               return;         /* we've been here! */
 
        if (msg != NULL)
                printf("%s", msg);
        printf("\n%s: stopped in %s\n", progname, curdir);
 
-       if (errorNode != NULL)
-               return;         /* we've been here! */
+       /* we generally want to keep quiet if a sub-make died */
+       if (shouldDieQuietly(gn, -1))
+               return;
 
        if (gn != NULL)
                SetErrorVars(gn);
diff -r 4bd7ff13f422 -r 8e657fe9b932 usr.bin/make/unit-tests/jobs-error-nested-make.exp
--- a/usr.bin/make/unit-tests/jobs-error-nested-make.exp        Fri Jan 08 21:25:03 2021 +0000
+++ b/usr.bin/make/unit-tests/jobs-error-nested-make.exp        Fri Jan 08 21:46:50 2021 +0000
@@ -6,4 +6,6 @@
 1 error
 
 make: stopped in unit-tests
+
+make: stopped in unit-tests
 exit status 2



Home | Main Index | Thread Index | Old Index