Skip to content

Commit 4e12f94

Browse files
committed
fix error about headers_abi3 not being defined identified by real usages
1 parent 0dd687f commit 4e12f94

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

python/private/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ filegroup(
3131
name = "distribution",
3232
srcs = glob(["**"]) + [
3333
"//python/private/api:distribution",
34+
"//python/private/cc:distribution",
3435
"//python/private/pypi:distribution",
3536
"//python/private/whl_filegroup:distribution",
3637
"//tools/build_defs/python/private:distribution",

python/private/cc/BUILD.bazel

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
load("//python/private:visibility.bzl", "NOT_ACTUALLY_PUBLIC")
3+
4+
package(
5+
default_visibility = ["//:__subpackages__"],
6+
)
7+
8+
licenses(["notice"])
9+
10+
filegroup(
11+
name = "distribution",
12+
srcs = glob(["**"]),
13+
)
14+
15+
# An empty cc target for use when a cc target is needed to satisfy
16+
# Bazel, but its contents don't matter.
17+
cc_library(
18+
name = "empty",
19+
visibility = NOT_ACTUALLY_PUBLIC,
20+
)

python/private/py_cc_toolchain_rule.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ The {obj}`features.headers_abi3` attribute can be used to detect if this
8383
attribute is available or not.
8484
:::
8585
""",
86+
default = "//python/private/cc:empty",
8687
providers = [CcInfo],
8788
),
8889
"libs": attr.label(

python/private/visibility.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Shared code for use with visibility specs."""
2+
3+
# Use when a target isn't actually public, but needs public
4+
# visibility to keep Bazel happy.
5+
# Such cases are typically for defaults of rule attributes or macro args that
6+
# get used outside of rules_python itself.
7+
NOT_ACTUALLY_PUBLIC = ["//visibility:public"]

0 commit comments

Comments
 (0)