Skip to content

Commit f681717

Browse files
thomasvlswiple-rules-gardener
authored andcommitted
Adopt the runtime from proto_lang_toolchain.
PiperOrigin-RevId: 545988587
1 parent 624d09d commit f681717

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

swift/internal/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ proto_lang_toolchain(
1616
plugin = "@com_github_apple_swift_protobuf//:ProtoCompilerPlugin",
1717
plugin_format_flag = "--plugin=protoc-gen-swift=%s",
1818
progress_message = "Generating Swift sources for %{label}",
19+
runtime = "@com_github_apple_swift_protobuf//:SwiftProtobuf",
1920
visibility = ["//visibility:public"],
2021
)
2122

swift/internal/swift_protoc_gen_aspect.bzl

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,7 @@ def _swift_protoc_gen_aspect_impl(target, aspect_ctx):
269269

270270
module_name = derive_swift_module_name(target.label)
271271

272-
# TODO: Revisit using `proto_lang_toolchain_info.runtime` here, was seeing:
273-
# bazel_rules/rules_swift/test/fixtures/module_interface/library/ToyModule.swift:15:8:
274-
# warning: module 'Foundation' was not compiled with library evolution support; using
275-
# it means binary compatibility for 'ToyModule' can't be guaranteed
276-
# import Foundation
277-
# ^
278-
#
279-
support_deps = aspect_ctx.attr._proto_support
272+
support_deps = [proto_lang_toolchain_info.runtime]
280273
for p in support_deps:
281274
if CcInfo in p:
282275
transitive_cc_infos.append(p[CcInfo])
@@ -369,13 +362,6 @@ swift_protoc_gen_aspect = aspect(
369362
swift_toolchain_attrs(),
370363
swift_config_attrs(),
371364
{
372-
# TODO: `proto_lang_toolchain_info.runtime` wasn't working in all cases, used
373-
# custom attribute instead.
374-
"_proto_support": attr.label_list(
375-
default = [
376-
Label("@com_github_apple_swift_protobuf//:SwiftProtobuf"),
377-
],
378-
),
379365
"_proto_lang_toolchain": attr.label(
380366
default = Label("@build_bazel_rules_swift//swift/internal:proto_swift_toolchain"),
381367
),

0 commit comments

Comments
 (0)