From b14d9ee01f86b7d9e94bc7aee2651d637665c51b Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Fri, 12 Jul 2024 06:27:02 -0700 Subject: [PATCH] Automated Code Change PiperOrigin-RevId: 651754564 --- editions/BUILD | 1 + editions/defaults.bzl | 3 ++- pkg/build_systems.bzl | 1 + rust/aspects.bzl | 3 ++- rust/defs.bzl | 3 ++- .../rust_proto_library_unit_test.bzl | 12 +++++------- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/editions/BUILD b/editions/BUILD index fd5ddddaf0..dea2901bb7 100644 --- a/editions/BUILD +++ b/editions/BUILD @@ -8,6 +8,7 @@ bzl_library( name = "defaults", srcs = ["defaults.bzl"], visibility = ["//visibility:public"], + deps = ["//bazel/common:proto_info_bzl"], ) # Aggregate all the features owned by the Protobuf repo. diff --git a/editions/defaults.bzl b/editions/defaults.bzl index 84551c7341..b1c3f8d894 100644 --- a/editions/defaults.bzl +++ b/editions/defaults.bzl @@ -4,13 +4,14 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd - """ Provide a rule for generating the intermediate feature set defaults used for feature resolution. See go/life-of-a-featureset for more information. """ +load("//bazel/common:proto_info.bzl", "ProtoInfo") + def _compile_edition_defaults_impl(ctx): out_file = ctx.actions.declare_file(ctx.outputs.output.basename) sources = [] diff --git a/pkg/build_systems.bzl b/pkg/build_systems.bzl index 82c522966e..5423e27b7d 100644 --- a/pkg/build_systems.bzl +++ b/pkg/build_systems.bzl @@ -2,6 +2,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths") load("@rules_pkg//pkg:providers.bzl", "PackageFilegroupInfo", "PackageFilesInfo") +load("//bazel/common:proto_info.bzl", "ProtoInfo") load(":cc_dist_library.bzl", "CcFileList") ################################################################################ diff --git a/rust/aspects.bzl b/rust/aspects.bzl index 80e9f6bd01..16c7cd05f8 100644 --- a/rust/aspects.bzl +++ b/rust/aspects.bzl @@ -4,7 +4,6 @@ Disclaimer: This project is experimental, under heavy development, and should no be used yet.""" load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") -load("@rules_proto//proto:defs.bzl", "ProtoInfo", "proto_common") # buildifier: disable=bzl-visibility load("@rules_rust//rust/private:providers.bzl", "CrateInfo", "DepInfo", "DepVariantInfo") @@ -12,6 +11,8 @@ load("@rules_rust//rust/private:providers.bzl", "CrateInfo", "DepInfo", "DepVari # 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/common:proto_common.bzl", "proto_common") +load("//bazel/common:proto_info.bzl", "ProtoInfo") visibility(["//rust/..."]) diff --git a/rust/defs.bzl b/rust/defs.bzl index 1578b4b8fd..23d841a187 100644 --- a/rust/defs.bzl +++ b/rust/defs.bzl @@ -3,8 +3,9 @@ Disclaimer: This project is experimental, under heavy development, and should not be used yet.""" -load("@rules_proto//proto:defs.bzl", "ProtoInfo", "proto_common") load("@rules_rust//rust:defs.bzl", "rust_common") +load("//bazel/common:proto_common.bzl", "proto_common") +load("//bazel/common:proto_info.bzl", "ProtoInfo") load( "//rust:aspects.bzl", "RustProtoInfo", 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 58e8427e13..40f7310bb7 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,6 +1,7 @@ """This module contains unit tests for rust_proto_library and its aspect.""" load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts") +load("//bazel:proto_library.bzl", "proto_library") load("//rust:aspects.bzl", "RustProtoInfo") load("//rust:defs.bzl", "rust_cc_proto_library", "rust_upb_proto_library") load(":defs.bzl", "ActionsInfo", "attach_cc_aspect", "attach_upb_aspect") @@ -210,21 +211,18 @@ def rust_proto_library_unit_test(name): Args: name: name of the test suite""" - native.proto_library( + proto_library( # Use a '-' in the target name to test that its replaced by a '_' in the crate name. name = "grand-parent_proto", srcs = ["grandparent1.proto", "grandparent2.proto"], ) - - native.proto_library( + proto_library( name = "parent_proto", srcs = ["parent.proto"], deps = [":grand-parent_proto"], ) - - native.proto_library(name = "parent2_proto", srcs = ["parent2.proto"]) - - native.proto_library( + proto_library(name = "parent2_proto", srcs = ["parent2.proto"]) + proto_library( name = "child_proto", srcs = ["child.proto"], deps = [":parent_proto", ":parent2_proto"],