Skip to content

Commit 23e605c

Browse files
keithrickeylev
andauthored
fix: make python_headers targets compatible with layering checks (bazel-contrib#3420)
Previously the headers from this target were available because it depends on python_headers_abi3, but that fails downstream layering_checks since the headers weren't direct. Now it re-exports the same headers as that underlying target to satisfy those checks. Inspectable with: ``` bazel cquery --output=starlark --starlark:expr 'providers(target)["@@rules_cc+//cc/private:cc_info.bzl%CcInfo"].compilation_context.direct_public_headers' @rules_python//python/cc:current_py_cc_headers ``` --------- Co-authored-by: Richard Levasseur <[email protected]> Co-authored-by: Richard Levasseur <[email protected]>
1 parent b57eba9 commit 23e605c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ END_UNRELEASED_TEMPLATE
7878
([#3085](https://github.com/bazel-contrib/rules_python/issues/3085)).
7979
* (toolchains) local toolchains now tell the `sys.abiflags` value of the
8080
underlying runtime.
81+
* (toolchains) The `python_headers` target is now compatible with
82+
layering_check.
8183
* (performance) 90% reduction in py_binary/py_test analysis phase cost.
8284
([#3381](https://github.com/bazel-contrib/rules_python/pull/3381)).
8385
* (gazelle) Fix `gazelle_python_manifest.test` so that it accesses manifest files via `runfile` path handling rather than directly ([#3397](https://github.com/bazel-contrib/rules_python/issues/3397)).

python/private/hermetic_runtime_repo_setup.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def define_hermetic_runtime_toolchain_impl(
126126
)
127127
cc_library(
128128
name = "python_headers",
129+
hdrs = [":includes"],
129130
deps = [":python_headers_abi3"] + select({
130131
"@bazel_tools//src/conditions:windows": [":interface"],
131132
"//conditions:default": [],

0 commit comments

Comments
 (0)