Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Sources/SwiftDriver/Driver/Driver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ public struct Driver {
case missingContextHashOnSwiftDependency(String)
case dependencyScanningFailure(Int, String)
case missingExternalDependency(String)
// Compiler Caching Failures
case unsupportedConfigurationForCaching(String)

public var description: String {
switch self {
Expand Down Expand Up @@ -138,8 +136,6 @@ public struct Driver {
return "unable to load output file map '\(path)': \(error)"
case .missingExternalDependency(let moduleName):
return "Missing External dependency info for module: \(moduleName)"
case .unsupportedConfigurationForCaching(let reason):
return "unsupported configuration for -cache-compile-job: \(reason)"
case .baselineGenerationRequiresTopLevelModule(let arg):
return "generating a baseline with '\(arg)' is only supported with '-emit-module' or '-emit-module-path'"
case .optionRequiresAnother(let first, let second):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public typealias ExternalTargetModuleDetailsMap = [ModuleDependencyId: ExternalT

let prebuiltHeaderDependencyPaths = dependencyModule.prebuiltHeaderDependencyPaths ?? []
if cas != nil && !prebuiltHeaderDependencyPaths.isEmpty {
throw Driver.Error.unsupportedConfigurationForCaching("module \(dependencyModule.moduleName) has prebuilt header dependency")
throw DependencyScanningError.unsupportedConfigurationForCaching("module \(dependencyModule.moduleName) has bridging header dependency")
}

for headerDep in prebuiltHeaderDependencyPaths {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ extension Driver {

assert(pchJob.outputCacheKeys.count == 1, "Expect one and only one cache key from pch job")
guard let bridgingHeaderCacheKey = pchJob.outputCacheKeys.first?.value else {
throw Error.unsupportedConfigurationForCaching("pch job doesn't have an associated cache key")
fatalError("pch job doesn't have an associated cache key")
}
commandLine.appendFlag("-bridging-header-pch-key")
commandLine.appendFlag(bridgingHeaderCacheKey)
Expand Down
5 changes: 4 additions & 1 deletion Sources/SwiftDriver/SwiftScan/SwiftScan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import protocol TSCBasic.DiagnosticData
import struct TSCBasic.AbsolutePath
import struct TSCBasic.Diagnostic

public enum DependencyScanningError: LocalizedError, DiagnosticData {
public enum DependencyScanningError: LocalizedError, DiagnosticData, Equatable {
case missingRequiredSymbol(String)
case dependencyScanFailed(String)
case failedToInstantiateScanner
Expand All @@ -34,6 +34,7 @@ public enum DependencyScanningError: LocalizedError, DiagnosticData {
case scanningLibraryInvocationMismatch(AbsolutePath, AbsolutePath)
case scanningLibraryNotFound(AbsolutePath)
case argumentQueryFailed
case unsupportedConfigurationForCaching(String)

public var description: String {
switch self {
Expand All @@ -59,6 +60,8 @@ public enum DependencyScanningError: LocalizedError, DiagnosticData {
return "Dependency Scanning library not found at path: \(path)"
case .argumentQueryFailed:
return "Supported compiler argument query failed"
case .unsupportedConfigurationForCaching(let reason):
return "Unsupported configuration for -cache-compile-job, consider turn off swift caching: \(reason)"
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftDriverTests/CachingBuildTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ final class CachingBuildTests: XCTestCase {
interModuleDependencyOracle: dependencyOracle)
// This is currently not supported.
XCTAssertThrowsError(try driver.planBuild()) {
XCTAssertEqual($0 as? Driver.Error, .unsupportedConfigurationForCaching("module Foo has prebuilt header dependency"))
XCTAssertEqual($0 as? DependencyScanningError, .unsupportedConfigurationForCaching("module Foo has bridging header dependency"))
}
}
}
Expand Down