From 83ec410d3005e850d5a8ef79e389b71ab7eebce6 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Tue, 26 Mar 2024 18:50:37 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 619377672 --- bazel/BUILD | 2 +- bazel/py_proto_library.bzl | 3 ++- bazel/upb_proto_library_internal/aspect.bzl | 2 +- benchmarks/BUILD | 9 ++++----- build_defs/java_opts.bzl | 2 +- .../Google.Protobuf.Conformance/BUILD.bazel | 2 +- java/kotlin/BUILD.bazel | 2 +- java/util/BUILD.bazel | 2 +- objectivec/BUILD.bazel | 2 +- protobuf_release.bzl | 2 +- protos/bazel/upb_cc_proto_library.bzl | 2 +- protos_generator/tests/BUILD | 8 ++++---- python/BUILD.bazel | 4 ++-- python/dist/BUILD.bazel | 2 +- python/pb_unit_tests/BUILD | 4 ++-- ruby/BUILD.bazel | 4 ++-- rust/BUILD | 2 +- rust/aspects.bzl | 3 ++- rust/test/BUILD | 2 +- .../rust_proto_library_unit_test.bzl | 2 +- src/google/protobuf/editions/BUILD | 8 ++++---- toolchain/BUILD.bazel | 2 +- upb/BUILD | 2 +- upb/reflection/BUILD | 14 +++++++------- upb_generator/bootstrap_compiler.bzl | 18 +++++++++--------- 25 files changed, 53 insertions(+), 52 deletions(-) diff --git a/bazel/BUILD b/bazel/BUILD index 90d578fd50..3535db9494 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -5,9 +5,9 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("@rules_python//python:defs.bzl", "py_binary") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@bazel_skylib//lib:selects.bzl", "selects") +load("@rules_python//python:defs.bzl", "py_binary") # begin:google_only # package(default_applicable_licenses = ["//upb:license"]) diff --git a/bazel/py_proto_library.bzl b/bazel/py_proto_library.bzl index f7328ca3c1..2192230fa9 100644 --- a/bazel/py_proto_library.bzl +++ b/bazel/py_proto_library.bzl @@ -15,13 +15,14 @@ But it hasn't been deeply tested or reviewed, and upb should not be in the business of vending py_proto_library(), so we keep it private to upb. """ -load("@rules_python//python:py_info.bzl", "PyInfo") load("@bazel_skylib//lib:paths.bzl", "paths") # begin:github_only load("@rules_proto//proto:defs.bzl", "ProtoInfo") # end:github_only +load("@rules_python//python:py_info.bzl", "PyInfo") + # Generic support code ######################################################### # begin:github_only diff --git a/bazel/upb_proto_library_internal/aspect.bzl b/bazel/upb_proto_library_internal/aspect.bzl index 9b929bd559..e46beaa58c 100644 --- a/bazel/upb_proto_library_internal/aspect.bzl +++ b/bazel/upb_proto_library_internal/aspect.bzl @@ -1,8 +1,8 @@ """Implementation of the aspect that powers the upb_*_proto_library() rules.""" +load("@rules_proto//proto:defs.bzl", "proto_common") load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "cc_library_func") load("//bazel:upb_proto_library_internal/copts.bzl", "UpbProtoLibraryCoptsInfo") -load("@rules_proto//proto:defs.bzl", "proto_common") # begin:github_only _is_google3 = False diff --git a/benchmarks/BUILD b/benchmarks/BUILD index 8c310a69bf..a526b0f0cf 100644 --- a/benchmarks/BUILD +++ b/benchmarks/BUILD @@ -5,17 +5,16 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd +# begin:google_only +# load("@rules_cc//cc:defs.bzl", "cc_proto_library") +# end:google_only + load("@rules_python//python:defs.bzl", "py_binary") load( "//bazel:upb_proto_library.bzl", "upb_c_proto_library", "upb_proto_reflection_library", ) - -# begin:google_only -# load("@rules_cc//cc:defs.bzl", "cc_proto_library") -# end:google_only - load( ":build_defs.bzl", "cc_optimizefor_proto_library", diff --git a/build_defs/java_opts.bzl b/build_defs/java_opts.bzl index 2da4e5f6d4..b92aff6bdf 100644 --- a/build_defs/java_opts.bzl +++ b/build_defs/java_opts.bzl @@ -2,8 +2,8 @@ load("@rules_java//java:defs.bzl", "java_library") load("@rules_jvm_external//:defs.bzl", "java_export") -load("//java/osgi:osgi.bzl", "osgi_java_library") load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION") +load("//java/osgi:osgi.bzl", "osgi_java_library") JAVA_OPTS = [ "-source 8", diff --git a/csharp/src/Google.Protobuf.Conformance/BUILD.bazel b/csharp/src/Google.Protobuf.Conformance/BUILD.bazel index 1d9b834ab4..972ca7348c 100644 --- a/csharp/src/Google.Protobuf.Conformance/BUILD.bazel +++ b/csharp/src/Google.Protobuf.Conformance/BUILD.bazel @@ -1,5 +1,5 @@ -load("//build_defs:internal_shell.bzl", "inline_sh_binary") load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") +load("//build_defs:internal_shell.bzl", "inline_sh_binary") inline_sh_binary( name = "build_conformance_test", diff --git a/java/kotlin/BUILD.bazel b/java/kotlin/BUILD.bazel index 804f9bd690..babdc464f8 100644 --- a/java/kotlin/BUILD.bazel +++ b/java/kotlin/BUILD.bazel @@ -3,8 +3,8 @@ load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_jvm_external//:kt_defs.bzl", "kt_jvm_export") load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") -load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION") load("//:protobuf.bzl", "internal_gen_kt_protos") +load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION") exports_files([ "src/test/kotlin/com/google/protobuf/Proto3Test.kt", diff --git a/java/util/BUILD.bazel b/java/util/BUILD.bazel index 20e057ad81..24d2c7f2ee 100644 --- a/java/util/BUILD.bazel +++ b/java/util/BUILD.bazel @@ -1,8 +1,8 @@ load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") -load("//build_defs:java_opts.bzl", "protobuf_java_export", "protobuf_versioned_java_library") load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION") +load("//build_defs:java_opts.bzl", "protobuf_java_export", "protobuf_versioned_java_library") load("//java/internal:testing.bzl", "junit_tests") java_library( diff --git a/objectivec/BUILD.bazel b/objectivec/BUILD.bazel index 9cc5ddee98..4aa4b20030 100644 --- a/objectivec/BUILD.bazel +++ b/objectivec/BUILD.bazel @@ -1,7 +1,7 @@ load("@rules_cc//cc:defs.bzl", "objc_library") load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") -load("//upb/cmake:build_defs.bzl", "staleness_test") load("//conformance:defs.bzl", "conformance_test") +load("//upb/cmake:build_defs.bzl", "staleness_test") load(":defs.bzl", "objc_proto_camel_case_name") # The WKTs have to be checked in to support the CocoaPods and Xcode builds. This diff --git a/protobuf_release.bzl b/protobuf_release.bzl index 9bec43a27f..67184e24c3 100644 --- a/protobuf_release.bzl +++ b/protobuf_release.bzl @@ -2,8 +2,8 @@ Generates package naming variables for use with rules_pkg. """ -load("@rules_pkg//pkg:providers.bzl", "PackageVariablesInfo") load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") +load("@rules_pkg//pkg:providers.bzl", "PackageVariablesInfo") load(":protobuf_version.bzl", "PROTOC_VERSION") def _package_naming_impl(ctx): diff --git a/protos/bazel/upb_cc_proto_library.bzl b/protos/bazel/upb_cc_proto_library.bzl index f071266ac4..b93dfbd9fa 100644 --- a/protos/bazel/upb_cc_proto_library.bzl +++ b/protos/bazel/upb_cc_proto_library.bzl @@ -10,7 +10,6 @@ """ load("@bazel_skylib//lib:paths.bzl", "paths") -load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect") # begin:google_only # load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") @@ -27,6 +26,7 @@ load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", " # begin:github_only # Compatibility code for Bazel 4.x. Remove this when we drop support for Bazel 4.x. load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") +load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect") def upb_use_cpp_toolchain(): return ["@bazel_tools//tools/cpp:toolchain_type"] diff --git a/protos_generator/tests/BUILD b/protos_generator/tests/BUILD index 8ebb985531..6fbb5736c6 100644 --- a/protos_generator/tests/BUILD +++ b/protos_generator/tests/BUILD @@ -5,6 +5,10 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd +load( + "@rules_cc//cc:defs.bzl", + "cc_proto_library", +) load( "//bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", @@ -17,10 +21,6 @@ load( "//protos/bazel:upb_cc_proto_library.bzl", "upb_cc_proto_library", ) -load( - "@rules_cc//cc:defs.bzl", - "cc_proto_library", -) # begin:google_only # package(default_applicable_licenses = ["//upb:license"]) diff --git a/python/BUILD.bazel b/python/BUILD.bazel index d82068f869..10277b747b 100644 --- a/python/BUILD.bazel +++ b/python/BUILD.bazel @@ -5,14 +5,14 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//python:py_extension.bzl", "py_extension") load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") # begin:github_only load("@rules_pkg//pkg:mappings.bzl", "pkg_files") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") load("//python:build_targets.bzl", "build_targets") +load("//python:py_extension.bzl", "py_extension") build_targets(name = "python") # end:github_only diff --git a/python/dist/BUILD.bazel b/python/dist/BUILD.bazel index d998575cbb..ff65cd14c7 100644 --- a/python/dist/BUILD.bazel +++ b/python/dist/BUILD.bazel @@ -5,6 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd +load("@bazel_skylib//lib:selects.bzl", "selects") load("@pip_deps//:requirements.bzl", "requirement") load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_pkg//pkg:tar.bzl", "pkg_tar") @@ -12,7 +13,6 @@ load("@rules_python//python:packaging.bzl", "py_wheel") load("@system_python//:version.bzl", "SYSTEM_PYTHON_VERSION") load("//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION") load("//bazel:py_proto_library.bzl", "py_proto_library") -load("@bazel_skylib//lib:selects.bzl", "selects") load(":dist.bzl", "py_dist", "py_dist_module") licenses(["notice"]) diff --git a/python/pb_unit_tests/BUILD b/python/pb_unit_tests/BUILD index 8bb43dcc4e..74b01c8eef 100644 --- a/python/pb_unit_tests/BUILD +++ b/python/pb_unit_tests/BUILD @@ -5,12 +5,12 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load(":pyproto_test_wrapper.bzl", "pyproto_test_wrapper") - # begin:github_only load("@pip_deps//:requirements.bzl", "requirement") # end:github_only +load(":pyproto_test_wrapper.bzl", "pyproto_test_wrapper") + # begin:google_only # package(default_applicable_licenses = ["//upb:license"]) # end:google_only diff --git a/ruby/BUILD.bazel b/ruby/BUILD.bazel index 9f85d45b46..74a7716100 100755 --- a/ruby/BUILD.bazel +++ b/ruby/BUILD.bazel @@ -6,10 +6,10 @@ load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:common_settings.bzl", "string_flag") load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_ruby//ruby:defs.bzl", "ruby_library") -load("//python:internal.bzl", "internal_copy_files") -load("//ruby:defs.bzl", "internal_ruby_proto_library") load("//:protobuf_version.bzl", "PROTOBUF_RUBY_VERSION") load("//conformance:defs.bzl", "conformance_test") +load("//python:internal.bzl", "internal_copy_files") +load("//ruby:defs.bzl", "internal_ruby_proto_library") ################################################################################ # Ruby Runtime diff --git a/rust/BUILD b/rust/BUILD index 165640694b..9b49ccd551 100644 --- a/rust/BUILD +++ b/rust/BUILD @@ -1,8 +1,8 @@ # Protobuf Rust runtime packages. -load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") load("@bazel_skylib//rules:common_settings.bzl", "string_flag") load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain") +load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") package( default_visibility = [ diff --git a/rust/aspects.bzl b/rust/aspects.bzl index 4f3fc3823d..7a714ea6b8 100644 --- a/rust/aspects.bzl +++ b/rust/aspects.bzl @@ -3,13 +3,14 @@ Disclaimer: This project is experimental, under heavy development, and should not be used yet.""" +load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") + # buildifier: disable=bzl-visibility load("@rules_rust//rust/private:providers.bzl", "CrateInfo", "DepInfo", "DepVariantInfo") # buildifier: disable=bzl-visibility load("@rules_rust//rust/private:rustc.bzl", "rustc_compile_action") load("//bazel:upb_proto_library.bzl", "UpbWrappedCcInfo", "upb_proto_library_aspect") -load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") proto_common = proto_common_do_not_use diff --git a/rust/test/BUILD b/rust/test/BUILD index a9b8fd083c..7f10796719 100644 --- a/rust/test/BUILD +++ b/rust/test/BUILD @@ -1,10 +1,10 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") load( "//rust:defs.bzl", "rust_cc_proto_library", "rust_proto_library", "rust_upb_proto_library", ) -load("@rules_cc//cc:defs.bzl", "cc_proto_library") UNITTEST_PROTO_TARGET = "//src/google/protobuf:test_protos" diff --git a/rust/test/rust_proto_library_unit_test/rust_proto_library_unit_test.bzl b/rust/test/rust_proto_library_unit_test/rust_proto_library_unit_test.bzl index 4b23df56e1..418d0760bd 100644 --- a/rust/test/rust_proto_library_unit_test/rust_proto_library_unit_test.bzl +++ b/rust/test/rust_proto_library_unit_test/rust_proto_library_unit_test.bzl @@ -1,9 +1,9 @@ """This module contains unit tests for rust_proto_library and its aspect.""" load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts") +load("@rules_cc//cc:defs.bzl", "cc_proto_library") load("//rust:aspects.bzl", "RustProtoInfo") load("//rust:defs.bzl", "rust_cc_proto_library", "rust_upb_proto_library") -load("@rules_cc//cc:defs.bzl", "cc_proto_library") load(":defs.bzl", "ActionsInfo", "attach_cc_aspect", "attach_upb_aspect") def _find_actions_with_mnemonic(actions, mnemonic): diff --git a/src/google/protobuf/editions/BUILD b/src/google/protobuf/editions/BUILD index 403eee868e..6a0e15d353 100644 --- a/src/google/protobuf/editions/BUILD +++ b/src/google/protobuf/editions/BUILD @@ -1,9 +1,9 @@ -load("@rules_python//python:proto.bzl", "py_proto_library") -load("//bazel:upb_proto_library.bzl", "upb_c_proto_library", "upb_proto_reflection_library") -load("@rules_cc//cc:defs.bzl", "cc_proto_library") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load(":defaults.bzl", "compile_edition_defaults", "embed_edition_defaults") +load("@rules_cc//cc:defs.bzl", "cc_proto_library") +load("@rules_python//python:proto.bzl", "py_proto_library") load("//:protobuf.bzl", "internal_objc_proto_library") +load("//bazel:upb_proto_library.bzl", "upb_c_proto_library", "upb_proto_reflection_library") +load(":defaults.bzl", "compile_edition_defaults", "embed_edition_defaults") bzl_library( name = "defaults", diff --git a/toolchain/BUILD.bazel b/toolchain/BUILD.bazel index 06b8e7fad4..e83a0dde35 100644 --- a/toolchain/BUILD.bazel +++ b/toolchain/BUILD.bazel @@ -1,5 +1,5 @@ -load(":cc_toolchain_config.bzl", "cc_toolchain_config") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") +load(":cc_toolchain_config.bzl", "cc_toolchain_config") package(default_visibility = ["//visibility:public"]) diff --git a/upb/BUILD b/upb/BUILD index cc22a00f2b..b143088ce5 100644 --- a/upb/BUILD +++ b/upb/BUILD @@ -5,8 +5,8 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("@rules_python//python:defs.bzl", "py_binary") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") +load("@rules_python//python:defs.bzl", "py_binary") load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") load("//bazel:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts") diff --git a/upb/reflection/BUILD b/upb/reflection/BUILD index 21aea85781..65681c2793 100644 --- a/upb/reflection/BUILD +++ b/upb/reflection/BUILD @@ -5,18 +5,18 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load( - "//upb/cmake:build_defs.bzl", - "staleness_test", -) +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:upb_minitable_proto_library.bzl", "upb_minitable_proto_library") +load("//bazel:upb_proto_library.bzl", "upb_proto_reflection_library") load( "//src/google/protobuf/editions:defaults.bzl", "compile_edition_defaults", "embed_edition_defaults", ) -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") -load("//bazel:upb_minitable_proto_library.bzl", "upb_minitable_proto_library") -load("//bazel:upb_proto_library.bzl", "upb_proto_reflection_library") +load( + "//upb/cmake:build_defs.bzl", + "staleness_test", +) load( "//upb_generator:bootstrap_compiler.bzl", "bootstrap_cc_library", diff --git a/upb_generator/bootstrap_compiler.bzl b/upb_generator/bootstrap_compiler.bzl index 29548f26dc..640ec51971 100644 --- a/upb_generator/bootstrap_compiler.bzl +++ b/upb_generator/bootstrap_compiler.bzl @@ -1,14 +1,5 @@ """Macros that implement bootstrapping for the upb code generator.""" -load( - "//upb/cmake:build_defs.bzl", - "staleness_test", -) -load( - "//bazel:upb_proto_library.bzl", - "upb_proto_library", -) - # begin:github_only load( "//bazel:upb_minitable_proto_library.bzl", @@ -16,6 +7,15 @@ load( ) # end:github_only +load( + "//bazel:upb_proto_library.bzl", + "upb_proto_library", +) +load( + "//upb/cmake:build_defs.bzl", + "staleness_test", +) + _stages = ["_stage0", "_stage1", ""] _protoc = "//:protoc" _upbc_base = "//upb_generator:protoc-gen-"