From b032fd7d9e79b5d0668352e61180cb3d29bf831f Mon Sep 17 00:00:00 2001 From: Tony Allevato Date: Thu, 29 Aug 2024 06:15:17 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 668910802 --- swift/internal/BUILD | 1 - swift/internal/swift_symbol_graph_aspect.bzl | 51 ++++++++------------ 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/swift/internal/BUILD b/swift/internal/BUILD index 203a0c5ec..1fa1d1b0c 100644 --- a/swift/internal/BUILD +++ b/swift/internal/BUILD @@ -212,7 +212,6 @@ bzl_library( ":symbol_graph_extracting", ":toolchain_utils", "//swift:providers", - "//swift:swift_clang_module_aspect", ], ) diff --git a/swift/internal/swift_symbol_graph_aspect.bzl b/swift/internal/swift_symbol_graph_aspect.bzl index c5e39fa5b..d70e8c6b3 100644 --- a/swift/internal/swift_symbol_graph_aspect.bzl +++ b/swift/internal/swift_symbol_graph_aspect.bzl @@ -27,10 +27,6 @@ load( "SwiftInfo", "SwiftSymbolGraphInfo", ) -load( - "@build_bazel_rules_swift//swift:swift_clang_module_aspect.bzl", - "swift_clang_module_aspect", -) load(":features.bzl", "configure_features") load(":symbol_graph_extracting.bzl", "extract_symbol_graph") load(":toolchain_utils.bzl", "get_swift_toolchain", "use_swift_toolchain") @@ -59,34 +55,26 @@ def _swift_symbol_graph_aspect_impl(target, aspect_ctx): minimum_access_level = aspect_ctx.attr.minimum_access_level - # Only extract the symbol graphs of modules when the target compiles Swift or ObjC code - compiles_code = [ - action - for action in target.actions - if action.mnemonic == "SwiftCompile" or - action.mnemonic == "SwiftPrecompileCModule" - ] - if compiles_code: - for module in swift_info.direct_modules: - output_dir = aspect_ctx.actions.declare_directory( - "{}.symbolgraphs".format(target.label.name), - ) - extract_symbol_graph( - actions = aspect_ctx.actions, - compilation_contexts = [compilation_context], - feature_configuration = feature_configuration, - minimum_access_level = minimum_access_level, + for module in swift_info.direct_modules: + output_dir = aspect_ctx.actions.declare_directory( + "{}.symbolgraphs".format(target.label.name), + ) + extract_symbol_graph( + actions = aspect_ctx.actions, + compilation_contexts = [compilation_context], + feature_configuration = feature_configuration, + minimum_access_level = minimum_access_level, + module_name = module.name, + output_dir = output_dir, + swift_infos = [swift_info], + swift_toolchain = swift_toolchain, + ) + symbol_graphs.append( + struct( module_name = module.name, - output_dir = output_dir, - swift_infos = [swift_info], - swift_toolchain = swift_toolchain, - ) - symbol_graphs.append( - struct( - module_name = module.name, - symbol_graph_dir = output_dir, - ), - ) + symbol_graph_dir = output_dir, + ), + ) # TODO(b/204480390): We intentionally don't propagate symbol graphs from # private deps at this time, since the main use case for them is @@ -175,6 +163,5 @@ default value is {default_value}. fragments = ["cpp"], implementation = aspect_impl, provides = [SwiftSymbolGraphInfo], - requires = [swift_clang_module_aspect], toolchains = use_swift_toolchain(), )