aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-07-08 08:11:30 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-07-08 11:42:30 +0000
commit33aa1e1afd9f0c35f8ccadcf8bf8f29357ca2878 (patch)
tree859318d2610a0dfe7bc9a3a751a020fa5a1a249e /src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java
parent9cac1635f82e85765ec6e7e859cf5e270301f892 (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=97751539
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java
index db3e7c18bb..2c8cc8e83c 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java
@@ -41,9 +41,9 @@ import javax.annotation.Nullable;
*/
class PackageLookupFunction implements SkyFunction {
- private final AtomicReference<ImmutableSet<String>> deletedPackages;
+ private final AtomicReference<ImmutableSet<PackageIdentifier>> deletedPackages;
- PackageLookupFunction(AtomicReference<ImmutableSet<String>> deletedPackages) {
+ PackageLookupFunction(AtomicReference<ImmutableSet<PackageIdentifier>> deletedPackages) {
this.deletedPackages = deletedPackages;
}
@@ -64,7 +64,7 @@ class PackageLookupFunction implements SkyFunction {
+ packageNameErrorMsg);
}
- if (deletedPackages.get().contains(packageKey.getPackageFragment().toString())) {
+ if (deletedPackages.get().contains(packageKey)) {
return PackageLookupValue.deletedPackage();
}
@@ -142,7 +142,7 @@ class PackageLookupFunction implements SkyFunction {
throws PackageLookupFunctionException {
PackageIdentifier id = (PackageIdentifier) skyKey.argument();
SkyKey repositoryKey = RepositoryValue.key(id.getRepository());
- RepositoryValue repositoryValue = null;
+ RepositoryValue repositoryValue;
try {
repositoryValue = (RepositoryValue) env.getValueOrThrow(
repositoryKey, NoSuchPackageException.class, IOException.class, EvalException.class);