diff options
author | 2017-01-12 21:52:11 +0000 | |
---|---|---|
committer | 2017-01-13 10:57:59 +0000 | |
commit | 98b19e41daf02573c08cb2e02d3a59879cd1e09a (patch) | |
tree | a38ba87e9d194636ad2e77ebfe5d59001624f7ed /src/main/java/com/google | |
parent | 1c52600069dbfb88ae695b01034412b1e76a2699 (diff) |
Log if dangling symlink is found. This is an odd choice of thing to log, but shouldn't come up very often, except in the linked bug.
--
PiperOrigin-RevId: 144367142
MOS_MIGRATED_REVID=144367142
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java index 7bee93bcfd..5c05596fc7 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java @@ -92,6 +92,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.FutureTask; import java.util.concurrent.atomic.AtomicReference; +import java.util.logging.Logger; import javax.annotation.Nullable; /** @@ -99,6 +100,8 @@ import javax.annotation.Nullable; * all output artifacts were created, error reporting, etc. */ public final class SkyframeActionExecutor implements ActionExecutionContextFactory { + private static final Logger logger = Logger.getLogger(SkyframeActionExecutor.class.getName()); + private Reporter reporter; private final AtomicReference<EventBus> eventBus; private final ResourceManager resourceManager; @@ -874,23 +877,22 @@ public final class SkyframeActionExecutor implements ActionExecutionContextFacto } /** - * For each of the action's outputs that is a regular file (not a symbolic - * link or directory), make it read-only and executable. + * For each of the action's outputs that is a regular file (not a symbolic link or directory), + * make it read-only and executable. * - * <p>Making the outputs read-only helps preventing accidental editing of - * them (e.g. in case of generated source code), while making them executable - * helps running generated files (such as generated shell scripts) on the - * command line. + * <p>Making the outputs read-only helps preventing accidental editing of them (e.g. in case of + * generated source code), while making them executable helps running generated files (such as + * generated shell scripts) on the command line. * * <p>May execute in a worker thread. * - * <p>Note: setting these bits maintains transparency regarding the locality of the build; - * because the remote execution engine sets them, they should be set for local builds too. + * <p>Note: setting these bits maintains transparency regarding the locality of the build; because + * the remote execution engine sets them, they should be set for local builds too. * * @throws IOException if an I/O error occurred. */ - private final void setOutputsReadOnlyAndExecutable(Action action, MetadataHandler metadataHandler) - throws IOException { + private static void setOutputsReadOnlyAndExecutable( + Action action, MetadataHandler metadataHandler) throws IOException { Preconditions.checkState(!action.getActionType().isMiddleman()); for (Artifact output : action.getOutputs()) { @@ -905,13 +907,14 @@ public final class SkyframeActionExecutor implements ActionExecutionContextFacto } } - private void reportMissingOutputFile(Action action, Artifact output, Reporter reporter, - boolean isSymlink) { + private static void reportMissingOutputFile( + Action action, Artifact output, Reporter reporter, boolean isSymlink) { boolean genrule = action.getMnemonic().equals("Genrule"); String prefix = (genrule ? "declared output '" : "output '") + output.prettyPrint() + "' "; if (isSymlink) { - reporter.handle(Event.error( - action.getOwner().getLocation(), prefix + "is a dangling symbolic link")); + String msg = prefix + "is a dangling symbolic link"; + logger.warning(msg); + reporter.handle(Event.error(action.getOwner().getLocation(), msg)); } else { String suffix = genrule ? " by genrule. This is probably " + "because the genrule actually didn't create this output, or because the output was a " @@ -922,8 +925,8 @@ public final class SkyframeActionExecutor implements ActionExecutionContextFacto } } - private void reportOutputTreeArtifactErrors(Action action, Artifact output, Reporter reporter, - IOException e) { + private static void reportOutputTreeArtifactErrors( + Action action, Artifact output, Reporter reporter, IOException e) { String errorMessage; if (e instanceof FileNotFoundException) { errorMessage = String.format("TreeArtifact %s was not created", output.prettyPrint()); |