From d491bf10f42e213292382c98a1dc439537f00f43 Mon Sep 17 00:00:00 2001 From: janakr Date: Mon, 16 Jul 2018 16:29:51 -0700 Subject: Automated rollback of commit eb587075b0d6ffab1cf9e69ede1b7e547905e547. *** Reason for rollback *** Depot has been fixed. RELNOTES[INC]: If the same artifact is generated by two distinct but identical actions, and a downstream action has both those actions' outputs in its inputs, the artifact will now appear twice in the downstream action's inputs. If this causes problems in Skylark actions, you can use the uniquify=True argument in Args.add_args. PiperOrigin-RevId: 204827477 --- .../google/devtools/build/lib/skyframe/ArtifactFunction.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java') diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java index 3587f089b7..467391af18 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java @@ -54,11 +54,11 @@ class ArtifactFunction implements SkyFunction { @Override public SkyValue compute(SkyKey skyKey, Environment env) throws ArtifactFunctionException, InterruptedException { - ArtifactSkyKey artifactSkyKey = (ArtifactSkyKey) skyKey.argument(); - Artifact artifact = artifactSkyKey.getArtifact(); + Artifact artifact = ArtifactSkyKey.artifact(skyKey); + boolean isMandatory = ArtifactSkyKey.isMandatory(skyKey); if (artifact.isSourceArtifact()) { try { - return createSourceValue(artifact, artifactSkyKey.isMandatory(), env); + return createSourceValue(artifact, isMandatory, env); } catch (MissingInputFileException e) { // The error is not necessarily truly transient, but we mark it as such because we have // the above side effect of posting an event to the EventBus. Importantly, that event @@ -281,8 +281,7 @@ class ArtifactFunction implements SkyFunction { throws InterruptedException { // This artifact aggregates other artifacts. Keep track of them so callers can find them. ImmutableList.Builder> inputs = ImmutableList.builder(); - for (Map.Entry entry : - env.getValues(ArtifactSkyKey.mandatoryKeys(action.getInputs())).entrySet()) { + for (Map.Entry entry : env.getValues(action.getInputs()).entrySet()) { Artifact input = ArtifactSkyKey.artifact(entry.getKey()); SkyValue inputValue = entry.getValue(); if (inputValue == null) { @@ -323,7 +322,7 @@ class ArtifactFunction implements SkyFunction { @Override public String extractTag(SkyKey skyKey) { - return Label.print(((ArtifactSkyKey) skyKey.argument()).getArtifact().getOwner()); + return Label.print(ArtifactSkyKey.artifact(skyKey).getOwner()); } static ActionLookupKey getActionLookupKey(Artifact artifact) { -- cgit v1.2.3