diff options
author | Andrey Loskutov | 2021-06-01 08:38:24 +0000 |
---|---|---|
committer | Andrey Loskutov | 2021-06-07 07:19:51 +0000 |
commit | d240af240f368757546391273f196a9a6718396e (patch) | |
tree | 9cc53bb3e221eb27edf8d45128b0018e0777bf8b | |
parent | 4bca749b780c2a9221c9614490e636fe5d2de99b (diff) | |
download | eclipse.platform.resources-d240af240f368757546391273f196a9a6718396e.tar.gz eclipse.platform.resources-d240af240f368757546391273f196a9a6718396e.tar.xz eclipse.platform.resources-d240af240f368757546391273f196a9a6718396e.zip |
Bug 568299 - reset rebuildRequested flag & don't use on parallel build
If a builder sets rebuildRequested to true in the basic build loop, the
flag remains set and could be seen during the single project build
executed right after the multiple projects build. This would cause no
build executed at all, because the basic build loop doesn't clean up the
flag on exit. Similar may happen with two consecutive single project
builds.
So we should always reset rebuildRequested flag if we start new single
project build, and we should ignore this flag completely during parallel
build, because we don't know which project requested it.
Change-Id: I226fc93e7c159cfc3b874d311f5b3e7b78d835c6
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/181209
Tested-by: Platform Bot <platform-bot@eclipse.org>
-rw-r--r-- | bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java index 6a4dc4c94..c2f06282d 100644 --- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java +++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java @@ -141,6 +141,9 @@ public class BuildManager implements ICoreConstants, IManager, ILifecycleListene //used for the build cycle looping mechanism private boolean rebuildRequested = false; + // Shows if we are in the parallel build loop or not + private boolean parallelBuild; + private final Bundle systemBundle = Platform.getBundle("org.eclipse.osgi"); //$NON-NLS-1$ // protects against concurrent access of session stored builders during builder initialization @@ -265,7 +268,7 @@ public class BuildManager implements ICoreConstants, IManager, ILifecycleListene try { for (int i = 0; i < commands.length; i++) { checkCanceled(trigger, monitor); - if (EARLY_EXIT_FROM_INNER_BUILD_LOOP_ALLOWED && rebuildRequested) { + if (EARLY_EXIT_FROM_INNER_BUILD_LOOP_ALLOWED && rebuildRequested && !parallelBuild) { // Don't build following configs if one of the predecessors // requested rebuild anyway, just start from scratch break; @@ -419,6 +422,7 @@ public class BuildManager implements ICoreConstants, IManager, ILifecycleListene * @return A status indicating if the build succeeded or failed */ public IStatus buildParallel(Digraph<IBuildConfiguration> configs, IBuildConfiguration[] requestedConfigs, int trigger, JobGroup buildJobGroup, IProgressMonitor monitor) { + parallelBuild = true; monitor = Policy.monitorFor(monitor); try { monitor.beginTask(Messages.events_building_0, TOTAL_BUILD_WORK); @@ -433,6 +437,7 @@ public class BuildManager implements ICoreConstants, IManager, ILifecycleListene } } finally { endBuild(trigger, monitor); + parallelBuild = false; } } @@ -476,6 +481,7 @@ public class BuildManager implements ICoreConstants, IManager, ILifecycleListene */ public IStatus build(IBuildConfiguration buildConfiguration, int trigger, String builderName, Map<String, String> args, IProgressMonitor monitor) { monitor = Policy.monitorFor(monitor); + rebuildRequested = false; if (builderName == null) { IBuildContext context = new BuildContext(buildConfiguration); return basicBuild(buildConfiguration, trigger, context, monitor); |