Skip to content

Commit 441f465

Browse files
authored
Avoid warnings when using SDKs without a Concurrency module (#3518)
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 (cherry picked from commit b0e0388)
1 parent a9e3899 commit 441f465

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
@@ -878,12 +878,20 @@ public class SwiftTool {
878878
cachePath = try self.getCachePath().map{ $0.appending(component: "manifests") }
879879
}
880880

881+
let extraManifestFlags: [String]
882+
// 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.
883+
if SwiftTargetBuildDescription.checkSupportedFrontendFlags(flags: ["disable-implicit-concurrency-module-import"], fs: localFileSystem) {
884+
extraManifestFlags = self.options.manifestFlags + ["-Xfrontend", "-disable-implicit-concurrency-module-import"]
885+
} else {
886+
extraManifestFlags = self.options.manifestFlags
887+
}
888+
881889
return try ManifestLoader(
882890
// Always use the host toolchain's resources for parsing manifest.
883891
manifestResources: self._hostToolchain.get().manifestResources,
884892
isManifestSandboxEnabled: !self.options.shouldDisableSandbox,
885893
cacheDir: cachePath,
886-
extraManifestFlags: self.options.manifestFlags
894+
extraManifestFlags: extraManifestFlags
887895
)
888896
})
889897
}()

0 commit comments

Comments
 (0)