Skip to content
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
50 changes: 49 additions & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ buildifier: latest

matrix:
platform:
- rockylinux8
- debian10
- ubuntu2004
- ubuntu2004_arm64
- macos
- macos_arm64
- windows
bazel:
- 6.x
- 7.x
- 8.x
- 9.x

tasks:
test_module_bzlmod:
Expand Down Expand Up @@ -47,3 +51,47 @@ tasks:
- "//..."
test_targets:
- "//..."

test_module_bzlmod_shell_runfiles:
name: "Test module (Bzlmod + Shell Runfiles)"
working_directory: "tests/bcr"
bazel: ${{ bazel }}
platform: ${{ platform }}
build_flags:
- "--enable_bzlmod"
- "--@rules_shell//shell/settings:experimental_use_shell_runfiles=True"
build_targets:
- "//..."
test_flags:
- "--enable_bzlmod"
- "--@rules_shell//shell/settings:experimental_use_shell_runfiles=True"
test_targets:
- "//..."
test_module_workspace_shell_runfiles:
name: "Test module (WORKSPACE + Shell Runfiles)"
working_directory: "tests/bcr"
bazel: ${{ bazel }}
platform: ${{ platform }}
build_flags:
- "--enable_bzlmod"
- "--@rules_shell//shell/settings:experimental_use_shell_runfiles=True"
build_targets:
- "//..."
test_flags:
- "--enable_bzlmod"
- "--@rules_shell//shell/settings:experimental_use_shell_runfiles=True"
test_targets:
- "//..."
test_module_head_shell_runfiles:
name: "Test module (Bazel@HEAD, Bzlmod + Shell Runfiles)"
working_directory: "tests/bcr"
bazel: last_green
platform: ${{ platform }}
build_flags:
- "--@rules_shell//shell/settings:experimental_use_shell_runfiles=True"
build_targets:
- "//..."
test_flags:
- "--@rules_shell//shell/settings:experimental_use_shell_runfiles=True"
test_targets:
- "//..."
3 changes: 2 additions & 1 deletion .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ bcr_test_module:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
bazel: [6.x, 7.x, 8.x]
bazel: [7.x, 8.x, 9.x]
tasks:
run_test_module:
name: Run test module
Expand Down
47 changes: 45 additions & 2 deletions shell/runfiles/BUILD
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
load("//shell:sh_library.bzl", "sh_library")
load("//shell/private:root_symlinks.bzl", "ROOT_SYMLINKS_SUPPORTED", "root_symlinks")

config_setting(
name = "use_shell_runfiles",
flag_values = {"//shell/settings:experimental_use_shell_runfiles": "true"},
)

alias(
name = "runfiles",
actual = ":runfiles_impl" if ROOT_SYMLINKS_SUPPORTED else "@bazel_tools//tools/bash/runfiles",
actual = select({
":use_shell_runfiles": ":runfiles_sh_impl",
"//conditions:default": ":runfiles_impl" if ROOT_SYMLINKS_SUPPORTED else "@bazel_tools//tools/bash/runfiles",
}),
visibility = ["//visibility:public"],
)

sh_library(
name = "runfiles_impl",
data = [":runfiles_at_legacy_location"],
tags = ["manual"],
visibility = ["//visibility:public"],
deps = [":runfiles_bash"],
)

sh_library(
name = "runfiles_bash",
srcs = ["runfiles.bash"],
tags = ["manual"],
visibility = ["//visibility:public"],
)

root_symlinks(
Expand All @@ -21,7 +38,33 @@ root_symlinks(
tags = ["manual"],
)

sh_library(
name = "runfiles_sh_impl",
data = [":runfiles_sh_at_legacy_location"],
tags = ["manual"],
visibility = ["//visibility:public"],
deps = [":runfiles_sh"],
)

sh_library(
name = "runfiles_sh",
srcs = ["runfiles.sh"],
tags = ["manual"],
visibility = ["//visibility:public"],
)

root_symlinks(
name = "runfiles_sh_at_legacy_location",
root_symlinks = {
"runfiles.sh": "bazel_tools/tools/bash/runfiles/runfiles.bash",
},
tags = ["manual"],
)

exports_files(
["runfiles.bash"],
[
"runfiles.bash",
"runfiles.sh",
],
visibility = ["//tests/runfiles:__pkg__"],
)
Loading