From f2fb9f655f53759a1fce73711dbf3f92f589012a Mon Sep 17 00:00:00 2001 From: Mai Hussien Date: Thu, 24 Oct 2024 14:37:59 -0700 Subject: [PATCH] test PiperOrigin-RevId: 689520709 --- aspect/intellij_info.bzl | 2 ++ aspect/intellij_info_impl.bzl | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/aspect/intellij_info.bzl b/aspect/intellij_info.bzl index 54a2be601b9..652b83c95a4 100644 --- a/aspect/intellij_info.bzl +++ b/aspect/intellij_info.bzl @@ -8,6 +8,8 @@ load( EXTRA_DEPS = [ "embed", # From go rules (bazel only) + "_cc_toolchain", # From rules_cc (bazel only) + "_kt_toolchain", # From rules_kotlin (bazel only) ] def tool_label(tool_name): diff --git a/aspect/intellij_info_impl.bzl b/aspect/intellij_info_impl.bzl index c09e1833a1c..d4da3601775 100644 --- a/aspect/intellij_info_impl.bzl +++ b/aspect/intellij_info_impl.bzl @@ -16,7 +16,7 @@ load( ) IntelliJInfo = provider( - doc = "Collected infromation about the targets visited by the aspect.", + doc = "Collected information about the targets visited by the aspect.", fields = [ "export_deps", "kind", @@ -38,7 +38,6 @@ UNSUPPORTED_FEATURES = [ # Compile-time dependency attributes, grouped by type. DEPS = [ - "_cc_toolchain", # From cc rules "_stl", # From cc rules "malloc", # From cc_binary rules "_java_toolchain", # From java rules @@ -52,7 +51,6 @@ DEPS = [ "test_app", # android_instrumentation_test "instruments", # android_instrumentation_test "tests", # From test_suite - "_kt_toolchain", # From rules_kotlin ] # Run-time dependency attributes, grouped by type. @@ -1071,6 +1069,16 @@ def intellij_info_aspect_impl(target, ctx, semantics): rule_attrs, semantics_extra_deps(DEPS, semantics, "extra_deps"), ) + + # Collect direct toolchain type-based dependencies + if hasattr(semantics, "toolchains_propagation"): + direct_dep_targets.extend( + semantics.toolchains_propagation.collect_toolchain_deps( + ctx, + semantics.toolchains_propagation.toolchain_types, + ), + ) + direct_deps = make_deps(direct_dep_targets, COMPILE_TIME) # Add exports from direct dependencies @@ -1209,7 +1217,7 @@ def semantics_extra_deps(base, semantics, name): extra_deps = getattr(semantics, name) return base + extra_deps -def make_intellij_info_aspect(aspect_impl, semantics): +def make_intellij_info_aspect(aspect_impl, semantics, **kwargs): """Creates the aspect given the semantics.""" tool_label = semantics.tool_label flag_hack_label = semantics.flag_hack_label @@ -1253,4 +1261,5 @@ def make_intellij_info_aspect(aspect_impl, semantics): fragments = ["cpp"], required_aspect_providers = [[JavaInfo], [CcInfo]] + semantics.extra_required_aspect_providers, implementation = aspect_impl, + **kwargs )