rework rules_cc usage

* bump to version 0.2.9
diff --git a/MODULE.bazel b/MODULE.bazel
index 6225a9a..91e39ce 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -7,7 +7,7 @@
 bazel_dep(name = "bazel_features", version = "1.36.0")
 bazel_dep(name = "bazel_skylib", version = "1.8.1")
 bazel_dep(name = "platforms", version = "1.0.0")
-bazel_dep(name = "rules_cc", version = "0.1.4")
+bazel_dep(name = "rules_cc", version = "0.2.9")
 bazel_dep(name = "rules_python", version = "1.5.1")
 
 internal_configure = use_extension("//:internal_configure.bzl", "internal_configure_extension")
diff --git a/build_defs.bzl b/build_defs.bzl
index bf740c6..6197400 100644
--- a/build_defs.bzl
+++ b/build_defs.bzl
@@ -6,6 +6,9 @@
 """Build rules for pybind11."""
 
 load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
+load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
+load("@rules_cc//cc:cc_test.bzl", "cc_test")
 
 def register_extension_info(**kwargs):
     pass
@@ -58,7 +61,7 @@
     # Mark common dependencies as required for build_cleaner.
     tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS]
 
-    native.cc_binary(
+    cc_binary(
         name = name + ".so",
         copts = copts + PYBIND_COPTS + select({
             Label("@pybind11//:msvc_compiler"): [],
@@ -106,7 +109,7 @@
     # Mark common dependencies as required for build_cleaner.
     tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS]
 
-    native.cc_library(
+    cc_library(
         name = name,
         copts = copts + PYBIND_COPTS,
         features = features + PYBIND_FEATURES,
@@ -127,7 +130,7 @@
     # Mark common dependencies as required for build_cleaner.
     tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS]
 
-    native.cc_test(
+    cc_test(
         name = name,
         copts = copts + PYBIND_COPTS,
         features = features + PYBIND_FEATURES,
diff --git a/pybind11-BUILD.bazel b/pybind11-BUILD.bazel
index a9b7c02..3a4c776 100644
--- a/pybind11-BUILD.bazel
+++ b/pybind11-BUILD.bazel
@@ -1,5 +1,5 @@
 # pybind11 - Seamless operability between C++11 and Python.
-load("@rules_cc//cc:defs.bzl", "cc_library")
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
 
 licenses(["notice"])