Skip to content

Commit

Permalink
Adopt the runtime from proto_lang_toolchain.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 545988587
  • Loading branch information
thomasvl authored and swiple-rules-gardener committed Jul 6, 2023
1 parent 624d09d commit f681717
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
1 change: 1 addition & 0 deletions swift/internal/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ proto_lang_toolchain(
plugin = "@com_github_apple_swift_protobuf//:ProtoCompilerPlugin",
plugin_format_flag = "--plugin=protoc-gen-swift=%s",
progress_message = "Generating Swift sources for %{label}",
runtime = "@com_github_apple_swift_protobuf//:SwiftProtobuf",
visibility = ["//visibility:public"],
)

Expand Down
16 changes: 1 addition & 15 deletions swift/internal/swift_protoc_gen_aspect.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,7 @@ def _swift_protoc_gen_aspect_impl(target, aspect_ctx):

module_name = derive_swift_module_name(target.label)

# TODO: Revisit using `proto_lang_toolchain_info.runtime` here, was seeing:
# bazel_rules/rules_swift/test/fixtures/module_interface/library/ToyModule.swift:15:8:
# warning: module 'Foundation' was not compiled with library evolution support; using
# it means binary compatibility for 'ToyModule' can't be guaranteed
# import Foundation
# ^
#
support_deps = aspect_ctx.attr._proto_support
support_deps = [proto_lang_toolchain_info.runtime]
for p in support_deps:
if CcInfo in p:
transitive_cc_infos.append(p[CcInfo])
Expand Down Expand Up @@ -369,13 +362,6 @@ swift_protoc_gen_aspect = aspect(
swift_toolchain_attrs(),
swift_config_attrs(),
{
# TODO: `proto_lang_toolchain_info.runtime` wasn't working in all cases, used
# custom attribute instead.
"_proto_support": attr.label_list(
default = [
Label("@com_github_apple_swift_protobuf//:SwiftProtobuf"),
],
),
"_proto_lang_toolchain": attr.label(
default = Label("@build_bazel_rules_swift//swift/internal:proto_swift_toolchain"),
),
Expand Down

0 comments on commit f681717

Please sign in to comment.