diff options
author | cparsons <cparsons@google.com> | 2018-03-06 16:15:11 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-06 16:18:46 -0800 |
commit | e2d200f32a7242898a5c976837bd3b8e6dfed62c (patch) | |
tree | 98a6fb3b0bbe3d8438aff9206d5ff77cf19870c3 /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java | |
parent | a854d6c0d3d222bbd4ff2a532d48ddd91718908c (diff) |
Expose an actions provider on RuleConfiguredTarget instances.
Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint.
Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon.
RELNOTES: None.
PiperOrigin-RevId: 188098079
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java index 8d9c1512f2..5d9cde9c17 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java @@ -30,7 +30,6 @@ import com.google.devtools.build.lib.actions.ActionLookupValue; import com.google.devtools.build.lib.actions.ArtifactFactory; import com.google.devtools.build.lib.actions.ArtifactOwner; import com.google.devtools.build.lib.actions.ArtifactPrefixConflictException; -import com.google.devtools.build.lib.actions.MutableActionGraph; import com.google.devtools.build.lib.actions.MutableActionGraph.ActionConflictException; import com.google.devtools.build.lib.actions.PackageRoots; import com.google.devtools.build.lib.analysis.AnalysisFailureEvent; @@ -270,7 +269,7 @@ public final class SkyframeBuildView { ConflictException ex = bad.getValue(); try { ex.rethrowTyped(); - } catch (MutableActionGraph.ActionConflictException ace) { + } catch (ActionConflictException ace) { ace.reportTo(eventHandler); String errorMsg = "Analysis of target '" + bad.getKey().getOwner().getLabel() + "' failed; build aborted"; @@ -294,7 +293,7 @@ public final class SkyframeBuildView { if (topLevel.argument() instanceof ConfiguredTargetKey) { errorMsg = "Analysis of target '" - + ConfiguredTargetValue.extractLabel(topLevel) + + NonRuleConfiguredTargetValue.extractLabel(topLevel) + "' failed; build aborted"; } else if (topLevel.argument() instanceof AspectValueKey) { AspectValueKey aspectKey = (AspectValueKey) topLevel.argument(); @@ -313,7 +312,7 @@ public final class SkyframeBuildView { } boolean hasLoadingError = false; - // --keep_going : We notify the error and return a ConfiguredTargetValue + // --keep_going : We notify the error and return a NonRuleConfiguredTargetValue for (Map.Entry<SkyKey, ErrorInfo> errorEntry : result.errorMap().entrySet()) { // Only handle errors of configured targets, not errors of top-level aspects. // TODO(ulfjack): this is quadratic - if there are a lot of CTs, this could be rather slow. @@ -363,7 +362,7 @@ public final class SkyframeBuildView { ConflictException ex = bad.getValue(); try { ex.rethrowTyped(); - } catch (MutableActionGraph.ActionConflictException ace) { + } catch (ActionConflictException ace) { ace.reportTo(eventHandler); eventHandler .handle(Event.warn("errors encountered while analyzing target '" @@ -508,7 +507,7 @@ public final class SkyframeBuildView { OrderedSetMultimap<Attribute, ConfiguredTargetAndTarget> prerequisiteMap, ImmutableMap<Label, ConfigMatchingProvider> configConditions, @Nullable ToolchainContext toolchainContext) - throws InterruptedException { + throws InterruptedException, ActionConflictException { Preconditions.checkState(enableAnalysis, "Already in execution phase %s %s", target, configuration); Preconditions.checkNotNull(analysisEnvironment); |