Skip to content

PrebuiltModuleGen: allow retrying after hitting bad file descriptor error #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2021
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
2 changes: 2 additions & 0 deletions Sources/SwiftDriver/Jobs/PrebuiltModulesJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ extension Driver {
commandLine.append(.path(try VirtualPath(path: mcp)))
}
commandLine.appendFlag(.serializeParseableModuleInterfaceDependencyHashes)
commandLine.appendFlag(.badFileDescriptorRetryCount)
commandLine.appendFlag("30")
return Job(
moduleName: moduleName,
kind: .compile,
Expand Down
1 change: 1 addition & 0 deletions Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
XCTAssertTrue(jobs.allSatisfy {$0.kind == .compile})
XCTAssertTrue(jobs.allSatisfy {$0.commandLine.contains(.flag("-compile-module-from-interface"))})
XCTAssertTrue(jobs.allSatisfy {$0.commandLine.contains(.flag("-module-cache-path"))})
XCTAssertTrue(jobs.allSatisfy {$0.commandLine.contains(.flag("-bad-file-descriptor-retry-count"))})
XCTAssertTrue(try jobs.allSatisfy {$0.commandLine.contains(.path(try VirtualPath(path: moduleCachePath)))})
let HJobs = jobs.filter { $0.moduleName == "H"}
XCTAssertTrue(HJobs.count == 3)
Expand Down