Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 668910802
  • Loading branch information
allevato authored and swiple-rules-gardener committed Aug 29, 2024
1 parent b795fe6 commit b032fd7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 33 deletions.
1 change: 0 additions & 1 deletion swift/internal/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ bzl_library(
":symbol_graph_extracting",
":toolchain_utils",
"//swift:providers",
"//swift:swift_clang_module_aspect",
],
)

Expand Down
51 changes: 19 additions & 32 deletions swift/internal/swift_symbol_graph_aspect.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(),
)

1 comment on commit b032fd7

@brentleyjones
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't take the commit being reverted.

Please sign in to comment.