From owner-freebsd-bugs@FreeBSD.ORG Thu Mar 1 17:30:12 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B35E106566B for ; Thu, 1 Mar 2012 17:30:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E54228FC17 for ; Thu, 1 Mar 2012 17:30:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q21HUBTg066929 for ; Thu, 1 Mar 2012 17:30:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q21HUBbD066927; Thu, 1 Mar 2012 17:30:11 GMT (envelope-from gnats) Resent-Date: Thu, 1 Mar 2012 17:30:11 GMT Resent-Message-Id: <201203011730.q21HUBbD066927@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4480106567F for ; Thu, 1 Mar 2012 17:20:08 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 897288FC0C for ; Thu, 1 Mar 2012 17:20:08 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q21HK8Jq047420 for ; Thu, 1 Mar 2012 17:20:08 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q21HK8xi047419; Thu, 1 Mar 2012 17:20:08 GMT (envelope-from nobody) Message-Id: <201203011720.q21HK8xi047419@red.freebsd.org> Date: Thu, 1 Mar 2012 17:20:08 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/165589: [patch] make pmake errors more apparent X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 17:30:12 -0000 >Number: 165589 >Category: bin >Synopsis: [patch] make pmake errors more apparent >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 01 17:30:11 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9.0-STABLE >Organization: n/a >Environment: FreeBSD bayonetta.local 9.0-STABLE FreeBSD 9.0-STABLE #6 r231963M: Mon Feb 20 23:15:28 PST 2012 gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA amd64 >Description: The attached patch makes pmake mimic gmake in the sense that the failing target is printed out in the error message. Example: $ make -f ~/Makefile.bad *** [all] Error code 1 Stop in /scratch/git/gitorious/freenas. This makes life a lot easier for developers and end-users because then (if one's really slick, or just does manual inspection), it becomes really easy to determine the root cause of a build failure. This is particularly important when dealing with -j > 1, as the output becomes interleaved and it becomes extremely hard to track down the exact source behind a given build failure. >How-To-Repeat: $ sh $ cat > Makefile.bad <Fix: Patch attached with submission follows: Index: usr.bin/make/job.c =================================================================== --- usr.bin/make/job.c (revision 228107) +++ usr.bin/make/job.c (working copy) @@ -954,17 +954,18 @@ lastNode = job->node; } fprintf(out, - "*** Completed successfully\n"); + "*** [%s] Completed successfully\n", + job->node->name); } } else { if (usePipes && job->node != lastNode) { - MESSAGE(out, job->node); lastNode = job->node; } - fprintf(out, "*** Error code %d%s\n", + fprintf(out, "*** [%s] Error code %d%s\n", + job->node->name, WEXITSTATUS(*status), (job->flags & JOB_IGNERR) ? - "(ignored)" : ""); + " (ignored)" : ""); if (job->flags & JOB_IGNERR) { *status = 0; @@ -1002,10 +1003,10 @@ */ if (job->flags & (JOB_RESUME | JOB_RESTART)) { if (usePipes && job->node != lastNode) { - MESSAGE(out, job->node); lastNode = job->node; } - fprintf(out, "*** Continued\n"); + fprintf(out, "*** [%s] Continued\n", + job->node->name); } if (!(job->flags & JOB_CONTINUING)) { DEBUGF(JOB, ("Warning: process %jd was not " @@ -1025,11 +1026,11 @@ } else { if (usePipes && job->node != lastNode) { - MESSAGE(out, job->node); lastNode = job->node; } fprintf(out, - "*** Signal %d\n", WTERMSIG(*status)); + "*** [%s] Signal %d\n", job->node->name, + WTERMSIG(*status)); fflush(out); } } @@ -1053,10 +1054,10 @@ DEBUGF(JOB, ("Process %jd stopped.\n", (intmax_t) job->pid)); if (usePipes && job->node != lastNode) { - MESSAGE(out, job->node); lastNode = job->node; } - fprintf(out, "*** Stopped -- signal %d\n", WSTOPSIG(*status)); + fprintf(out, "*** [%s] Stopped -- signal %d\n", + job->node->name, WSTOPSIG(*status)); job->flags |= JOB_RESUME; TAILQ_INSERT_TAIL(&stoppedJobs, job, link); fflush(out); @@ -3042,13 +3043,15 @@ if (status == 0) { return (0); } else { - printf("*** Error code %d", status); + printf("*** [%s] Error code %d", + gn->name, status); } } else if (WIFSTOPPED(reason)) { status = WSTOPSIG(reason); } else { status = WTERMSIG(reason); - printf("*** Signal %d", status); + printf("*** [%s] Signal %d", + gn->name, status); } if (ps.errCheck) { >Release-Note: >Audit-Trail: >Unformatted: