Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 13 warning for .swiftsourceinfo

Tags:

xcode

ios

swift

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?

like image 404
alexander.cpp Avatar asked Sep 28 '21 06:09

alexander.cpp


Video Answer


1 Answers

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

like image 171
mamadlin Avatar answered Nov 11 '22 01:11

mamadlin