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.05k stars 359 forks source link

I cannot install libraries using Cocoa pods on my Xcode project. #566

Closed zydeico closed 3 months ago

zydeico commented 3 months ago

I'm trying to install it using Cocoa pods but I get an error while compiles my project, on my Podfile I have the next following error code

  1. My podfile looks like:
 platform :ios, '16.0'

target 'MyProject' do
  use_frameworks!

  pod 'LibSignalClient', git: 'https://github.com/signalapp/libsignal.git'
  pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git'
  ENV['LIBSIGNAL_FFI_PREBUILD_CHECKSUM'] ='240415c6f173ffb41f4c3314294b80955c33c85c04244a166b24319b90766c60'

end
  1. According the repo documentation I download the release 0.41.1, on my terminal I type:
    $ shasum libsignal-client-ios-build-v0.41.1.tar.gz.sha256
    240415c6f173ffb41f4c3314294b80955c33c85c04244a166b24319b90766c60  libsignal-client-ios-build-v0.41.1.tar.gz.sha256

And while ends compile I get this error:

Command PhaseScriptExecution failed with a nonzero exit code
downloading libsignal-client-ios-build-v0.41.1.tar.gz...
Traceback (most recent call last):
  File "/Users/daniel/Documents/Xcode/MyProject-iOS/Pods/LibSignalClient/bin/fetch_archive.py", line 79, in <module>
    main()
  File "/Users/daniel/Documents/Xcode/MyProject-iOS/Pods/LibSignalClient/bin/fetch_archive.py", line 76, in main
    download_if_needed(archive_file, args.url, args.checksum)
  File "/Users/daniel/Documents/Xcode/MyProject-iOS/Pods/LibSignalClient/bin/fetch_archive.py", line 61, in download_if_needed
    assert digest.hexdigest() == checksum.lower(), "expected {}, actual {}".format(checksum.lower(), digest.hexdigest())
AssertionError: expected 573b46c55df3059da67797963f7b7ef6e88c936323ad5a3158dd23c4fdcfdcd6, actual aa58b6095538f9415786463d8d0a80af23e27d84c931fb633031acfce9fa5e49
Command PhaseScriptExecution failed with a nonzero exit code
jrose-signal commented 3 months ago

shasum libsignal-client-ios-build-v0.41.1.tar.gz.sha256

This is getting the shasum of a shasum. The contents of the file have the checksum you should use.

zydeico commented 3 months ago

@jrose-signal how I can get if are installed via Cocoapods ?

jrose-signal commented 3 months ago

You should look inside libsignal-client-ios-build-v0.41.1.tar.gz.sha256, and copy that sum into your podfile.

zydeico commented 3 months ago

I'm looking inside by using my command

sha256sum libsignal-client-ios-build-v0.41.1.tar.gz.sha256
240415c6f173ffb41f4c3314294b80955c33c85c04244a166b24319b90766c60  libsignal-client-ios-build-v0.41.1.tar.gz.sha256

But if I use this sum, I get the same error on Xcode image

jrose-signal commented 3 months ago

sha256sum computes the SHA-256 sum of the file you pass as an argument. In this case, you just want cat, or to open the file in a text editor. (Note the ".sha256" extension; this is not the archive being downloaded and checked!)

zydeico commented 3 months ago

I'm trying to get the sum, but I only get this results on my terminal, what I'm doing wrong? The values are not equal, but, If I use the cat result, both are wrong and, on my Podfile not works that

image

jrose-signal commented 3 months ago

The archives are not available on GitHub; they're hosted on Signal's CDN. When I download those and run sha256sum on them I do get the same values as what's in the .sha256 files (e.g. 8a3bb19afe…). You can see this in the script phases added by LibSignalClient.podspec.

main right now is the same commit as 0.41.1 (which you can tell because that's what's in the build log), so aa58b60… is the hash you should probably use. Or you can put an explicit tag in your Podfile (maybe we should suggest that in the README?) to use the slightly newer 0.41.2.

zydeico commented 3 months ago

🤔I tried to specify the commit version on my Podfile, but, not works, I got the same error

 pod 'LibSignalClient', :git => 'https://github.com/signalapp/libsignal.git', :commit => 'aa58b60'
 pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git'
 ENV['LIBSIGNAL_FFI_PREBUILD_CHECKSUM'] = '8a3bb19afe41e3d4b55b0e19664889fba46641e51a2662e2d527c28ea661eace'

image image

jrose-signal commented 3 months ago

You picked the revision tagged as v0.41.1, so you should use the checksum from v0.41.1.

(CocoaPods also lets you write tag: 'v0.41.1', which may be clearer, but up to you.)

zydeico commented 3 months ago

@jrose-signal if I specify the version by using pod 'LibSignalClient', git: 'https://github.com/signalapp/libsignal.git', tag: 'v0.41.1', the error continues 😞 I cannot solve the error, can you please give more detailed instructions ? Or if you have any Signal blog link (I check the project issues too and can't find any solution) 🙏🏻 image

zydeico commented 3 months ago

@jrose-signal I installed the last release 0.42.0 and works perfect! Using the 76d61... sum