Skip to content

Commit

Permalink
Fix crashing issue with WORKSPACE
Browse files Browse the repository at this point in the history
Fixes bazelbuild#24498

RELNOTES: None
PiperOrigin-RevId: 700720057
Change-Id: Ieb656821c41d5dde64c0807f2220f8b212267880
  • Loading branch information
meteorcloudy authored and copybara-github committed Nov 27, 2024
1 parent db91476 commit dbb9457
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public SkyValue compute(SkyKey skyKey, Environment env)
if (repoDirValue == null) {
return null;
}
if (!repoDirValue.repositoryExists()) {
throw new RepoFileFunctionException(
new IOException(repoDirValue.getErrorMsg()), Transience.PERSISTENT);
}
repoRoot = repoDirValue.getPath();
}
RootedPath repoFilePath =
Expand Down
4 changes: 4 additions & 0 deletions src/test/shell/bazel/workspace_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ EOF
assert_contains "bye" bazel-genfiles/external/x/out
}

function test_build_non_existing_repo() {
bazel build @blah &>$TEST_log && fail "Failure expected" || true
expect_log "Repository '@@blah' is not defined"
}

function test_path_with_spaces() {
ws="a b"
Expand Down

0 comments on commit dbb9457

Please sign in to comment.