From c51991600c73b9b488b08c8b68d156bce008b064 Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 7 Nov 2023 05:35:34 -0800 Subject: [PATCH] Make Google proto_library and extension of Bazel proto_library PiperOrigin-RevId: 580146223 Change-Id: I13ac76086d56cd26ae0c661d1c36c45a2ee270d1 --- .../starlark/StarlarkRuleClassFunctions.java | 4 ++- .../starlark/StarlarkRuleContext.java | 4 +-- .../proto/ProtoCompileActionBuilder.java | 25 ------------------- .../build/lib/rules/proto/ProtoConstants.java | 2 +- .../starlark/builtins_bzl/bazel/exports.bzl | 2 ++ .../starlark/builtins_bzl/common/exports.bzl | 2 -- .../common/proto/proto_library.bzl | 10 +++----- .../common/proto/proto_semantics.bzl | 10 -------- .../rules/proto/BazelProtoLibraryTest.java | 4 +-- 9 files changed, 14 insertions(+), 49 deletions(-) delete mode 100644 src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCompileActionBuilder.java diff --git a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java index 6412ae7deff673..60e4acead8d247 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java @@ -519,7 +519,9 @@ public static StarlarkRuleFunction createRule( } // Verify the child against parent's allowlist - if (parent != null && parent.getExtendableAllowlist() != null) { + if (parent != null + && parent.getExtendableAllowlist() != null + && !bzlFile.getRepository().getNameWithAt().equals("@_builtins")) { builder.addAllowlistChecker(EXTEND_RULE_ALLOWLIST_CHECKER); Attribute.Builder