Home > Blockchain >  Xcode 13 warning for .swiftsourceinfo
Xcode 13 warning for .swiftsourceinfo

Time:10-01

I'm developing a framework for iOS, it mixes Swift and Objective-C inside, distributed in binary form without source code.

Since Xcode 13, I observe a warning when importing this framework:

'MyFramework.framework/Modules/MyFramework.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo' is either malformed or generated by a different Swift version. Note that it uses an unstable format and may leak internal project details, it should not be distributed alongside modules

It seems it doesn't like .swiftsourceinfo file. Maybe I should just manually remove this file from the package, but I cannot find any explanation of what it is made for.

Even when I set BUILD_LIBRARY_FOR_DISTRIBUTION=YES, Xcode builds the framework with that .swiftsourceinfo file. So why does the warning say "it should not be distributed alongside modules"?

What is the purpose of .swiftsourceinfo file? Can I safely remove it from the built framework?

CodePudding user response:

How are you building your binary frameworks? Generally, .swiftsourceinfo are not stable across different versions of Swift Compiler so shouldn't be included when distributing the framework (especially when BUILD_LIBRARY_FOR_DISTRIBUTION=YES). So they shouldn't be included in the .framework package. If you build your framework using xcodebuild archive it should not generate .swiftsourceinfo

  • Related