mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Soft-reject swiftmodules built against a different SDK
Change the way swiftmodules built against a different SDK than their clients are rejected. This makes them silently ignored when the module can be rebuilt from their swiftinterface, instead of reporting a hard error. rdar://93257769
This commit is contained in:
@@ -20,6 +20,15 @@
|
||||
// RUN: not %target-swift-frontend -typecheck %t/Client.swift -swift-version 5 -target-sdk-name C -I %t/build -parse-stdlib -module-cache-path %t/cache 2>&1 | %FileCheck %s -check-prefix=CHECK-C
|
||||
// CHECK-C: cannot load module 'Lib' built with SDK 'C.Secret' when using SDK 'C': {{.*}}Lib.swiftmodule
|
||||
|
||||
/// Build a resilient Lib against SDK A, and a client against SDK B.
|
||||
/// This should succeed after rebuilding from the swiftinterface.
|
||||
// RUN: %empty-directory(%t/cache)
|
||||
// RUN: %target-swift-frontend -emit-module %t/Lib.swift -swift-version 5 -target-sdk-name A -o %t/build -parse-stdlib -module-cache-path %t/cache \
|
||||
// RUN: -enable-library-evolution -emit-module-interface-path %t/build/Lib.swiftinterface
|
||||
// RUN: %target-swift-frontend -typecheck %t/Client.swift -swift-version 5 -target-sdk-name B -I %t/build -parse-stdlib -module-cache-path %t/cache \
|
||||
// RUN: -Rmodule-interface-rebuild 2>&1 | %FileCheck %s -check-prefix=CHECK-AvsB-REBUILD
|
||||
// CHECK-AvsB-REBUILD: remark: rebuilding module 'Lib' from interface
|
||||
|
||||
// BEGIN Lib.swift
|
||||
public func foo() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user