Skip to content

Commit

Permalink
chore: Switch to non-native rules to maintain new Bazel compatibility (
Browse files Browse the repository at this point in the history
…#58)

This is important since native aliases to these rules will be removed eventually
in newer Bazel versions.

The changeset is a result of autofixes by buildifier when bumped to v8.0.1.
  • Loading branch information
nicholasjng authored Feb 2, 2025
1 parent bb47da9 commit 8dcc1be
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/keith/pre-commit-buildifier
rev: 8.0.0
rev: 8.0.1
hooks:
- id: buildifier
- id: buildifier-lint
8 changes: 4 additions & 4 deletions build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ load(
"nb_common_opts",
"nb_sizeopts",
)
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load("@rules_python//python:py_binary.bzl", "py_binary")

NANOBIND_COPTS = nb_common_opts() + nb_sizeopts()
Expand Down Expand Up @@ -68,8 +69,7 @@ def nanobind_extension(
NANOBIND_DOMAIN = ["NB_DOMAIN={}".format(domain)]
else:
NANOBIND_DOMAIN = []

native.cc_binary(
cc_binary(
name = name + ".so",
srcs = srcs,
copts = copts + NANOBIND_COPTS,
Expand Down Expand Up @@ -107,7 +107,7 @@ def nanobind_library(
copts = [],
deps = [],
**kwargs):
native.cc_library(
cc_library(
name = name,
copts = copts + NANOBIND_COPTS,
deps = deps + NANOBIND_DEPS,
Expand Down Expand Up @@ -252,7 +252,7 @@ def nanobind_test(
copts = [],
deps = [],
**kwargs):
native.cc_test(
cc_test(
name = name,
copts = copts + NANOBIND_COPTS,
deps = deps + NANOBIND_DEPS,
Expand Down
2 changes: 2 additions & 0 deletions nanobind.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ load(
"nb_stripopts",
"py_limited_api",
)
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_python//python:defs.bzl", "py_library")

licenses(["notice"])

Expand Down
2 changes: 2 additions & 0 deletions robin_map.BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

licenses(["notice"])

package(default_visibility = ["//visibility:public"])
Expand Down

0 comments on commit 8dcc1be

Please sign in to comment.