Skip to content

Commit 840bc43

Browse files
committed
Only emit ABI descriptors on Darwin platforms
Where Library Evolution is enabled
1 parent a07e54c commit 840bc43

File tree

3 files changed

+105
-45
lines changed

3 files changed

+105
-45
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ public struct Driver {
360360
guard isFeatureSupported(.emit_abi_descriptor) else {
361361
return nil
362362
}
363+
// Emit the descriptor only on platforms where Library Evolution is supported,
364+
// or opted-into explicitly.
365+
guard targetTriple.isDarwin || parsedOptions.hasArgument(.enableLibraryEvolution) else {
366+
return nil
367+
}
363368
guard let moduleOutput = moduleOutputInfo.output else {
364369
return nil
365370
}

Tests/SwiftDriverTests/APIDigesterTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ class APIDigesterTests: XCTestCase {
229229
}
230230

231231
func testBaselineComparisonJobFlags() throws {
232+
#if !os(macOS)
233+
throw XCTSkip("Skipping: ABI descriptor is only emitted on Darwin platforms.")
234+
#endif
232235
do {
233236
var driver = try Driver(args: ["swiftc", "foo.swift", "-emit-module", "-compare-to-baseline-path", "/baseline/path",
234237
"-sdk", "/path/to/sdk", "-I", "/some/path", "-F", "framework/path",

0 commit comments

Comments
 (0)