diff --git a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift index 7deaaa528..1bac2b5da 100644 --- a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift +++ b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift @@ -112,9 +112,7 @@ extension Driver { if isPlanJobForExplicitModule && forObject && isFrontendArgSupported(.debugModulePath), let explicitModulePlanner { let mainModule = explicitModulePlanner.dependencyGraph.mainModule - let pathHandle = moduleOutputInfo.output?.outputPath ?? mainModule.modulePath.path - let path = VirtualPath.lookup(pathHandle) - try addPathOption(option: .debugModulePath, path: path, to: &commandLine, remap: jobNeedPathRemap) + try addPathOption(option: .debugModulePath, path: VirtualPath.lookup(mainModule.modulePath.path), to: &commandLine, remap: jobNeedPathRemap) } // Check if dependency scanner has put the job into direct clang cc1 mode. diff --git a/Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift b/Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift index 8931c0207..9f7fbaa47 100644 --- a/Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift +++ b/Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift @@ -1075,10 +1075,6 @@ final class ExplicitModuleBuildTests: XCTestCase { let baseName = "testExplicitModuleVerifyInterfaceJobs" XCTAssertTrue(matchTemporary(outputFilePath, basename: baseName, fileExtension: "o") || matchTemporary(outputFilePath, basename: baseName, fileExtension: "autolink")) - if outputFilePath.extension == FileType.object.rawValue && driver.isFrontendArgSupported(.debugModulePath) { - // Check that this is an absolute path pointing to the temporary directory. - XCTAssertTrue(job.commandLine.contains(subsequence: ["-debug-module-path", .path(.temporary(try RelativePath(validating: "testExplicitModuleVerifyInterfaceJobs-3.swiftmodule")))])) - } default: XCTFail("Unexpected module dependency build job output: \(outputFilePath)") }