Skip to content

Commit b1481db

Browse files
jincopybara-github
authored andcommitted
Automated rollback of commit 17634e6.
*** Reason for rollback *** Broke Bazel CI. https://buildkite.com/bazel/bazel-bazel/builds/29120 This unconditionally adds a malformed `--retain_options` for Bazel `GenProtoDescriptorSet` actions. Error message from Bazel CI: ``` /out/external/protobuf+/BUILD.bazel:295:14: Generating Descriptor Set proto_library @@protobuf+//:field_mask_proto failed: (Exit 1): protoc failed: error executing GenProtoDescriptorSet command (from target @@protobuf+//:field_mask_proto) (cd /tmp/bazel_MXMnh2ah/out/execroot/_main && \ exec env - \ PATH=/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/7518/execroot/_main/bazel-out/k8-fastbuild/bin/src/test/shell/bazel/bazel_bootstrap_distfile_tar_test.runfiles/_main/src/test/shell/bin:.:/var/lib/buildkite-agent/.cache/bazelisk/downloads/sha256/794f58b5a5c28c4729f04db0bd1238eaf827105bb49946238b00f681a1da377c/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ bazel-out/k8-opt-exec-ST-fad1763555eb/bin/external/protobuf+/protoc --retain_options --direct_dependencies google/protobuf/field_mask.proto '--direct_dependencies_violation_msg=%s is imported, but @com_google_protobuf//:field_mask_proto doesn'\''t directly depend on a proto_library that '\''srcs'\'' it.' '--descriptor_set_out=bazel-out/k8-opt/bin/external/protobuf+/field_mask_proto-descriptor-set.proto.bin' -Ibazel-out/k8-opt/bin/external/protobuf+/_virtual_imports/field_mask_proto -I. bazel-out/k8-opt/bin/external/protobuf+/_virtual_imports/field_mask_proto/google/protobuf/field_mask.proto) # Configuration: 51fff7df1321434da186ee58d16ff6808fac4806a3dc0efd25978eb6d595a9b7 # Execution platform: //:default_host_platform Missing value for flag: --retain_options ``` *** Original change description *** BEGIN_PUBLIC protobuf: delete the _retain_options attribute from proto_library() END_PUBLIC PiperOrigin-RevId: 671679277 Change-Id: Ic6921b74836bf563210cd024174f1291eb309f6f
1 parent 8ffe54f commit b1481db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/starlark/builtins_bzl/common/proto/proto_library.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ def _write_descriptor_set(ctx, proto_info, deps, exports, descriptor_set):
163163
args = ctx.actions.args()
164164
if ctx.fragments.proto.experimental_proto_descriptorsets_include_source_info():
165165
args.add("--include_source_info")
166-
args.add("--retain_options")
166+
if hasattr(ctx.attr, "_retain_options") and ctx.attr._retain_options:
167+
args.add("--retain_options")
167168

168169
strict_deps_mode = ctx.fragments.proto.strict_proto_deps()
169170
strict_deps = strict_deps_mode != "OFF" and strict_deps_mode != "DEFAULT"

0 commit comments

Comments
 (0)