If MAKE_JOB_ERROR_TOKEN is set to false, do not put an error token ("E")

into the job queue.
This avoids closing down an entire build on failure of one branch.
Probably has no use outside the context of universe/tinderbox.

Reviewed by:	obrien
This commit is contained in:
Simon J. Gerraty 2013-09-06 02:55:51 +00:00
parent 318677ad92
commit 2d395cb507
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=255285

View file

@ -178,6 +178,14 @@ __RCSID("$NetBSD: job.c,v 1.176 2013/08/04 16:48:15 sjg Exp $");
*/
#define MAKE_ALWAYS_PASS_JOB_QUEUE ".MAKE.ALWAYS_PASS_JOB_QUEUE"
static int Always_pass_job_queue = TRUE;
/*
* FreeBSD: aborting entire parallel make isn't always
* desired. When doing tinderbox for example, failure of
* one architecture should not stop all.
* We still want to bail on interrupt though.
*/
#define MAKE_JOB_ERROR_TOKEN "MAKE_JOB_ERROR_TOKEN"
static int Job_error_token = TRUE;
/*
* error handling variables
@ -2237,6 +2245,9 @@ Job_Init(void)
Always_pass_job_queue = getBoolean(MAKE_ALWAYS_PASS_JOB_QUEUE,
Always_pass_job_queue);
Job_error_token = getBoolean(MAKE_JOB_ERROR_TOKEN, Job_error_token);
/*
* There is a non-zero chance that we already have children.
* eg after 'make -f- <<EOF'
@ -2832,13 +2843,19 @@ JobTokenAdd(void)
{
char tok = JOB_TOKENS[aborting], tok1;
if (!Job_error_token && aborting == ABORT_ERROR) {
if (jobTokensRunning == 0)
return;
tok = '+'; /* no error token */
}
/* If we are depositing an error token flush everything else */
while (tok != '+' && read(tokenWaitJob.inPipe, &tok1, 1) == 1)
continue;
if (DEBUG(JOB))
fprintf(debug_file, "(%d) aborting %d, deposit token %c\n",
getpid(), aborting, JOB_TOKENS[aborting]);
getpid(), aborting, tok);
while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && errno == EAGAIN)
continue;
}