Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: look for MODULE.bazel in child repos to remove need for stub WORKSPACE #416

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bazel_integration_test/private/bazel_integration_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ _DEFAULT_ENV_INHERIT = ["SUDO_ASKPASS", "HOME", "CC"]
def _select_workspace_file_impl(ctx):
workspace_file = paths.join(ctx.attr.workspace_path, "WORKSPACE")
workspace_bazel = paths.join(ctx.attr.workspace_path, "WORKSPACE.bazel")
workspace_module = paths.join(ctx.attr.workspace_path, "MODULE.bazel")
workspace_repo = paths.join(ctx.attr.workspace_path, "REPO.bazel")
for file in ctx.attr.srcs.files.to_list():
if file.path.endswith(workspace_file) or file.path.endswith(workspace_bazel):
if file.path.endswith(workspace_file) or file.path.endswith(workspace_bazel) or file.path.endswith(workspace_module) or file.path.endswith(workspace_repo):
return [DefaultInfo(files = depset([file]))]
fail("Can't find WORKSPACE or WORKSPACE.bazel in %s" % ctx.attr.workspace_path)
fail("Can't find WORKSPACE, WORKSPACE.bazel, MODULE.bazel, nor REPO.bazel in %s" % ctx.attr.workspace_path)

select_workspace_file = rule(
implementation = _select_workspace_file_impl,
Expand Down