I try to add *-apple-ios targets to cargo/rustc to build a tiny library running on iOS.
However, the rustc does not recognize the added targets.
I tried this:
$ rustup target add aarch64-apple-ios armv7s-apple-ios armv7-apple-ios x86_64-apple-ios i386-apple-ios
info: downloading component 'rust-std' for 'aarch64-apple-ios'
info: installing component 'rust-std' for 'aarch64-apple-ios'
info: downloading component 'rust-std' for 'armv7s-apple-ios'
info: installing component 'rust-std' for 'armv7s-apple-ios'
info: downloading component 'rust-std' for 'armv7-apple-ios'
info: installing component 'rust-std' for 'armv7-apple-ios'
info: downloading component 'rust-std' for 'x86_64-apple-ios'
info: installing component 'rust-std' for 'x86_64-apple-ios'
info: downloading component 'rust-std' for 'i386-apple-ios'
info: installing component 'rust-std' for 'i386-apple-ios'
I expected to see this happen:
$ rustup run nightly rustc --print target-list | grep ios
aarch64-apple-ios
armv7-apple-ios
armv7s-apple-ios
i386-apple-ios
x86_64-apple-ios
Instead, this happened:
$ rustup run nightly rustc --print target-list | grep ios
// no lines appeared
I'm using:
$ uname -a
Darwin <my hostname> 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64 // macOS High Sierra 10.13.1(17B1003)
$ rustup --version
rustup 1.7.0 (813f7b7a8 2017-10-30)
$ rustup run nightly rustc -V
rustc 1.24.0-nightly (5a2465e2b 2017-12-06)
Me and @asomers have both run into this problem as well. It looks like rustc for these targets in not installed properly even though std is.
you need to have xcode installed , full xcode .. not just the cli tools.
xcode-select --print-path
sudo xcodebuild -license
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
there is no hints nor information but this is required for the ios target to show up for rust (which make sens) , see https://github.com/rust-lang/rust/issues/36157
@mtrey neither @asomers not I arerunning OS X so that doesn't apply to us. It's not clear if @moritorus is cross-compiling as well, but I inferred from this issues description that they were.
@Susurrus : without xcode no ios target
unless there is something I missed : no macos -> no xcode -> no ios
edit : I have just installed a new mac for cross compiling , run into the issue you described , compared with a working node .. hence my comment
That makes sense for cargo build, but I'm wondering if cargo check could be supported for all targets on all platforms since it doesn't go through to generating a binary.
Please open an issue on rust-lang/rust for the cargo check feature.
Most helpful comment
you need to have xcode installed , full xcode .. not just the cli tools.
there is no hints nor information but this is required for the ios target to show up for rust (which make sens) , see https://github.com/rust-lang/rust/issues/36157