Skip to content

build(plugins): give the 41 plugin targets the app's concurrency settings - #2958

Merged
datlechin merged 5 commits into
mainfrom
fix/apple-audit-plugin-concurrency
Sep 17, 2026
Merged

datlechin merged 5 commits into
mainfrom
fix/apple-audit-plugin-concurrency

Conversation

@datlechin

Copy link
Copy Markdown
Member

The app, both helper tools and both test bundles compile with SWIFT_APPROACHABLE_CONCURRENCY and SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY. The DriverPlugin target template, which 41 plugin bundles share, had neither. The iOS project sets both on all three of its targets, so this was drift rather than a decision.

It matters because of what the first of those settings turns on. Xcode 27's Swift.xcspec expands SWIFT_APPROACHABLE_CONCURRENCY into five upcoming features, and NonisolatedNonsendingByDefault (SE-0461) is one of them: a nonisolated async function runs on the caller's executor instead of hopping to the global concurrent executor. A plugin bundle is dlopened into the app's own process, so one function had two execution semantics depending on which target compiled it, and nothing checked for that. scripts/ci/check-ios-shared-isolation.py covers the isolation keyword on shared files, not the feature set.

What the second setting found

MemberImportVisibility (SE-0444) makes a file's use of an API an error unless that file imports the module defining it. Turning it on named 22 files across 8 plugins that call Logger, its log levels or its string interpolation while relying on a different file in the same module to have imported os:

  • MySQL: MariaDBCharacterSet, MariaDBPluginConnection, MySQLPluginDriver+CreateDatabase, +Flavor, +OceanBaseDefaults
  • PostgreSQL: LibPQPluginConnection, +ResultReading, +SpatialRendering
  • Redis: RedisPluginDriver, RedisPluginConnection, RedisClusterChannel, RedisSentinelChannel, HiredisSentinelTransport
  • MongoDB: MongoDBConnection, +ScriptHelpers, +SyncHelpers
  • DynamoDB, Elasticsearch, Etcd, Typesense, Weaviate, Oracle: one file each

Each one is a line of import os in the first commit. They compile today only because of a neighbour, which is exactly the fragility the feature exists to remove.

What this PR does not do, and why that is the important part

TableProPluginKit is deliberately left alone. It is the only target built with BUILD_LIBRARY_FOR_DISTRIBUTION, so its signatures are ABI, and NonisolatedNonsendingByDefault changes the spelling of every public async declaration.

Measured rather than assumed, with scripts/check-pluginkit-abi.sh against the merge base and the setting applied to PluginKit alone:

  • 625 added lines, 208 removed lines in the public interface.
  • Classified, every removal is accounted for: 200 are the same declaration re-added with nonisolated(nonsending) in front, and the other 8 are declarations whose closure parameter types gained it. Zero are relocations, zero are genuine removals.

Example, before and after:

-  public static func resolve(source: String, fields: [String: String]) async throws -> AWSCredentials
+  nonisolated(nonsending) public static func resolve(source: String, fields: [String: String]) async throws -> AWSCredentials

By CLAUDE.md's own rule, a changed signature on an existing requirement is a breaking ABI change: it needs currentPluginKitVersion and minimumCompatiblePluginKitVersion bumped, plus scripts/release-all-plugins.sh across all 23 registry plugins before or with the app release. That is the #1917 and 0.49.0 failure shape, and it is not worth spending a breaking bump on a compile-time consistency win. It should ride the next breaking bump that has its own reason to exist, whenever that is.

The plugin bundles carry no such risk. They are leaf bundle targets whose calling conventions are private to themselves, which is why they can move now and PluginKit cannot.

Verification

  • verify.sh plugins (the AllPlugins aggregate, all 41 targets): PASS.
  • scripts/ci/verify-plugin-loads.sh over the built products: all 41 plugins dlopen.
  • verify.sh build: PASS.
  • verify.sh test over MySQLPartitionBoundTests, MySQLCharacterSetTests, RedisCommandRoutingTests, PostgreSQLObjectQueriesTests and MongoDBUuidCodecTests: 59 cases, all passing.
  • swiftlint lint --strict over every changed file: 0 violations.

One note on the AllPlugins run. It fails on this machine at main too, inside oracle-nio, with unknown attribute 'usableFromInlinenonisolated' from a @TaskLocal macro expansion under Swift 6.4. The resolved checkout was patched per the two known edits to get a real result; that patch is build output and is not part of this PR.

@datlechin
datlechin merged commit ddb08e8 into main Sep 17, 2026
3 checks passed
@datlechin
datlechin deleted the fix/apple-audit-plugin-concurrency branch September 17, 2026 22:43
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.

1 participant