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: 3 additions & 1 deletion Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ extension Driver {
if isPlanJobForExplicitModule && forObject && isFrontendArgSupported(.debugModulePath),
let explicitModulePlanner {
let mainModule = explicitModulePlanner.dependencyGraph.mainModule
try addPathOption(option: .debugModulePath, path: VirtualPath.lookup(mainModule.modulePath.path), to: &commandLine, remap: jobNeedPathRemap)
let pathHandle = moduleOutputInfo.output?.outputPath ?? mainModule.modulePath.path
let path = VirtualPath.lookup(pathHandle)
try addPathOption(option: .debugModulePath, path: path, to: &commandLine, remap: jobNeedPathRemap)
}

// Check if dependency scanner has put the job into direct clang cc1 mode.
Expand Down
18 changes: 18 additions & 0 deletions Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,24 @@ 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.
var found : Bool = false
for arg in job.commandLine {
if !found && arg == "-debug-module-path" {
found = true
} else if found {
if case let .path(vpath) = arg {
XCTAssertTrue(vpath.isTemporary)
XCTAssertTrue(vpath.extension == FileType.swiftModule.rawValue)
} else {
XCTFail("argument is not a path")
}
break
}
}
XCTAssertTrue(found)
}
default:
XCTFail("Unexpected module dependency build job output: \(outputFilePath)")
}
Expand Down
Loading