Skip to content

Commit aae0cab

Browse files
authored
Deduplicate plugin arguments (#1495)
Currently, if we have the following setup, ``` swift_library ( name = "LibA" plugins = ["//:Macros"], ) swift_library ( name = "LibB" plugins = ["//:Macros"], deps = [":LibA"], ) ``` We would see `-load-plugin-executable /path/to/Macros#Macros` twice while compiling LibB. With a more complicated dependency graph, we are seeing hundreds of -load-plugin-executable of the same plugin on some modules. This PR deduplicates the plugins arguments.
1 parent b7eb892 commit aae0cab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

swift/internal/compiling.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
"""Implementation of compilation logic for Swift."""
1616

17+
load("@bazel_skylib//lib:collections.bzl", "collections")
1718
load("@bazel_skylib//lib:paths.bzl", "paths")
1819
load("@bazel_skylib//lib:sets.bzl", "sets")
1920
load(
@@ -645,7 +646,7 @@ to use swift_common.compile(include_dev_srch_paths = ...) instead.\
645646
module_name = module_name,
646647
original_module_name = original_module_name,
647648
package_name = package_name,
648-
plugins = used_plugins,
649+
plugins = collections.uniq(used_plugins),
649650
source_files = srcs,
650651
target_label = feature_configuration._label,
651652
transitive_modules = transitive_modules,

0 commit comments

Comments
 (0)