mirror of
https://github.com/boostorg/build.git
synced 2026-02-20 14:42:14 +00:00
Corrected how Boost Jam handles no-op actions, i.e. those that the used exec*.c platform specific implementation module flagged as a no-op. They still do not cause an external process to be triggered but internally Boost Jam now processes their results the same as if they had been triggered and had done nothing except return EXIT_OK (i.e. they get reported correctly with -d1 & -d2 options, their timing and action rules get triggered and such). This fixes the core_d12.py Boost Build test which was failing due to no-op actions no causing their names to be reported to stdout when run with -d1.
[SVN r79104]
This commit is contained in:
@@ -35,6 +35,7 @@ CMD * cmd_new( RULE * rule, LIST * targets, LIST * sources, LIST * shell )
|
||||
cmd->rule = rule;
|
||||
cmd->shell = shell;
|
||||
cmd->next = 0;
|
||||
cmd->noop = 0;
|
||||
|
||||
lol_init( &cmd->args );
|
||||
lol_add( &cmd->args, targets );
|
||||
|
||||
@@ -53,6 +53,7 @@ struct _cmd
|
||||
LIST * shell; /* $(JAMSHELL) value */
|
||||
LOL args; /* LISTs for $(<), $(>) */
|
||||
string buf[ 1 ]; /* actual commands */
|
||||
int noop; /* no-op commands should be faked instead of executed */
|
||||
};
|
||||
|
||||
CMD * cmd_new
|
||||
|
||||
@@ -52,7 +52,7 @@ int exec_check
|
||||
|
||||
/* exec_check() return codes. */
|
||||
#define EXEC_CHECK_OK 101
|
||||
#define EXEC_CHECK_SKIP 102
|
||||
#define EXEC_CHECK_NOOP 102
|
||||
#define EXEC_CHECK_LINE_TOO_LONG 103
|
||||
#define EXEC_CHECK_TOO_LONG 104
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ int exec_check
|
||||
char const * s = command->value;
|
||||
while ( isspace( *s ) ) ++s;
|
||||
if ( !*s )
|
||||
return EXEC_CHECK_SKIP;
|
||||
return EXEC_CHECK_NOOP;
|
||||
}
|
||||
|
||||
/* Check prerequisites for executing raw commands. */
|
||||
@@ -246,7 +246,7 @@ int exec_check
|
||||
return EXEC_CHECK_TOO_LONG;
|
||||
}
|
||||
else
|
||||
return raw_cmd_length ? EXEC_CHECK_OK : EXEC_CHECK_SKIP;
|
||||
return raw_cmd_length ? EXEC_CHECK_OK : EXEC_CHECK_NOOP;
|
||||
}
|
||||
|
||||
/* Now we know we are using an external shell. Note that there is no need to
|
||||
|
||||
@@ -116,7 +116,7 @@ int exec_check
|
||||
* know what they are going to do with such commands.
|
||||
*/
|
||||
if ( !command->size && ( is_raw_cmd || list_empty( *pShell ) ) )
|
||||
return EXEC_CHECK_SKIP;
|
||||
return EXEC_CHECK_NOOP;
|
||||
|
||||
return is_raw_cmd
|
||||
? EXEC_CHECK_OK
|
||||
|
||||
@@ -557,15 +557,26 @@ static void make1c( state * pState )
|
||||
/* Increment the jobs running counter. */
|
||||
++cmdsrunning;
|
||||
|
||||
/* Execute the actual build command. */
|
||||
exec_cmd( cmd->buf, make_closure, t, cmd->shell, rule_name,
|
||||
target_name );
|
||||
|
||||
/* Wait until under the concurrent command count limit. */
|
||||
assert( 0 < globs.jobs );
|
||||
assert( globs.jobs <= MAXJOBS );
|
||||
while ( cmdsrunning >= globs.jobs )
|
||||
exec_wait();
|
||||
/* Execute the actual build command or fake it if no-op. */
|
||||
if ( cmd->noop )
|
||||
{
|
||||
timing_info time_info = { 0 } ;
|
||||
time_info.start = time_info.end = time( 0 );
|
||||
out_action( rule_name, target_name, cmd->buf->value, "", "",
|
||||
EXIT_OK );
|
||||
make_closure( t, EXEC_CMD_OK, &time_info, cmd->buf->value, "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
exec_cmd( cmd->buf, make_closure, t, cmd->shell, rule_name,
|
||||
target_name );
|
||||
|
||||
/* Wait until under the concurrent command count limit. */
|
||||
assert( 0 < globs.jobs );
|
||||
assert( globs.jobs <= MAXJOBS );
|
||||
while ( cmdsrunning >= globs.jobs )
|
||||
exec_wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1076,9 +1087,10 @@ static CMD * make1cmds( TARGET * t )
|
||||
{
|
||||
accept_command = 1;
|
||||
}
|
||||
else if ( cmd_check_result == EXEC_CHECK_SKIP )
|
||||
else if ( cmd_check_result == EXEC_CHECK_NOOP )
|
||||
{
|
||||
/* Simply release the prepared command. */
|
||||
accept_command = 1;
|
||||
cmd->noop = 1;
|
||||
}
|
||||
else if ( ( actions->flags & RULE_PIECEMEAL ) && ( chunk > 1 ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user