Skip to content

Commit 8a41be9

Browse files
joelebacopybara-github
authored andcommitted
Check for the nullness of AspectValue.
This should have been included in unknown commit (which added the same check for text output). FIXES #15716. PiperOrigin-RevId: 525434548 Change-Id: I5fc80fa1f81ccf5f7b0d8b5d826d8418e2239306
1 parent 6adbbc9 commit 8a41be9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/main/java/com/google/devtools/build/lib/query2/aquery/ConfiguredTargetValueAccessor.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import com.google.devtools.build.skyframe.SkyFunctionName;
3838
import com.google.devtools.build.skyframe.SkyKey;
3939
import com.google.devtools.build.skyframe.WalkableGraph;
40-
import java.util.Collection;
4140
import java.util.HashSet;
4241
import java.util.List;
4342
import java.util.Set;
@@ -162,8 +161,8 @@ private Target getTargetFromConfiguredTargetValue(
162161
}
163162

164163
/** Returns the AspectValues that are attached to the given configuredTarget. */
165-
public Collection<AspectValue> getAspectValues(
166-
KeyedConfiguredTargetValue keyedConfiguredTargetValue) throws InterruptedException {
164+
public Set<AspectValue> getAspectValues(KeyedConfiguredTargetValue keyedConfiguredTargetValue)
165+
throws InterruptedException {
167166
Set<AspectValue> result = new HashSet<>();
168167
SkyKey skyKey = configuredTargetKeyExtractor.extractKey(keyedConfiguredTargetValue);
169168
Iterable<SkyKey> revDeps =

src/main/java/com/google/devtools/build/lib/skyframe/actiongraph/v2/ActionGraphDump.java

+11-2
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,18 @@ private void dumpSingleAction(ConfiguredTarget configuredTarget, ActionAnalysisM
285285
aqueryOutputHandler.outputAction(actionBuilder.build());
286286
}
287287

288-
public void dumpAspect(AspectValue aspectValue, ConfiguredTargetValue configuredTargetValue)
289-
throws CommandLineExpansionException, InterruptedException, IOException,
288+
public void dumpAspect(
289+
@Nullable AspectValue aspectValue, ConfiguredTargetValue configuredTargetValue)
290+
throws CommandLineExpansionException,
291+
InterruptedException,
292+
IOException,
290293
TemplateExpansionException {
294+
// It's possible for a value from a previous build on the same server to be missing
295+
// e.g. after having cleared the analysis cache.
296+
if (aspectValue == null) {
297+
return;
298+
}
299+
291300
ConfiguredTarget configuredTarget = configuredTargetValue.getConfiguredTarget();
292301
if (!includeInActionGraph(configuredTarget.getLabel().toString())) {
293302
return;

0 commit comments

Comments
 (0)