Skip to content

Commit

Permalink
Treat missing repo boundary files as transient errors
Browse files Browse the repository at this point in the history
Fixes bazelbuild#22687

Closes bazelbuild#22700.

PiperOrigin-RevId: 642340825
Change-Id: I96f496b309c4740ae561f69098eca54a12a574f0
  • Loading branch information
fmeum authored and Copybara-Service committed Jun 11, 2024
1 parent fe0262b commit b868a59
Show file tree
Hide file tree
Showing 2 changed files with 23 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
22 changes: 22 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,28 @@ 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 b868a59

Please sign in to comment.