File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Sources/SwiftDriver/Utilities Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,15 @@ func quoteArgument(_ argument: String) -> String {
6262#if canImport(Darwin) || os(Linux) || os(Android) || os(OpenBSD) || os(FreeBSD)
6363// Adapted from llvm::sys::commandLineFitsWithinSystemLimits.
6464func commandLineFitsWithinSystemLimits( path: String , args: [ String ] ) -> Bool {
65- let upperBound = sysconf ( Int32 ( _SC_ARG_MAX) )
66- guard upperBound != - 1 else {
65+ let systemLimit = sysconf ( Int32 ( _SC_ARG_MAX) )
66+ guard systemLimit != - 1 else {
6767 // The system reports no limit.
6868 return true
6969 }
7070 // The lower bound for ARG_MAX on a POSIX system
71- let lowerBound = Int ( _POSIX_ARG_MAX)
72- // This the same baseline used by xargs.
73- let baseline = 128 * 1024
71+ let posixLimit = Int ( _POSIX_ARG_MAX)
7472
75- var effectiveArgMax = max ( min ( baseline , upperBound ) , lowerBound )
73+ var effectiveArgMax = max ( systemLimit , posixLimit )
7674 // Conservatively assume environment variables consume half the space.
7775 effectiveArgMax /= 2
7876
Original file line number Diff line number Diff line change @@ -1766,7 +1766,7 @@ final class SwiftDriverTests: XCTestCase {
17661766 }
17671767
17681768 func testUsingResponseFiles( ) throws {
1769- let manyArgs = ( 1 ... 20000 ) . map { " -DTEST_ \( $0) " }
1769+ let manyArgs = ( 1 ... 200000 ) . map { " -DTEST_ \( $0) " }
17701770 // Needs response file
17711771 do {
17721772 let source = try AbsolutePath ( validating: " /foo.swift " )
@@ -1879,7 +1879,7 @@ final class SwiftDriverTests: XCTestCase {
18791879 // The jobs below often take large command lines (e.g., when passing a large number of Clang
18801880 // modules to Swift). Ensure that they don't regress in their ability to pass response files
18811881 // from the driver to the frontend.
1882- let manyArgs = ( 1 ... 20000 ) . map { " -DTEST_ \( $0) " }
1882+ let manyArgs = ( 1 ... 200000 ) . map { " -DTEST_ \( $0) " }
18831883
18841884 // Compile + separate emit module job
18851885 do {
You can’t perform that action at this time.
0 commit comments