aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/EnvironmentBackedRecursivePackageProvider.java5
-rwxr-xr-xsrc/test/shell/bazel/external_correctness_test.sh5
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/EnvironmentBackedRecursivePackageProvider.java b/src/main/java/com/google/devtools/build/lib/skyframe/EnvironmentBackedRecursivePackageProvider.java
index 285c45fa1c..9dc0b1c3f0 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/EnvironmentBackedRecursivePackageProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/EnvironmentBackedRecursivePackageProvider.java
@@ -146,9 +146,8 @@ public final class EnvironmentBackedRecursivePackageProvider implements Recursiv
}
if (!repositoryValue.repositoryExists()) {
- // This shouldn't be possible; we're given a repository, so we assume that the caller has
- // already checked for its existence.
- throw new IllegalStateException(String.format("No such repository '%s'", repository));
+ eventHandler.handle(Event.error(String.format("No such repository '%s'", repository)));
+ return ImmutableList.of();
}
roots.add(repositoryValue.getPath());
}
diff --git a/src/test/shell/bazel/external_correctness_test.sh b/src/test/shell/bazel/external_correctness_test.sh
index 5dd6ca15c9..d497aa9e05 100755
--- a/src/test/shell/bazel/external_correctness_test.sh
+++ b/src/test/shell/bazel/external_correctness_test.sh
@@ -331,4 +331,9 @@ function test_top_level_dir_changes_nobatch() {
top_level_dir_changes_helper --nobatch
}
+function test_non_extsietnt_repo_in_pattern() {
+ bazel build @non_existent_repo//... &> $TEST_log && fail "Expected build to fail"
+ expect_log "ERROR: No such repository '@non_existent_repo'"
+}
+
run_suite "//external correctness tests"