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

Move Bash and Python runfiles libraries out of Bazel #24219

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bazel_dep(name = "rules_testing", version = "0.6.0")
bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googletest")
bazel_dep(name = "with_cfg.bzl", version = "0.6.0")
bazel_dep(name = "abseil-cpp", version = "20240722.0")
bazel_dep(name = "rules_shell", version = "0.2.0")
bazel_dep(name = "rules_shell", version = "0.3.0")

# TODO: wyv@ - use release 29.0 when that's out
# repo_name needs to be used, until WORKSPACE mode is to be supported in bazel_tools
Expand Down
3 changes: 2 additions & 1 deletion MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ filegroup(
"@rules_license//:WORKSPACE",
"@rules_pkg//:WORKSPACE",
"@rules_python//:WORKSPACE",
"@rules_shell//shell:rules_bzl",
"@rules_testing//:LICENSE",
] + select({
"//src/conditions:linux_x86_64": ["@remotejdk%s_linux//:WORKSPACE" % v for v in JDK_VERSIONS],
Expand Down
2 changes: 1 addition & 1 deletion src/MODULE.tools
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ bazel_dep(name = "protobuf", version = "29.0-rc3", repo_name = "com_google_proto
bazel_dep(name = "rules_java", version = "8.5.0")
bazel_dep(name = "rules_cc", version = "0.0.16")
bazel_dep(name = "rules_python", version = "0.40.0")
bazel_dep(name = "rules_shell", version = "0.2.0")
bazel_dep(name = "rules_shell", version = "0.3.0")
# add rules_android
# add apple_support
4 changes: 4 additions & 0 deletions src/main/java/com/google/devtools/build/lib/bazel/rules/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ gen_workspace_stanza(
protobuf_deps()
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()
load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
rules_shell_dependencies()
rules_shell_toolchains()
""",
preamble = """
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Expand All @@ -150,6 +153,7 @@ gen_workspace_stanza(
"rules_cc", # For auto-load cc rules symbols
"rules_python", # For auto-load python rules symbols
"rules_license", # for license attestations
"rules_shell", # For auto-load of shell rules symbols
],
use_maybe = 1,
visibility = ["//:__pkg__"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public SkyValue compute(SkyKey skyKey, Environment env)
keys.build(),
starlarkSemantics,
bzlLoadFunctionForInlining,
/* checkVisibility= */ true,
/* checkVisibility= */ !useWorkspaceResolvedFile,
BazelSkyframeExecutorConstants.ACTION_ON_FILESYSTEM_ERROR_CODE_LOADING_BZL_FILE);
} catch (NoSuchPackageException e) {
throw new WorkspaceFileFunctionException(e, Transience.PERSISTENT);
Expand Down
3 changes: 2 additions & 1 deletion src/test/tools/bzlmod/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions tools/bash/runfiles/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
load("@rules_shell//shell:sh_library.bzl", "sh_library")
load("@rules_shell//shell:sh_test.bzl", "sh_test")

package(default_visibility = ["//visibility:private"])

filegroup(
Expand All @@ -19,19 +16,6 @@ filegroup(
name = "embedded_tools",
srcs = [
"BUILD.tools",
"runfiles.bash",
],
visibility = ["//tools/bash:__pkg__"],
)

sh_library(
name = "runfiles_lib",
testonly = 1,
srcs = ["runfiles.bash"],
)

sh_test(
name = "runfiles_test",
srcs = ["runfiles_test.bash"],
deps = [":runfiles_lib"],
)
6 changes: 2 additions & 4 deletions tools/bash/runfiles/BUILD.tools
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
load("@rules_shell//shell:sh_library.bzl", "sh_library")

sh_library(
alias(
name = "runfiles",
srcs = ["runfiles.bash"],
actual = "@rules_shell//shell/runfiles",
visibility = ["//visibility:public"],
)
Loading