Skip to content

Commit

Permalink
Treat missing repo boundary files as transient errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Jun 11, 2024
1 parent dc62a5f commit 4e02e81
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ public static RepositoryDirectoryValue.Builder symlinkRepoRoot(
if (!WorkspaceFileHelper.isValidRepoRoot(destination)) {
throw new RepositoryFunctionException(
new IOException("No MODULE.bazel, REPO.bazel, or WORKSPACE file found in " + destination),
Transience.PERSISTENT);
Transience.TRANSIENT);
}
return RepositoryDirectoryValue.builder().setExcludeFromVendoring(true).setPath(source);
}
Expand Down
19 changes: 19 additions & 0 deletions src/test/py/bazel/bzlmod/bazel_overrides_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,25 @@ def testCmdWorkspaceRelativeModuleOverride(self):
'Target @@ss~//:choose_me up-to-date (nothing to build)', stderr
)

def testLocalPathOverrideErrorResolved(self):
self.ScratchFile(
'MODULE.bazel',
[
'bazel_dep(name = "module")',
'local_path_override(',
' module_name = "module",',
' path = "module",',
')',
],
)
self.ScratchFile("module/BUILD")

# MODULE.bazel file is missing
stderr, _, exit_code = self.RunBazel(['build', '@module//:all'], allow_failure=True)
self.AssertNotExitCode(exit_code, 0, stderr)

self.ScratchFile("module/MODULE.bazel", ["module(name = 'module')"])
_, _, _ = self.RunBazel(['build', '@module//:all'])

if __name__ == '__main__':
absltest.main()

0 comments on commit 4e02e81

Please sign in to comment.