Skip to content

Commit dc9d99f

Browse files
authored
Provide Bazel 8 compatibility (#169)
In order to use Bazel 8 following changes are needed: * empty `globs` are marked `allow_empty` * `+` instead of `~` as `bzl_mod` path seperator (backwards compatibility to Bazel 7 can be achieved using `--incompatible_use_plus_in_repo_names`) Tested in - [x] starling-core (Bazel 6) - [x] starling-core (Bazel 7) - [x] starling-core (Bazel 8)
1 parent b50717a commit dc9d99f

23 files changed

+26
-25
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
module(
1212
name = "rules_swiftnav",
13-
version = "0.2.0",
13+
version = "0.3.0",
1414
compatibility_level = 1,
1515
)
1616

cc/toolchains/gcc_arm_embedded/wrappers/wrapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tool_name=$(basename "${BASH_SOURCE[0]}")
3737
# In case the tool label is changed, a change in here is very likely needed
3838
# This establishes backwards compatibility with the old WORKSPACE file
3939
toolchain_bindir=external/x86_64_linux_gcc_arm_embedded_toolchain/bin
40-
toolchain_bindir_as_bzlmod="external/rules_swiftnav~~swift_cc_toolchain_extension~x86_64_linux_gcc_arm_embedded_toolchain/bin"
40+
toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+x86_64_linux_gcc_arm_embedded_toolchain/bin"
4141

4242
if [[ -f "${toolchain_bindir}"/"${tool_name}" ]]; then
4343
# We're running under _execroot_, call the real tool.

cc/toolchains/gcc_arm_gnu_8_3/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ filegroup(
8686
config(
8787
name = "config",
8888
sysroot = select({
89-
"@rules_swiftnav//cc:_enable_bzlmod": "external/rules_swiftnav~~swift_cc_toolchain_extension~gcc_arm_gnu_8_3_toolchain/aarch64-linux-gnu/libc",
89+
"@rules_swiftnav//cc:_enable_bzlmod": "external/rules_swiftnav++swift_cc_toolchain_extension+gcc_arm_gnu_8_3_toolchain/aarch64-linux-gnu/libc",
9090
"//conditions:default": "external/gcc_arm_gnu_8_3_toolchain/aarch64-linux-gnu/libc",
9191
}),
9292
)

cc/toolchains/gcc_arm_gnu_8_3/wrappers/wrapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tool_name=$(basename "${BASH_SOURCE[0]}")
3737
# In case the tool label is changed, a change in here is very likely needed
3838
# This establishes backwards compatibility with the old WORKSPACE file
3939
toolchain_bindir=external/gcc_arm_gnu_8_3_toolchain/bin
40-
toolchain_bindir_as_bzlmod="external/rules_swiftnav~~swift_cc_toolchain_extension~gcc_arm_gnu_8_3_toolchain/bin"
40+
toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+gcc_arm_gnu_8_3_toolchain/bin"
4141

4242
if [[ -f "${toolchain_bindir}"/"${tool_name}" ]]; then
4343
# We're running under _execroot_, call the real tool.

cc/toolchains/llvm/aarch64-darwin/wrappers/wrapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tool_name=$(basename "${BASH_SOURCE[0]}")
3737
# In case the tool label is changed, a change in here is very likely needed
3838
# This establishes backwards compatibility with the old WORKSPACE file
3939
toolchain_bindir=external/aarch64-darwin-llvm/bin
40-
toolchain_bindir_as_bzlmod="external/rules_swiftnav~~swift_cc_toolchain_extension~aarch64-darwin-llvm/bin"
40+
toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+aarch64-darwin-llvm/bin"
4141

4242
if [[ -f "${toolchain_bindir}"/"${tool_name}" ]]; then
4343
# We're running under _execroot_, call the real tool.

cc/toolchains/llvm/llvm.BUILD.bzl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports_files(glob([
1515
"bin/*",
1616
"lib/*",
1717
"include/*",
18-
]))
18+
], allow_empty = True))
1919

2020
## LLVM toolchain files
2121

@@ -36,7 +36,7 @@ filegroup(
3636
"bin/ld.lld",
3737
# Required on mac
3838
"bin/ld64.lld",
39-
]),
39+
], allow_empty = True),
4040
)
4141

4242
filegroup(
@@ -49,7 +49,7 @@ filegroup(
4949

5050
filegroup(
5151
name = "bin",
52-
srcs = glob(["bin/**"]),
52+
srcs = glob(["bin/**"], allow_empty = True),
5353
)
5454

5555
filegroup(
@@ -66,6 +66,7 @@ filegroup(
6666
"lib/libclang*.a",
6767
"lib/liblld*.a",
6868
],
69+
allow_empty = True,
6970
),
7071
# Do not include the .dylib files in the linker sandbox because they will
7172
# not be available at runtime. Any library linked from the toolchain should

cc/toolchains/llvm/x86_64-linux/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ cc_toolchain_config(
118118
builtin_sysroot = select({
119119
"@rules_swiftnav//cc:_use_libcpp": None,
120120
# Remove once bzlmod is enabled by default
121-
"@rules_swiftnav//cc:_enable_bzlmod": "external/rules_swiftnav~~swift_cc_toolchain_extension~x86_64-sysroot",
121+
"@rules_swiftnav//cc:_enable_bzlmod": "external/rules_swiftnav++swift_cc_toolchain_extension+x86_64-sysroot",
122122
"//conditions:default": "external/x86_64-sysroot",
123123
}),
124124
compiler = "clang",

cc/toolchains/llvm/x86_64-linux/wrappers/wrapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tool_name=$(basename "${BASH_SOURCE[0]}")
3737
# In case the tool label is changed, a change in here is very likely needed
3838
# This establishes backwards compatibility with the old WORKSPACE file
3939
toolchain_bindir=external/x86_64-linux-llvm/bin
40-
toolchain_bindir_as_bzlmod="external/rules_swiftnav~~swift_cc_toolchain_extension~x86_64-linux-llvm/bin"
40+
toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+x86_64-linux-llvm/bin"
4141

4242
if [[ -f "${toolchain_bindir}"/"${tool_name}" ]]; then
4343
# We're running under _execroot_, call the real tool.

cc/toolchains/llvm_x86_64_windows/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ filegroup(
9191
config(
9292
name = "config",
9393
sysroot = select({
94-
"@rules_swiftnav//cc:_enable_bzlmod": "external/rules_swiftnav~~swift_cc_toolchain_extension~llvm_mingw_toolchain",
94+
"@rules_swiftnav//cc:_enable_bzlmod": "external/rules_swiftnav++swift_cc_toolchain_extension+llvm_mingw_toolchain",
9595
"//conditions:default": "external/llvm_mingw_toolchain",
9696
}),
9797
)

cc/toolchains/llvm_x86_64_windows/wrappers/wrappers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tool_name=$(basename "${BASH_SOURCE[0]}")
3737
# In case the tool label is changed, a change in here is very likely needed
3838
# This establishes backwards compatibility with the old WORKSPACE file
3939
toolchain_bindir=external/llvm_mingw_toolchain/bin
40-
toolchain_bindir_as_bzlmod="external/rules_swiftnav~~swift_cc_toolchain_extension~llvm_mingw_toolchain/bin"
40+
toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+llvm_mingw_toolchain/bin"
4141

4242
if [[ -f "${toolchain_bindir}"/"${tool_name}" ]]; then
4343
# We're running under _execroot_, call the real tool.

0 commit comments

Comments
 (0)