aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/repository
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2018-06-18 04:35:10 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-18 04:37:11 -0700
commit2d553b5c1411ae790b929e895f947e48e05f28f9 (patch)
tree9412571094c41d051f9010359c1b653ef562afb0 /src/main/java/com/google/devtools/build/lib/rules/repository
parent4a9c3bca5da2e71003583f0a808dd8d638c80d04 (diff)
RepositoryFunction: depend on overrides, even if there is no rule
Not all bazel external repositories are generated by a rule (e.g., they might be unbound names with the expectation that on override binds them). Still, even those external repositories depend on changes to the repository override. Register this dependency. Change-Id: I900c94f969d08dec82c5776eff28337878379b5e PiperOrigin-RevId: 200974283
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/repository')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryFunction.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryFunction.java
index 565780d478..c5e6d03c29 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryFunction.java
@@ -523,6 +523,8 @@ public abstract class RepositoryFunction {
// first.
Rule rule = ExternalPackageUtil.getRuleByName(repositoryName, env);
if (rule == null) {
+ // Still an override might change the content of the repository.
+ RepositoryDelegatorFunction.REPOSITORY_OVERRIDES.get(env);
return;
}
@@ -549,7 +551,11 @@ public abstract class RepositoryFunction {
// WORKSPACE file. In that case, the call to RepositoryFunction#getRuleByName(String,
// Environment)
// already requested all repository functions from the WORKSPACE file from Skyframe as part
- // of the resolution. Therefore we are safe to ignore that Exception.
+ // of the resolution.
+ //
+ // Alternatively, the repository might still be provided by an override. Therefore, in
+ // any case, register the dependency on the repository overrides.
+ RepositoryDelegatorFunction.REPOSITORY_OVERRIDES.get(env);
return;
} catch (ExternalPackageException ex) {
// This should never happen.