Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module(

bazel_dep(name = "bazel_features", version = "1.9.1")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_cc", version = "0.0.13")
bazel_dep(name = "platforms", version = "0.0.4")

# Those are loaded only when using py_proto_library
Expand Down
287 changes: 115 additions & 172 deletions examples/bzlmod/MODULE.bazel.lock

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions internal_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,14 @@ def rules_python_internal_deps():

http_archive(
name = "rules_cc",
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
strip_prefix = "rules_cc-0.0.13",
)
# Needed by rules_cc, triggered by @rules_java_builtins from Bazel
http_archive(
name = "protobuf",
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
strip_prefix = "protobuf-27.0",
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
)
4 changes: 1 addition & 3 deletions python/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,9 @@ bzl_library(
],
)

# @rules_cc does not offer a bzl_library target for @rules_cc//cc:defs.bzl
bzl_library(
name = "rules_cc_srcs_bzl",
srcs = ["@rules_cc//cc:bzl_srcs"],
deps = [":bazel_tools_bzl"],
deps = ["@rules_cc//cc/common"],
)

# Needed to define bzl_library targets for docgen. (We don't define the
Expand Down
2 changes: 1 addition & 1 deletion python/private/common/attributes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""Attributes for Python rules."""

load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load("@rules_cc//cc:defs.bzl", "CcInfo")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load("//python/private:enum.bzl", "enum")
load("//python/private:flags.bzl", "PrecompileFlag", "PrecompileSourceRetentionFlag")
load("//python/private:py_info.bzl", "PyInfo")
Expand Down
3 changes: 2 additions & 1 deletion python/private/common/common_bazel.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"""Common functions that are specific to Bazel rule implementation"""

load("@bazel_skylib//lib:paths.bzl", "paths")
load("@rules_cc//cc:defs.bzl", "CcInfo", "cc_common")
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load("//python/private:py_interpreter_program.bzl", "PyInterpreterProgramInfo")
load("//python/private:toolchain_types.bzl", "EXEC_TOOLS_TOOLCHAIN_TYPE", "TARGET_TOOLCHAIN_TYPE")
load(":attributes.bzl", "PrecompileAttr", "PrecompileInvalidationModeAttr", "PrecompileSourceRetentionAttr")
Expand Down
2 changes: 1 addition & 1 deletion python/private/common/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
"""Providers for Python rules."""

load("@rules_cc//cc:defs.bzl", "CcInfo")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load("//python/private:util.bzl", "define_bazel_6_provider")

DEFAULT_STUB_SHEBANG = "#!/usr/bin/env python3"
Expand Down
2 changes: 1 addition & 1 deletion python/private/common/py_executable.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
load("@bazel_skylib//lib:dicts.bzl", "dicts")
load("@bazel_skylib//lib:structs.bzl", "structs")
load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load("@rules_cc//cc:defs.bzl", "cc_common")
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
load("//python/private:builders.bzl", "builders")
load("//python/private:flags.bzl", "PrecompileAddToRunfilesFlag")
load("//python/private:py_executable_info.bzl", "PyExecutableInfo")
Expand Down
2 changes: 1 addition & 1 deletion python/private/current_py_cc_headers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Implementation of current_py_cc_headers rule."""

load("@rules_cc//cc:defs.bzl", "CcInfo")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")

def _current_py_cc_headers_impl(ctx):
py_cc_toolchain = ctx.toolchains["//python/cc:toolchain_type"].py_cc_toolchain
Expand Down
2 changes: 1 addition & 1 deletion python/private/current_py_cc_libs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Implementation of current_py_cc_libs rule."""

load("@rules_cc//cc:defs.bzl", "CcInfo")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")

def _current_py_cc_libs_impl(ctx):
py_cc_toolchain = ctx.toolchains["//python/cc:toolchain_type"].py_cc_toolchain
Expand Down
3 changes: 2 additions & 1 deletion python/private/hermetic_runtime_repo_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# limitations under the License.
"""Setup a python-build-standalone based toolchain."""

load("@rules_cc//cc:defs.bzl", "cc_import", "cc_library")
load("@rules_cc//cc:cc_import.bzl", "cc_import")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("//python:py_runtime.bzl", "py_runtime")
load("//python:py_runtime_pair.bzl", "py_runtime_pair")
load("//python/cc:py_cc_toolchain.bzl", "py_cc_toolchain")
Expand Down
2 changes: 1 addition & 1 deletion python/private/local_runtime_repo_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""Setup code called by the code generated by `local_runtime_repo`."""

load("@bazel_skylib//lib:selects.bzl", "selects")
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_python//python:py_runtime.bzl", "py_runtime")
load("@rules_python//python:py_runtime_pair.bzl", "py_runtime_pair")
load("@rules_python//python/cc:py_cc_toolchain.bzl", "py_cc_toolchain")
Expand Down
2 changes: 1 addition & 1 deletion python/private/py_cc_toolchain_rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ https://github.com/bazelbuild/rules_python/issues/824 is considered done.
"""

load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load("@rules_cc//cc:defs.bzl", "CcInfo")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load(":py_cc_toolchain_info.bzl", "PyCcToolchainInfo")

def _py_cc_toolchain_impl(ctx):
Expand Down
13 changes: 10 additions & 3 deletions python/private/py_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,15 @@ def py_repositories():
)
http_archive(
name = "rules_cc",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
strip_prefix = "rules_cc-0.0.13",
)
# Needed by rules_cc, triggerred by @rules_java_prebuilt in Bazel by using @rules_cc//cc:defs.bzl
http_archive(
name = "protobuf",
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
strip_prefix = "protobuf-27.0",
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
)
pypi_deps()
2 changes: 1 addition & 1 deletion python/private/runtime_env_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
"""Definitions related to the Python toolchain."""

load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("//python:py_runtime.bzl", "py_runtime")
load("//python:py_runtime_pair.bzl", "py_runtime_pair")
load("//python/cc:py_cc_toolchain.bzl", "py_cc_toolchain")
Expand Down
2 changes: 1 addition & 1 deletion python/private/whl_filegroup/whl_filegroup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ An empty pattern will match all files.

Example usage:
```starlark
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_python//python:pip.bzl", "whl_filegroup")

whl_filegroup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Tests for current_py_cc_headers."""

load("@rules_cc//cc:defs.bzl", "CcInfo")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load("@rules_testing//lib:analysis_test.bzl", "analysis_test", "test_suite")
load("@rules_testing//lib:truth.bzl", "matching")
load("//tests/support:cc_info_subject.bzl", "cc_info_subject")
Expand Down
2 changes: 1 addition & 1 deletion tests/cc/current_py_cc_libs/current_py_cc_libs_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Tests for current_py_cc_libs."""

load("@rules_cc//cc:defs.bzl", "CcInfo")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load("@rules_testing//lib:analysis_test.bzl", "analysis_test", "test_suite")
load("@rules_testing//lib:truth.bzl", "matching")
load("//tests/support:cc_info_subject.bzl", "cc_info_subject")
Expand Down
3 changes: 2 additions & 1 deletion tests/support/cc_toolchains/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain")
load("@rules_cc//cc/toolchains:cc_toolchain_suite.bzl", "cc_toolchain_suite")
load("@rules_testing//lib:util.bzl", "PREVENT_IMPLICIT_BUILDING_TAGS")
load("//python/cc:py_cc_toolchain.bzl", "py_cc_toolchain")
load(":fake_cc_toolchain_config.bzl", "fake_cc_toolchain_config")
Expand Down
2 changes: 1 addition & 1 deletion tests/support/cc_toolchains/fake_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Fake for providing CcToolchainConfigInfo."""

load("@rules_cc//cc:defs.bzl", "cc_common")
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")

def _impl(ctx):
return cc_common.create_cc_toolchain_config_info(
Expand Down
3 changes: 2 additions & 1 deletion tests/whl_filegroup/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
load("//python:defs.bzl", "py_library", "py_test")
load("//python:packaging.bzl", "py_package", "py_wheel")
load("//python:pip.bzl", "whl_filegroup")
Expand Down