aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-08-03 14:12:01 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-08-03 14:13:24 -0700
commit1225e4ad5dff72b63953639b4c4c4281f8b46ea5 (patch)
tree2908957ca6294e2acdab1ba4da48923e61b5d5bd /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
parent395d48bd10fe5259e1f680d9852b7f53dc216e3d (diff)
When no new configured targets have been analyzed, only check for artifact conflicts if the current set of configured targets is not a subset of the largest set of configured targets that have been checked for conflicts.
Also rework the flow between SkyframeBuildView and SkyframeActionExecutor to remove the SkyframeExecutor middleman. Also reword the error message in case of an ArtifactPrefixConflictException, since a clean should no longer be necessary. PiperOrigin-RevId: 207322139
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java46
1 files changed, 7 insertions, 39 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
index 36ad359ba8..ce65b6d646 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
@@ -19,7 +19,6 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
import com.google.common.base.Stopwatch;
import com.google.common.base.Throwables;
import com.google.common.cache.Cache;
@@ -31,7 +30,6 @@ import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Iterables;
-import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.common.collect.Range;
import com.google.common.eventbus.EventBus;
@@ -113,7 +111,6 @@ import com.google.devtools.build.lib.pkgcache.TargetParsingPhaseTimeEvent;
import com.google.devtools.build.lib.pkgcache.TargetPatternEvaluator;
import com.google.devtools.build.lib.pkgcache.TestFilter;
import com.google.devtools.build.lib.pkgcache.TransitivePackageLoader;
-import com.google.devtools.build.lib.profiler.AutoProfiler;
import com.google.devtools.build.lib.profiler.Profiler;
import com.google.devtools.build.lib.profiler.SilentCloseable;
import com.google.devtools.build.lib.rules.repository.ResolvedHashesFunction;
@@ -228,7 +225,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
private final AtomicInteger numPackagesLoaded = new AtomicInteger(0);
@Nullable private final PackageProgressReceiver packageProgress;
- protected SkyframeBuildView skyframeBuildView;
+ private final SkyframeBuildView skyframeBuildView;
private ActionLogBufferPathGenerator actionLogBufferPathGenerator;
protected BuildDriver buildDriver;
@@ -387,10 +384,12 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
this.ruleClassProvider = pkgFactory.getRuleClassProvider();
this.defaultBuildOptions = defaultBuildOptions;
- this.skyframeBuildView = new SkyframeBuildView(
- directories,
- this,
- (ConfiguredRuleClassProvider) ruleClassProvider);
+ this.skyframeBuildView =
+ new SkyframeBuildView(
+ directories,
+ this,
+ (ConfiguredRuleClassProvider) ruleClassProvider,
+ skyframeActionExecutor);
this.artifactFactory = artifactResolverSupplier;
this.artifactFactory.set(skyframeBuildView.getArtifactFactory());
this.externalFilesHelper = ExternalFilesHelper.create(
@@ -1253,37 +1252,6 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
return new BuildConfigurationCollection(topLevelTargetConfigs, hostConfig);
}
- @SuppressWarnings({"unchecked", "rawtypes"})
- Map<SkyKey, ActionLookupValue> getActionLookupValueMap() {
- return (Map) Maps.filterValues(memoizingEvaluator.getDoneValues(),
- Predicates.instanceOf(ActionLookupValue.class));
- }
-
- /** A supplier that can throw {@link InterruptedException}. */
- protected interface ActionLookupValueSupplier {
- Iterable<ActionLookupValue> get() throws InterruptedException;
- }
-
- /**
- * Checks the actions in Skyframe for conflicts between their output artifacts. Delegates to
- * {@link SkyframeActionExecutor#findAndStoreArtifactConflicts} to do the work, since any
- * conflicts found will only be reported during execution.
- */
- protected ImmutableMap<ActionAnalysisMetadata, SkyframeActionExecutor.ConflictException>
- findArtifactConflicts(ActionLookupValueSupplier actionLookupValues)
- throws InterruptedException {
- if (skyframeBuildView.shouldCheckArtifactConflicts()) {
- // This operation is somewhat expensive, so we only do it if the graph might have changed in
- // some way -- either we analyzed a new target or we invalidated an old one.
- try (AutoProfiler p = AutoProfiler.logged("discovering artifact conflicts", logger)) {
- skyframeActionExecutor.findAndStoreArtifactConflicts(actionLookupValues.get());
- skyframeBuildView.resetArtifactConflictState();
- // The invalidated configured targets flag will be reset later in the evaluate() call.
- }
- }
- return skyframeActionExecutor.badActions();
- }
-
/**
* Asks the Skyframe evaluator to build the given artifacts and targets, and to test the
* given test targets.