firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

SwiftPM Firestore: SSL symbol collision

Open paulb777 opened this issue 5 years ago • 6 comments

The Swift Package Manager implementation of the Firestore BoringSSL dependency does not do symbol renaming like its CocoaPods implementation. This may cause potential symbol collision issues for apps that link another SSL implementation.

Please thumbs-up this issue to help us prioritize if it impacts your app.

paulb777 avatar Oct 29 '20 17:10 paulb777

For grpc-swift, see #7508 and https://github.com/apple/swift-nio-ssl/pull/269

paulb777 avatar Feb 11 '21 17:02 paulb777

Some additional detail notes from a conversation with @wilhuff:

Specifically there is still a potential symbol collision with OpenSSL.

Unlike the CocoaPods version of BoringSSL, the SPM version does not do symbol renaming.

For SPM, we'd likely need to do a source transformation to rename, since SPM does not support preprocessing like podspecs do.

Alternatively, we could switch the SPM version to depend on swift-nio-ssl instead but that would be inconsistent with the CocoaPods distribution.

Even more ideal would be for gRPC and gRPC-Swift to agree upon the same BoringSSL implementation and then Firebase use the same for both CocoaPods and SPM

paulb777 avatar Feb 11 '21 17:02 paulb777

Xcode 13.3 introduces build tool plugins, which might make it more feasible for the BoringSSL Package.swift to do a renaming similar to do what is done with CocoaPods. See https://developer.apple.com/documentation/xcode-release-notes/xcode-13_3-release-notes.

cc: @wu-hui @dennycd

paulb777 avatar Jan 28 '22 00:01 paulb777

We have duplicated symbols because of another project which uses another version of BoringSSL. It's needed to scope your version for your use cases.

mrgrauel avatar Oct 27 '22 09:10 mrgrauel

Hello @paulb777

Is there any chance to assign a higher priority to this issue? We're currently in the process of migrating our codebase from cocoa pods to spm and are experiencing this issue, just as described in this swift forums thread - the symbol collision is between openssl included by another dependency and boringssl from firebase.

jzaczek avatar Dec 14 '22 14:12 jzaczek

Thanks for the upvotes. I've had conversations with the gRPC team about this and hopeful to get it on the roadmap for the first quarter of 2023

paulb777 avatar Dec 22 '22 15:12 paulb777

We're starting to look into this issue. But would it be possible for us to get example project with the above mentioned collision? So that we could use it to verify that our fix works. Thanks!

@paulb777 FYI :)

sampajano avatar Feb 06 '23 22:02 sampajano

Xcode 13.3 introduces build tool plugins

We are still using Xcode 11.3 unfortunately. The upgrade to Monterey (with Xcode 13.4) is in-progress I however have no idea when it'll happen.

HannahShiSFB avatar Feb 15 '23 17:02 HannahShiSFB

@sampajano @paulb777 do you have a fix? Maybe you could provide a (unstable) branch which we could use together with swift package manager. Then we could give you some feedback :)

immi-sipgate avatar Feb 16 '23 14:02 immi-sipgate

This was fixed in Firebase 10.8.0 when we fixed to a binary distribution built from the CocoaPods distribution with symbol renaming.

paulb777 avatar Apr 20 '23 20:04 paulb777

Works but now the dsym upload to crashlytics doesnt work anymore. We have no crashlogs @paulb777

immi-sipgate avatar May 17 '23 07:05 immi-sipgate