Skip to content

Commit 750c534

Browse files
Increase stack size on Linux builds (#18)
2M stack size, as swift-linux-musl provides a default thread stack size of only 128k. This prevents segmentation faults for larger Swift projects being scanned. Can be seen, e.g., with swiftastgen being run on https://github.com/migueldeicaza/SwiftGodot
1 parent 03e33f6 commit 750c534

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Package.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ let package = Package(
4242
],
4343
swiftSettings: [
4444
.unsafeFlags(["-cross-module-optimization"], .when(configuration: .release))
45-
]
45+
],
46+
linkerSettings: [
47+
// 2M stack size, as swift-linux-musl provides a default thread stack size of only 128k.
48+
// This prevents segmentation faults for larger Swift projects being scanned.
49+
.unsafeFlags(["-Xlinker", "-z", "-Xlinker", "stack-size=2097152"], .when(platforms: [.linux], configuration: .release))
50+
],
4651
),
4752
.testTarget(
4853
name: "SwiftAstGenTests",

0 commit comments

Comments
 (0)