Skip to content

Commit 9263e82

Browse files
sayrerclaude
andcommitted
Add explicit load() statements for native rules removed in Bazel 9.
Bazel 9 removed built-in cc_library, java_library, java_binary, py_test, sh_binary, sh_test, and objc_library from the global scope. These must now be loaded from their respective rule sets: rules_cc, rules_java, rules_python, and rules_shell. Also adds rules_shell as a dependency in MODULE.bazel. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9b324df commit 9263e82

File tree

16 files changed

+26
-2
lines changed

16 files changed

+26
-2
lines changed

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_too
3434
bazel_dep(name = "rules_java", version = "8.14.0")
3535
bazel_dep(name = "rules_jvm_external", version = "6.9")
3636
bazel_dep(name = "rules_python", version = "1.7.0")
37+
bazel_dep(name = "rules_shell", version = "0.6.1")
3738
bazel_dep(name = "rules_swift", version = "3.3.0")
3839

3940
# Fix a bug in rules_swift with hermetic toolchains

benchmark/cpp/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@rules_cc//cc:defs.bzl", "cc_binary")
2+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
23

34
cc_binary(
45
name = "cpp_benchmark",

benchmark/java/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
load("@rules_java//java:defs.bzl", "java_binary")
2+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
3+
14
package(default_visibility = ["//visibility:public"])
25

36
# JVM flags for Java FFM

benchmark/objc/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

3+
load("@rules_apple//apple:macos.bzl", "macos_command_line_application")
34
load("@rules_cc//cc:defs.bzl", "objc_library")
5+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
46
load("@rules_swift//swift:swift.bzl", "swift_library")
5-
load("@rules_apple//apple:macos.bzl", "macos_command_line_application")
67

78
# Swift helper for YAML parsing (exposes Yams to Obj-C)
89
swift_library(

benchmark/ruby/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@rules_ruby//ruby:defs.bzl", "rb_binary")
2+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
23

34
package(default_visibility = ["//visibility:public"])
45

benchmark/rust/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@rules_rust//rust:defs.bzl", "rust_binary")
2+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
23

34
package(default_visibility = ["//visibility:public"])
45

benchmark/swift/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
12
load("@rules_swift//swift:swift_binary.bzl", "swift_binary")
23

34
swift_binary(

java/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_java//java:defs.bzl", "java_library")
2+
13
package(default_visibility = ["//visibility:public"])
24

35
java_library(

rust/ffi-bindings/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3+
load("@rules_cc//cc:defs.bzl", "cc_library")
34
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_shared_library", "rust_static_library")
45
load("@rules_swift//swift:swift_interop_hint.bzl", "swift_interop_hint")
56

rust/java-bindings/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3+
load("@rules_java//java:defs.bzl", "java_library")
34
load("@rules_rust//rust:defs.bzl", "rust_shared_library")
45

56
# Rust C-ABI shared library for Java FFM

0 commit comments

Comments
 (0)