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.08k stars 362 forks source link

[Swift][Pod] Failed to download 'libSignalClient' #463

Closed JuyeonYu closed 2 years ago

JuyeonYu commented 2 years ago

pod 'LibSignalClient', git: 'https://github.com/signalapp/libsignal.git' pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git'

following ReadMe.MD, I added those 2lines of code in my Podfile. but I can't install the pods.

this is the log.

-- [!] Failed to download 'libSignalClient': [!] /bin/bash -c set -e set -euo pipefail CARGO_BUILD_TARGET=aarch64-apple-ios swift/build_ffi.sh --release CARGO_BUILD_TARGET=x86_64-apple-ios swift/build_ffi.sh --release CARGO_BUILD_TARGET=aarch64-apple-ios-sim swift/build_ffi.sh --release CARGO_BUILD_TARGET=x86_64-apple-ios-macabi swift/build_ffi.sh --release --build-std CARGO_BUILD_TARGET=aarch64-apple-ios-macabi swift/build_ffi.sh --release --build-std

cargo build -p libsignal-ffi --release --target aarch64-apple-ios Compiling proc-macro2 v1.0.29 Compiling unicode-xid v0.2.2 Compiling syn v1.0.80 Compiling libc v0.2.121 Compiling typenum v1.15.0 Compiling version_check v0.9.4 Compiling cfg-if v1.0.0 Compiling autocfg v1.1.0 error[E0463]: can't find crate for core | = note: the aarch64-apple-ios target may not be installed = help: consider downloading the target with rustup target add aarch64-apple-ios

error[E0463]: can't find crate for compiler_builtins

For more information about this error, try rustc --explain E0463. error: could not compile cfg-if due to 2 previous errors warning: build failed, waiting for other jobs to finish... error: build failed

--

so I excuted rustup target add aarch64-apple-ios but same condition.

is there something can I do?

jrose-signal commented 2 years ago

I'm sorry, the error message should be clearer than it is: you specifically have to run rustup target add … for the toolchain that LibSignalClient uses. You can do this by running the command in the Pods/LibSignalClient directory, or by running it as rustup +$(cat Pods/LibSignalClient/rust-toolchain) target …. Let me know if that works (you'll have to add the simulator targets as well).

JuyeonYu commented 2 years ago

Thank you for the reply. now I can't run the command in the Pods/LibSignalClient directory, because Pod install goes to fail. There is no LibSignalClient directory under Pods.

Sorry for my insufficiency. now I'm building an iOS chat app with MacOS Monterey, and decide to use Signal protocol for encrypt.

for the Rust, I installed Rust with curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

default host triple: x86_64-apple-darwin
default toolchain: stable (default)
profile: default
modify PATH variable: yes

this is the config.

rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.61.0 (fe5b13d68 2022-05-18)`

it's my Rust version information.

for the iOS, I made new project with Xcode and ran Pod init in the Podfile, under use_frameworks!, I added those pods git link following READ.MD and Pod install goes to fail with the error log.

is this correct process for using libsignal? is there something I misunderstand, please let me know.

JuyeonYu commented 2 years ago

In my brew list, there is another Rust! that was the problem. I removed it. all things clear. thank you.