Skip to content

Add opt-in direct compiler plugin loading - #1891

Merged
keith merged 2 commits into
bazelbuild:mainfrom
markvasiv:direct-plugin-loading-opt-in
Aug 26, 2026
Merged

Add opt-in direct compiler plugin loading#1891
keith merged 2 commits into
bazelbuild:mainfrom
markvasiv:direct-plugin-loading-opt-in

Conversation

@markvasiv

@markvasiv markvasiv commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What

  • Adds an opt-in swift.load_plugins_from_direct_dependencies feature. When enabled, plugin collection in compile() walks only the direct modules of the compilation's swift_infos and private_swift_infos.
  • Transitive plugin loading remains the default behavior.
  • Documents the feature on the plugins attribute.
  • Adds test/fixtures/macros and a macro_plugin analysis-test suite verifying that:
    • Transitive dependents load the plugin by default.
    • Transitive dependents don't load the plugin if the feature is enabled

Why

Comment thread swift/internal/feature_names.bzl Outdated
@keith
keith enabled auto-merge (squash) August 26, 2026 17:17
@keith
keith merged commit 73e251f into bazelbuild:main Aug 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiler plugins are loaded by all transitive dependents, making the plugin executable an input to every downstream Swift compile

2 participants