Skip to content

Commit 996f5aa

Browse files
Remove error for invalid swift caching configuration
Currently, swift-driver emits an error when trying to importing a swift binary module that has a bridging header when swift caching is enabled. This turns out to be a very common configuration that we need to support. It turns out most of the time, allowing the compilation to continue will result in a successful compilation. Even though in rare occasions where multiple bridging headers from the dependencies are involved with overlapping content, the compilation is going to fail with confusing error message, we will address that in swift compiler instead. Thus the current error message is removed to allow more supported projects. (cherry picked from commit d091f6d)
1 parent ef78a65 commit 996f5aa

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/ExplicitDependencyBuildPlanner.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,6 @@ public typealias ExternalTargetModuleDetailsMap = [ModuleDependencyId: ExternalT
264264
for dependencyModule in swiftDependencyArtifacts {
265265
inputs.append(TypedVirtualPath(file: dependencyModule.modulePath.path,
266266
type: .swiftModule))
267-
268-
let prebuiltHeaderDependencyPaths = dependencyModule.prebuiltHeaderDependencyPaths ?? []
269-
if cas != nil && !prebuiltHeaderDependencyPaths.isEmpty {
270-
throw DependencyScanningError.unsupportedConfigurationForCaching("module \(dependencyModule.moduleName) has bridging header dependency")
271-
}
272267
}
273268
for moduleArtifactInfo in clangDependencyArtifacts {
274269
let clangModulePath =

Sources/SwiftDriver/SwiftScan/SwiftScan.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public enum DependencyScanningError: LocalizedError, DiagnosticData, Equatable {
3535
case scanningLibraryInvocationMismatch(String, String)
3636
case scanningLibraryNotFound(AbsolutePath)
3737
case argumentQueryFailed
38-
case unsupportedConfigurationForCaching(String)
3938

4039
public var description: String {
4140
switch self {
@@ -61,8 +60,6 @@ public enum DependencyScanningError: LocalizedError, DiagnosticData, Equatable {
6160
return "Dependency Scanning library not found at path: \(path)"
6261
case .argumentQueryFailed:
6362
return "Supported compiler argument query failed"
64-
case .unsupportedConfigurationForCaching(let reason):
65-
return "Unsupported configuration for -cache-compile-job, consider turn off swift caching: \(reason)"
6663
}
6764
}
6865

Tests/SwiftDriverTests/CachingBuildTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,9 +709,9 @@ final class CachingBuildTests: XCTestCase {
709709
main.nativePathString(escaped: true)] + sdkArgumentsForTesting,
710710
env: ProcessEnv.vars,
711711
interModuleDependencyOracle: dependencyOracle)
712-
// This is currently not supported.
713-
XCTAssertThrowsError(try driver.planBuild()) {
714-
XCTAssertEqual($0 as? DependencyScanningError, .unsupportedConfigurationForCaching("module Foo has bridging header dependency"))
712+
let jobs = try driver.planBuild()
713+
for job in jobs {
714+
XCTAssertFalse(job.outputCacheKeys.isEmpty)
715715
}
716716
}
717717
}

0 commit comments

Comments
 (0)