Skip to content

Commit 5e2838e

Browse files
authored
Make protobuf codebase compatible with --incompatible_config_setting_private_default_visibility (#22745)
This is necessary to get the BCR presubmit checks to pass. PiperOrigin-RevId: 786432944
1 parent 8cddbd3 commit 5e2838e

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

ci/common.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ build --remote_download_outputs=all
4444
# running bazelisk with the --migrate flag and filtering out all flags that
4545
# default to true or are deprecated.
4646
build --incompatible_check_sharding_support
47+
build --incompatible_config_setting_private_default_visibility
4748
build --incompatible_default_to_explicit_init_py
4849
build --incompatible_disable_native_android_rules
4950
build --incompatible_disable_target_provider_fields
@@ -59,7 +60,6 @@ build --incompatible_use_cc_configure_from_rules_cc
5960

6061
# We cannot yet build successfully with the following flags:
6162
# --incompatible_check_testonly_for_output_files
62-
# --incompatible_config_setting_private_default_visibility
6363
# --incompatible_disable_starlark_host_transitions
6464
# --incompatible_disallow_struct_provider_syntax
6565
# --incompatible_no_implicit_file_export
@@ -82,4 +82,4 @@ build --verbose_failures
8282
# check.
8383
build --features=layering_check
8484

85-
build --enable_platform_specific_config
85+
build --enable_platform_specific_config

python/dist/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ selects.config_setting_group(
130130
":osx_x86_64_release",
131131
":osx_x86_64_local",
132132
],
133+
visibility = ["//python:__subpackages__"],
133134
)
134135

135136
config_setting(
@@ -157,6 +158,7 @@ selects.config_setting_group(
157158
":osx_aarch64_release",
158159
":osx_aarch64_local",
159160
],
161+
visibility = ["//python:__subpackages__"],
160162
)
161163

162164
config_setting(
@@ -189,6 +191,7 @@ selects.config_setting_group(
189191
":windows_x86_32_release",
190192
":windows_x86_32_local",
191193
],
194+
visibility = ["//python:__subpackages__"],
192195
)
193196

194197
config_setting(

ruby/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ config_setting(
2929
flag_values = {
3030
":ffi": "enabled",
3131
},
32+
visibility = ["//ruby:__subpackages__"],
3233
)
3334

3435
config_setting(
3536
name = "ffi_disabled",
3637
flag_values = {
3738
":ffi": "disabled",
3839
},
40+
visibility = ["//ruby:__subpackages__"],
3941
)
4042

4143
selects.config_setting_group(
@@ -76,6 +78,7 @@ selects.config_setting_group(
7678
":ffi_enabled",
7779
"@platforms//os:osx",
7880
],
81+
visibility = ["//ruby:__subpackages__"],
7982
)
8083

8184
selects.config_setting_group(
@@ -84,6 +87,7 @@ selects.config_setting_group(
8487
":ffi_enabled",
8588
"@platforms//os:linux",
8689
],
90+
visibility = ["//ruby:__subpackages__"],
8791
)
8892

8993
internal_copy_files(

upb/BUILD

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ exports_files(
2828
config_setting(
2929
name = "windows",
3030
constraint_values = ["@platforms//os:windows"],
31+
visibility = [
32+
"//lua:__pkg__",
33+
"//python:__pkg__",
34+
"//upb:__subpackages__",
35+
"//upb_generator:__subpackages__",
36+
],
3137
)
3238

3339
bool_flag(
@@ -39,6 +45,12 @@ bool_flag(
3945
config_setting(
4046
name = "fasttable_enabled_setting",
4147
flag_values = {"//upb:fasttable_enabled": "true"},
48+
visibility = [
49+
"//lua:__pkg__",
50+
"//python:__pkg__",
51+
"//upb:__subpackages__",
52+
"//upb_generator:__subpackages__",
53+
],
4254
)
4355

4456
upb_proto_library_copts(

0 commit comments

Comments
 (0)