Request to Add BUILD_LIBRARY_FOR_DISTRIBUTION
to FlatBuffers.podspec and Update CocoaPods Distribution Version #8329
Description
Description:
I am writing to request the addition of the following configuration to the FlatBuffers.podspec
file to ensure ABI stability and proper framework distribution:
s.pod_target_xcconfig = {
'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES'
}
Issue:
The latest version of FlatBuffers distributed to CocoaPods is 22.9.24
, even though the FlatBuffers.podspec
in the GitHub repository shows the version as 24.3.25
. The actual distributed FlatBuffers need to have the above code added to ensure proper functionality and avoid runtime errors.
Crash Log:
Due to the missing BUILD_LIBRARY_FOR_DISTRIBUTION = YES
setting, there are issues with ABI stability, causing the following crash:
dyld[84037]: Symbol not found: _$s11FlatBuffers0A12BufferObjectP8__bufferAA04ByteC0VSgvgTq
Referenced from: <6F79C456-C006-385E-AF9D-404B6D8F4386> /private/var/containers/Bundle/Application/55C0094C-F405-4EF0-8A8A-B2F10AE60E89/HelloWorld.app/Frameworks/KMLocationSDK.framework/KMLocationSDK
Expected in: <45E32326-5129-37E5-AFBC-68F64E132C9E> /private/var/containers/Bundle/Application/55C0094C-F405-4EF0-8A8A-B2F10AE60E89/HelloWorld.app/Frameworks/FlatBuffers.framework/FlatBuffers
Steps to Reproduce:
- Install and run a project that uses
FlatBuffers
as a dependency. - Integrate the
FlatBuffers
framework without theBUILD_LIBRARY_FOR_DISTRIBUTION
setting enabled. - Observe the runtime crash due to missing symbols.
Proposed Solution:
Please update the FlatBuffers.podspec
to include the following configuration:
s.pod_target_xcconfig = {
'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES'
}
This change will ensure ABI stability and prevent runtime crashes related to missing symbols.
Thank you for considering this request. Ensuring ABI stability is crucial for the smooth integration and functionality of projects relying on FlatBuffers.
Thank you for submitting an issue!
Please make sure you include the names of the affected language(s), compiler version(s), operating system version(s), and FlatBuffers version(s) in your issue title.
This helps us get the correct maintainers to look at your issue. Here are examples of good titles:
- Crash when accessing FlatBuffer [C++, gcc 4.8, OS X, master]
- Flatc converts a protobuf 'bytes' field to 'string' in fbs schema file [all languages, FlatBuffers 1.4]
Include other details as appropriate.
Thanks!