signalapp / libsignal

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.
GNU Affero General Public License v3.0
3.63k stars 420 forks source link

Compiler error integrating from CocoaPods since version 1.16.0 #594

Closed arivas87 closed 3 weeks ago

arivas87 commented 3 weeks ago
ld: warning: Could not find or use auto-linked library 'signal_ffi': library 'signal_ffi' not found
Undefined symbols for architecture arm64:
  "LibSignalClient.NativeHandleOwner.__allocating_init(borrowing: Swift.OpaquePointer?) -> LibSignalClient.NativeHandleOwner", referenced from:
      full type metadata for LibSignalClient.Aes256Ctr32 in Aes256Ctr.o
      full type metadata for LibSignalClient.Aes256GcmEncryption in Aes256Gcm.o
      full type metadata for LibSignalClient.Aes256GcmDecryption in Aes256Gcm.o
      full type metadata for LibSignalClient.Aes256GcmSiv in Aes256GcmSiv.o
      full type metadata for LibSignalClient.Cds2Client in Cds2.o
      full type metadata for LibSignalClient.ChatListenerBridge.(AckHandleOwner in _7880CDAD24B1514BE930FD806DBED1E8) in ChatListener.o
      full type metadata for LibSignalClient.AuthenticatedChatService in ChatService.o
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
jrose-signal commented 3 weeks ago

Hm, those are missing Swift symbols, in addition to the missing Rust library. *attempts psychic debugging* Is it possible you only have a build for the x86_64 simulator, but are now running on an arm64 Mac?

Other than that, I'll have to try it out later, none of the 1.16.0 release notes suggest a change that would cause this problem. (Are you integrating using a repository dependency or a local path dependency?)

jrose-signal commented 3 weeks ago

Doing some local testing, it also seems like 1.16 turns on "Build Library for Distribution" for dependencies, which is (a) not a valid thing for them to be doing, and (b) not supported by libsignal. I don't know if that's the cause of these errors (I got a compilation error before even getting to linking), but it's something to be aware of.

jrose-signal commented 3 weeks ago

Looks like they're reverting that, so maybe there'll be a 1.16 update soon to get past that issue. Then we'll see if there's another one for you. https://github.com/CocoaPods/Xcodeproj/pull/992

arivas87 commented 3 weeks ago

Sure! It seems to work with the latest CocoaPods release. Due to the end of active support, it would be great to start thinking about a migration to SwiftPM.

jrose-signal commented 3 weeks ago

Only when Signal-iOS does, and I think that's a ways off, but I'll let the iOS team know. For now, closing this, glad it works!