Plumbs ActionExecutionContext into AbstractAction.checkOutputsForDirectories. PiperOrigin-RevId: 192628723
diff --git a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java index 626b873..7012f64 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java +++ b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
@@ -479,20 +479,23 @@ return true; } - /** - * If the action might create directories as outputs this method must be called. - */ - protected void checkOutputsForDirectories(EventHandler eventHandler) { + /** If the action might create directories as outputs this method must be called. */ + protected void checkOutputsForDirectories(ActionExecutionContext actionExecutionContext) { for (Artifact output : getOutputs()) { - Path path = output.getPath(); + Path path = actionExecutionContext.getInputPath(output); String ownerString = Label.print(getOwner().getLabel()); if (path.isDirectory()) { - eventHandler.handle( - Event.warn( - getOwner().getLocation(), - "output '" + output.prettyPrint() + "' of " + ownerString - + " is a directory; dependency checking of directories is unsound") - .withTag(ownerString)); + actionExecutionContext + .getEventHandler() + .handle( + Event.warn( + getOwner().getLocation(), + "output '" + + output.prettyPrint() + + "' of " + + ownerString + + " is a directory; dependency checking of directories is unsound") + .withTag(ownerString)); } } }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleAction.java b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleAction.java index 87cd33b..ec9bcc9 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleAction.java
@@ -80,7 +80,7 @@ } catch (CommandLineExpansionException e) { throw new AssertionError("GenRuleAction command line expansion cannot fail"); } - checkOutputsForDirectories(reporter); + checkOutputsForDirectories(actionExecutionContext); return spawnResults; } }