Compiler error on Xcode 12 beta 5 when using ABI stable frameworks

Hi,

I have an Xcode 11.3.1 (Swift 5.1.3) project that's composed of several ABI stable binary frameworks.

I'm trying to build it now with Xcode 12 beta 5 but on almost all libraries I got this error:

Code Block
Failed to build module 'MyModule' from its module interface; the compiler that produced it, 'Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3 effective-4.2 (swiftlang-1200.0.28.1 clang-1200.0.30.1)'


The library contains all the architectures interface files, such as x86_64-apple-ios-simulator.swiftinterface with the expected content starting with
Code Block swift
// swift-interface-format-version: 1.0
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
// swift-module-flags: -target x86_64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 4.2 -enforce-exclusivity=checked -Onone -module-name MyModule


I wonder if the issue resides in the -swift-version and -target version used. Has anyone experienced the same issue?

Cheers
After trying different libraries, I found out that:
  • one library was built with SWIFT_VERSION = 4.2, a different API compared to 5, despite Build library for distribution was set to Yes and the interfaces generated correctly

  • another library has been built with the minimum iOS set to 8.0

  • the working ones have been built with Swift language set to 5 and minimum supported iOS version set to 11

Is there an official reference to validate the last point?
@matbank : did u found the solution for this issue?

I ended up on this thread while googling an error with a similar message and log.

In my case, I got the error while working on building a library with CocoaPods and the fix was to add XCTest to the list of linked frameworks.

# CombineTestHelpers.podspec

Pod::Spec.new do |s|
  # ...
  s.framework = 'XCTest'
  # ...
end

You can find the full .podspec here.

I'm not sure how relevant this is for this particular issue, but hopefully it can provide some inspiration. 🤞

Compiler error on Xcode 12 beta 5 when using ABI stable frameworks
 
 
Q