Skip to content

Commit b0e0388

Browse files
authored
Avoid warnings when using SDKs without a Concurrency module (#3517)
When mixing a newer compiler which does the implicit concurrency import with an older SDK that doesn't have a Concurrency module, manifest compilation is emitting warnings right now. This adds an extra flag to disable the implicit import if the flag is supported by the compiler in use. rdar://78032108
1 parent e1a732a commit b0e0388

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Sources/Commands/SwiftTool.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,12 +865,20 @@ public class SwiftTool {
865865
cachePath = try self.getCachePath().map{ $0.appending(component: "manifests") }
866866
}
867867

868+
let extraManifestFlags: [String]
869+
// Disable the implicit concurrency import if the compiler in use supports it to avoid warnings if we are building against an older SDK that does not contain a Concurrency module.
870+
if SwiftTargetBuildDescription.checkSupportedFrontendFlags(flags: ["disable-implicit-concurrency-module-import"], fs: localFileSystem) {
871+
extraManifestFlags = self.options.manifestFlags + ["-Xfrontend", "-disable-implicit-concurrency-module-import"]
872+
} else {
873+
extraManifestFlags = self.options.manifestFlags
874+
}
875+
868876
return try ManifestLoader(
869877
// Always use the host toolchain's resources for parsing manifest.
870878
manifestResources: self._hostToolchain.get().manifestResources,
871879
isManifestSandboxEnabled: !self.options.shouldDisableSandbox,
872880
cacheDir: cachePath,
873-
extraManifestFlags: self.options.manifestFlags
881+
extraManifestFlags: extraManifestFlags
874882
)
875883
})
876884
}()

0 commit comments

Comments
 (0)