diff options
author | 2015-12-21 09:26:43 +0000 | |
---|---|---|
committer | 2015-12-21 21:34:57 +0000 | |
commit | ef7e0457c77100577fa2d35bfd2d8b7b54c8a5ab (patch) | |
tree | e032fdb2bc1d0a207d28b9ab90dc2b08ef20ba2d /src/main/java | |
parent | fb939b5c058f0f4b9f4c354ba277f9bfee2de210 (diff) |
Open source LoadingPhaseRunnerTest and its Skyframe companion.
I had to make a small change to ExternalFilesHelper. The Bazel test setup
creates a remote repository for the tools, so we always have external files,
incl. during loading. However, some of the tests don't setup an output
directory, but instead pass null, which would lead to a crash.
--
MOS_MIGRATED_REVID=110669993
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/ExternalFilesHelper.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ExternalFilesHelper.java b/src/main/java/com/google/devtools/build/lib/skyframe/ExternalFilesHelper.java index de553d0dfb..fabe2b5fc0 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ExternalFilesHelper.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ExternalFilesHelper.java @@ -16,6 +16,7 @@ package com.google.devtools.build.lib.skyframe; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.pkgcache.PathPackageLocator; import com.google.devtools.build.lib.util.Preconditions; +import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.RootedPath; import com.google.devtools.build.skyframe.SkyFunction; @@ -81,7 +82,9 @@ public class ExternalFilesHelper { throw new FileOutsidePackageRootsException(rootedPath); } - if (!rootedPath.asPath().startsWith( + // The outputBase may be null if we're not actually running a build. + Path outputBase = pkgLocator.get().getOutputBase(); + if (outputBase != null && !rootedPath.asPath().startsWith( pkgLocator.get().getOutputBase().getRelative(Label.EXTERNAL_PATH_PREFIX))) { return; } |