-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for BUILD_LIBRARY_FOR_DISTRIBUTION=YES #4
Comments
Hi @mikehouse thanks for submitting this issue. Not sure exactly what the right approach to solve this is. Either we need to rename the package (breaking) or we need to rename the The swift issue you linked proposes:
However, I am concerned about the reliability. Since this issue is only present when building the library using BUILD_LIBRARY_FOR_DISTRIBUTION=YES I am hesitant to potentially break the class conformances for a non-standard use case. Are you aware of any other approaches that might work around this issue without renaming either the module or the class, or using the -Xfrontend -module-interface-preserve-types-as-written swift flags? |
Hi @bgiori. Yes, we found that just fixing private.swiftinterface is enough. We run such script after Carthage finished building libraries if [[ -d ./Carthage/Build/AnalyticsConnector.xcframework ]]; then
for swiftinterface in $(find ./Carthage/Build/AnalyticsConnector.xcframework -type f -name "*private.swiftinterface"); do
sed -i '' 's/AnalyticsConnector\.//' "${swiftinterface}"
done
fi
if [[ -d ./Carthage/Build/Experiment.xcframework ]]; then
for swiftinterface in $(find ./Carthage/Build/Experiment.xcframework -type f -name "*private.swiftinterface"); do
sed -i '' 's/Experiment\.//' "${swiftinterface}"
sed -i '' 's/Experiment\.//' "${swiftinterface}"
sed -i '' 's/Experiment\.//' "${swiftinterface}"
done
fi Thank you. |
While it doesn't quite resolve the issue if building from source, we have begun to distribute a precompiled version of this framework in our releases. Carthage should automatically default to this precompiled version. Thanks to @mikehouse for script to fix the conflicting module names. |
Hi. We've built the library with one version of swift compiler (Xcode 15.1/15.2) using BUILD_LIBRARY_FOR_DISTRIBUTION=YES and linked the library to a project that uses Xcode 15.3. After adding the library the project cannot be compiled anymore. The reason is names collision because of Swift compiler bug swiftlang/swift#56573. We fixed it by modifying private.swiftinterface file after it being built.
Xcode shows such error when open the project analytics-connector-ios
The text was updated successfully, but these errors were encountered: