mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 403670: Do no work on parallel rebuilds if nothing changed
This fixes the parallel build case (for the InternalBuilder) to update the configuration build state on successful builds. Because parallel builds follow a different code path than the non-parallel case, updating the state was misssed. Change-Id: Idab10c39c3093a731fe6961b451d0fdb5975f240 Reviewed-on: https://git.eclipse.org/r/11286 Reviewed-by: Doug Schaefer <dschaefer@qnx.com> IP-Clean: Doug Schaefer <dschaefer@qnx.com> Tested-by: Doug Schaefer <dschaefer@qnx.com>
This commit is contained in:
parent
7728d48724
commit
178b505535
2 changed files with 12 additions and 3 deletions
|
@ -128,6 +128,12 @@ public class InternalBuildRunner extends AbstractBuildRunner {
|
||||||
status = dBuilder.build(stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
|
status = dBuilder.build(stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
|
||||||
} else {
|
} else {
|
||||||
status = ParallelBuilder.build(des, null, null, stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK), resumeOnErr, buildIncrementaly);
|
status = ParallelBuilder.build(des, null, null, stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK), resumeOnErr, buildIncrementaly);
|
||||||
|
// Bug 403670:
|
||||||
|
// Make sure the build configuration's rebuild status is updated with the result of
|
||||||
|
// this successful build. In the non-parallel case this happens within dBuilder.build
|
||||||
|
// (the cBS is passed as an instance of IResourceRebuildStateContainer).
|
||||||
|
if (status == ParallelBuilder.STATUS_OK)
|
||||||
|
cBS.setState(0);
|
||||||
buildRunnerHelper.printLine(ManagedMakeMessages.getFormattedString("CommonBuilder.7", Integer.toString(ParallelBuilder.lastThreadsUsed))); //$NON-NLS-1$
|
buildRunnerHelper.printLine(ManagedMakeMessages.getFormattedString("CommonBuilder.7", Integer.toString(ParallelBuilder.lastThreadsUsed))); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -200,6 +200,9 @@ public class ParallelBuilder {
|
||||||
* @param monitor Progress monitor
|
* @param monitor Progress monitor
|
||||||
* @param resumeOnErrors If true, build process will not stop when
|
* @param resumeOnErrors If true, build process will not stop when
|
||||||
* compilation errors encountered
|
* compilation errors encountered
|
||||||
|
* @return the status of the operation, one of {@link ParallelBuilder#STATUS_OK},
|
||||||
|
* {@link ParallelBuilder#STATUS_ERROR}, {@link ParallelBuilder#STATUS_CANCELED}, or {@link
|
||||||
|
* ParallelBuilder#STATUS_INVALID}. *
|
||||||
*/
|
*/
|
||||||
static public int build(IBuildDescription des, IPath cwd, GenDirInfo dirs, OutputStream out, OutputStream err, IProgressMonitor monitor, boolean resumeOnErrors, boolean buildIncrementally) {
|
static public int build(IBuildDescription des, IPath cwd, GenDirInfo dirs, OutputStream out, OutputStream err, IProgressMonitor monitor, boolean resumeOnErrors, boolean buildIncrementally) {
|
||||||
IConfiguration cfg = des.getConfiguration();
|
IConfiguration cfg = des.getConfiguration();
|
||||||
|
@ -214,10 +217,10 @@ public class ParallelBuilder {
|
||||||
builder.sortQueue();
|
builder.sortQueue();
|
||||||
monitor.beginTask("", builder.queue.size()); //$NON-NLS-1$
|
monitor.beginTask("", builder.queue.size()); //$NON-NLS-1$
|
||||||
BuildProcessManager buildProcessManager = new BuildProcessManager(out, err, true, threads);
|
BuildProcessManager buildProcessManager = new BuildProcessManager(out, err, true, threads);
|
||||||
builder.dispatch(buildProcessManager);
|
int status = builder.dispatch(buildProcessManager);
|
||||||
lastThreadsUsed = buildProcessManager.getThreadsUsed();
|
lastThreadsUsed = buildProcessManager.getThreadsUsed();
|
||||||
monitor.done();
|
monitor.done();
|
||||||
return IBuildModelBuilder.STATUS_OK;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue