From 095cdac250314895c6b77146d78595c3fa2599b5 Mon Sep 17 00:00:00 2001 From: Artem Chikin Date: Fri, 16 Jul 2021 09:19:18 -0700 Subject: [PATCH] Revert "[Dependency Scanning] Restore passing external target map as inputs to the scanning action." --- .../ModuleDependencyScanning.swift | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift b/Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift index 121e63de5..3174155fb 100644 --- a/Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift +++ b/Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift @@ -52,37 +52,11 @@ public extension Driver { moduleDependencyGraphUse: .dependencyScan) // FIXME: MSVC runtime flags - // Pass in external target dependencies to be treated as placeholder dependencies by the scanner - if let externalTargetPaths = externalTargetModulePathMap { - let dependencyPlaceholderMapFile = - try serializeExternalDependencyArtifacts(externalTargetPaths: externalTargetPaths) - commandLine.appendFlag("-placeholder-dependency-module-map-file") - commandLine.appendPath(dependencyPlaceholderMapFile) - } - // Pass on the input files commandLine.append(contentsOf: inputFiles.map { .path($0.file) }) return (inputs, commandLine) } - /// Serialize a map of placeholder (external) dependencies for the dependency scanner. - private func serializeExternalDependencyArtifacts(externalTargetPaths: ExternalTargetModulePathMap) - throws -> VirtualPath { - var placeholderArtifacts: [SwiftModuleArtifactInfo] = [] - // Explicit external targets - for (moduleId, binaryModulePath) in externalTargetPaths { - let modPath = TextualVirtualPath(path: VirtualPath.absolute(binaryModulePath).intern()) - placeholderArtifacts.append( - SwiftModuleArtifactInfo(name: moduleId.moduleName, - modulePath: modPath)) - } - let encoder = JSONEncoder() - encoder.outputFormatting = [.prettyPrinted] - let contents = try encoder.encode(placeholderArtifacts) - return VirtualPath.createUniqueTemporaryFileWithKnownContents(.init("\(moduleOutputInfo.name)-external-modules.json"), - contents) - } - /// Returns false if the lib is available and ready to use private func initSwiftScanLib() throws -> Bool { // If `-nonlib-dependency-scanner` was specified or the libSwiftScan library cannot be found,