Skip to content

Commit abc832c

Browse files
committed
Remove deprecated 'externalTargetModulePathMap'
Clients should have transitioned to 'externalTargetModuleDetailsMap'.
1 parent 0270011 commit abc832c

File tree

3 files changed

+7
-28
lines changed

3 files changed

+7
-28
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public struct Driver {
3939
case invalidArgumentValue(String, String)
4040
case relativeFrontendPath(String)
4141
case subcommandPassedToDriver
42-
case externalTargetDetailsAPIError
4342
case integratedReplRemoved
4443
case cannotSpecify_OForMultipleOutputs
4544
case conflictingOptions(Option, Option)
@@ -78,8 +77,6 @@ public struct Driver {
7877
return "relative frontend path: \(path)"
7978
case .subcommandPassedToDriver:
8079
return "subcommand passed to driver"
81-
case .externalTargetDetailsAPIError:
82-
return "Cannot specify both: externalTargetModulePathMap and externalTargetModuleDetailsMap"
8380
case .integratedReplRemoved:
8481
return "Compiler-internal integrated REPL has been removed; use the LLDB-enhanced REPL instead."
8582
case .cannotSpecify_OForMultipleOutputs:
@@ -467,8 +464,6 @@ public struct Driver {
467464
/// an executable or as a library.
468465
/// - Parameter compilerExecutableDir: Directory that contains the compiler executable to be used.
469466
/// Used when in `integratedDriver` mode as a substitute for the driver knowing its executable path.
470-
/// - Parameter externalTargetModulePathMap: DEPRECATED: A dictionary of external targets
471-
/// that are a part of the same build, mapping to filesystem paths of their module files.
472467
/// - Parameter externalTargetModuleDetailsMap: A dictionary of external targets that are a part of
473468
/// the same build, mapping to a details value which includes a filesystem path of their
474469
/// `.swiftmodule` and a flag indicating whether the external target is a framework.
@@ -482,8 +477,6 @@ public struct Driver {
482477
executor: DriverExecutor,
483478
integratedDriver: Bool = true,
484479
compilerExecutableDir: AbsolutePath? = nil,
485-
// Deprecated in favour of the below `externalTargetModuleDetailsMap`
486-
externalTargetModulePathMap: ExternalTargetModulePathMap? = nil,
487480
externalTargetModuleDetailsMap: ExternalTargetModuleDetailsMap? = nil,
488481
interModuleDependencyOracle: InterModuleDependencyOracle? = nil
489482
) throws {
@@ -493,17 +486,7 @@ public struct Driver {
493486

494487
self.diagnosticEngine = diagnosticsEngine
495488
self.executor = executor
496-
497-
if externalTargetModulePathMap != nil && externalTargetModuleDetailsMap != nil {
498-
throw Error.externalTargetDetailsAPIError
499-
}
500-
if let externalTargetPaths = externalTargetModulePathMap {
501-
self.externalTargetModuleDetailsMap = externalTargetPaths.mapValues {
502-
ExternalTargetModuleDetails(path: $0, isFramework: false)
503-
}
504-
} else if let externalTargetDetails = externalTargetModuleDetailsMap {
505-
self.externalTargetModuleDetailsMap = externalTargetDetails
506-
}
489+
self.externalTargetModuleDetailsMap = externalTargetModuleDetailsMap
507490

508491
if case .subcommand = try Self.invocationRunMode(forArgs: args).mode {
509492
throw Error.subcommandPassedToDriver

Sources/SwiftDriver/ExplicitModuleBuilds/ExplicitDependencyBuildPlanner.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ import struct TSCBasic.AbsolutePath
1616
import struct Foundation.Data
1717
import class Foundation.JSONEncoder
1818

19-
/// A map from a module identifier to a path to its .swiftmodule file.
20-
/// Deprecated in favour of the below `ExternalTargetModuleDetails`
21-
public typealias ExternalTargetModulePathMap = [ModuleDependencyId: AbsolutePath]
22-
2319
/// Details about an external target, including the path to its .swiftmodule file
2420
/// and whether it is a framework.
2521
public struct ExternalTargetModuleDetails {

Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public extension Driver {
7474
// FIXME: MSVC runtime flags
7575

7676
// Pass in external target dependencies to be treated as placeholder dependencies by the scanner
77-
if let externalTargetPaths = externalTargetModuleDetailsMap?.mapValues({ $0.path }) {
77+
if let externalTargetDetailsMap = externalTargetModuleDetailsMap {
7878
let dependencyPlaceholderMapFile =
79-
try serializeExternalDependencyArtifacts(externalTargetPaths: externalTargetPaths)
79+
try serializeExternalDependencyArtifacts(externalTargetDependencyDetails: externalTargetDetailsMap)
8080
commandLine.appendFlag("-placeholder-dependency-module-map-file")
8181
commandLine.appendPath(dependencyPlaceholderMapFile)
8282
}
@@ -87,12 +87,12 @@ public extension Driver {
8787
}
8888

8989
/// Serialize a map of placeholder (external) dependencies for the dependency scanner.
90-
private func serializeExternalDependencyArtifacts(externalTargetPaths: ExternalTargetModulePathMap)
90+
private func serializeExternalDependencyArtifacts(externalTargetDependencyDetails: ExternalTargetModuleDetailsMap)
9191
throws -> VirtualPath {
9292
var placeholderArtifacts: [SwiftModuleArtifactInfo] = []
9393
// Explicit external targets
94-
for (moduleId, binaryModulePath) in externalTargetPaths {
95-
let modPath = TextualVirtualPath(path: VirtualPath.absolute(binaryModulePath).intern())
94+
for (moduleId, dependencyDetails) in externalTargetDependencyDetails {
95+
let modPath = TextualVirtualPath(path: VirtualPath.absolute(dependencyDetails.path).intern())
9696
placeholderArtifacts.append(
9797
SwiftModuleArtifactInfo(name: moduleId.moduleName,
9898
modulePath: modPath))
@@ -102,7 +102,7 @@ public extension Driver {
102102
let contents = try encoder.encode(placeholderArtifacts)
103103
return VirtualPath.createUniqueTemporaryFileWithKnownContents(.init("\(moduleOutputInfo.name)-external-modules.json"),
104104
contents)
105-
}
105+
}
106106

107107
/// Returns false if the lib is available and ready to use
108108
private func initSwiftScanLib() throws -> Bool {

0 commit comments

Comments
 (0)