aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-07-07 07:30:35 +0000
committerGravatar Lukacs Berki <lberki@google.com>2015-07-07 08:42:19 +0000
commit7d02845041bbd0342f9e6dca69627bff5864aa71 (patch)
tree8256ffc0d88a97c5338fee538b5a5fe59d246a8d /src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java
parent69d20b26b50360221849a4860265150f9c66ef25 (diff)
Make globs work in remote repositories.
This involved quite a few changes, mainly changing a bunch of places where we refer to packages by a PathFragment to PackageIdentifier. The only wart is the code in PathPackageLocator: ideally, it would just call into PackageLookupFunction. Unfortunately, it is (through globbing and Parser.include) called from within a Skyframe function, and we don't want to have two eval() calls going on at the same time, so we cannot use that. There is a potential correctness issue there: PathPackageLocator now assumes where external repositories are put and assumes that they are there when it gets control, but my understanding is that the associated RepositoryValue is always evaluated before, so it works out okay. -- MOS_MIGRATED_REVID=97647787
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java
index d1ee81cb07..942a201770 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java
@@ -18,6 +18,7 @@ import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
+import com.google.devtools.build.lib.packages.PackageIdentifier;
import com.google.devtools.build.lib.vfs.Dirent;
import com.google.devtools.build.lib.vfs.Dirent.Type;
import com.google.devtools.build.lib.vfs.PathFragment;
@@ -60,8 +61,9 @@ final class GlobFunction implements SkyFunction {
PathFragment globSubdir = glob.getSubdir();
if (!globSubdir.equals(PathFragment.EMPTY_FRAGMENT)) {
PackageLookupValue globSubdirPkgLookupValue = (PackageLookupValue) env.getValue(
- PackageLookupValue.key(glob.getPackageId().getPackageFragment()
- .getRelative(globSubdir)));
+ PackageLookupValue.key(new PackageIdentifier(
+ glob.getPackageId().getRepository(),
+ glob.getPackageId().getPackageFragment().getRelative(globSubdir))));
if (globSubdirPkgLookupValue == null) {
return null;
}
@@ -220,7 +222,8 @@ final class GlobFunction implements SkyFunction {
PathFragment directory = glob.getPackageId().getPackageFragment()
.getRelative(glob.getSubdir()).getRelative(fileName);
PackageLookupValue pkgLookupValue = (PackageLookupValue)
- env.getValue(PackageLookupValue.key(directory));
+ env.getValue(PackageLookupValue.key(new PackageIdentifier(
+ glob.getPackageId().getRepository(), directory)));
if (pkgLookupValue == null) {
return;
}