diff options
author | kchodorow <kchodorow@google.com> | 2017-07-11 22:22:22 +0200 |
---|---|---|
committer | László Csomor <laszlocsomor@google.com> | 2017-07-12 08:50:25 +0200 |
commit | 63570924746274c128e80d3a43558e0d3fad3051 (patch) | |
tree | 5e08769586efd9efd87a926d47bc9770e68f2c24 /src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java | |
parent | 3e36d7a88a39d3bb3442c6c2e67c6d83cf0ae0e4 (diff) |
Automated rollback of commit 937350211dcd55a4714ec32ebbf33fffcc42cdf2.
*** Reason for rollback ***
Broke the go rules (of course)
See http://ci.bazel.io/job/rules_go/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/1044/console.
*** Original change description ***
Resolve references to @main-repo//foo to //foo
Bazel was creating an dummy external repository for @main-repo, which
doesn't work with package paths and will cause conflicts once
@main-repo//foo and //foo refer to the same path.
This adds a "soft pull" option to WorkspaceNameFunction: it can either
parse the entire WORKSPACE file to find the name or just the first section.
That way PackageLookupFunction can find the repository name without causing
a circular dependency.
This should have no ch...
***
PiperOrigin-RevId: 161572272
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.java | 15 |
1 files changed, 1 insertions, 14 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 d264cea205..c0a115ad6c 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 @@ -18,7 +18,6 @@ import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.cmdline.LabelValidator; import com.google.devtools.build.lib.cmdline.PackageIdentifier; -import com.google.devtools.build.lib.cmdline.RepositoryName; import com.google.devtools.build.lib.packages.BuildFileNotFoundException; import com.google.devtools.build.lib.packages.ErrorDeterminingRepositoryException; import com.google.devtools.build.lib.packages.NoSuchPackageException; @@ -295,20 +294,8 @@ public class PackageLookupFunction implements SkyFunction { private PackageLookupValue computeExternalPackageLookupValue( SkyKey skyKey, Environment env, PackageIdentifier packageIdentifier) throws PackageLookupFunctionException, InterruptedException { - // Check if this is the main repository. PackageIdentifier id = (PackageIdentifier) skyKey.argument(); - RepositoryName repositoryName = id.getRepository(); - WorkspaceNameValue workspaceNameValue = (WorkspaceNameValue) - env.getValue(WorkspaceNameValue.firstChunk()); - if (workspaceNameValue == null) { - return null; - } - if (repositoryName.strippedName().equals(workspaceNameValue.getName())) { - return (PackageLookupValue) env.getValue(PackageLookupValue.key( - PackageIdentifier.createInMainRepo(id.getPackageFragment()))); - } - // Otherwise look up the repository. - SkyKey repositoryKey = RepositoryValue.key(repositoryName); + SkyKey repositoryKey = RepositoryValue.key(id.getRepository()); RepositoryValue repositoryValue; try { repositoryValue = (RepositoryValue) env.getValueOrThrow( |