diff options
author | Lukacs Berki <lberki@google.com> | 2015-07-07 07:30:35 +0000 |
---|---|---|
committer | Lukacs Berki <lberki@google.com> | 2015-07-07 08:42:19 +0000 |
commit | 7d02845041bbd0342f9e6dca69627bff5864aa71 (patch) | |
tree | 8256ffc0d88a97c5338fee538b5a5fe59d246a8d /src/test/java/com/google/devtools/build/lib/syntax | |
parent | 69d20b26b50360221849a4860265150f9c66ef25 (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/test/java/com/google/devtools/build/lib/syntax')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/syntax/BuildFileASTTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/BuildFileASTTest.java b/src/test/java/com/google/devtools/build/lib/syntax/BuildFileASTTest.java index 84562358e4..a1b108e02b 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/BuildFileASTTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/BuildFileASTTest.java @@ -25,6 +25,7 @@ import com.google.devtools.build.lib.events.EventKind; import com.google.devtools.build.lib.events.Reporter; import com.google.devtools.build.lib.events.util.EventCollectionApparatus; import com.google.devtools.build.lib.packages.CachingPackageLocator; +import com.google.devtools.build.lib.packages.PackageIdentifier; import com.google.devtools.build.lib.testutil.JunitTestUtils; import com.google.devtools.build.lib.testutil.Scratch; import com.google.devtools.build.lib.vfs.Path; @@ -45,8 +46,8 @@ public class BuildFileASTTest { private class ScratchPathPackageLocator implements CachingPackageLocator { @Override - public Path getBuildFileForPackage(String packageName) { - return scratch.resolve(packageName).getRelative("BUILD"); + public Path getBuildFileForPackage(PackageIdentifier packageName) { + return scratch.resolve(packageName.getPackageFragment()).getRelative("BUILD"); } } @@ -264,7 +265,7 @@ public class BuildFileASTTest { private class EmptyPackageLocator implements CachingPackageLocator { @Override - public Path getBuildFileForPackage(String packageName) { + public Path getBuildFileForPackage(PackageIdentifier packageName) { return null; } } |