iOS target is installed, yet not found?


I’ve followed what seems to be the standard process of rustup target add... and yet cannot build those targets. (I have the Xcode toolchain installed, including command-line tools. I build plenty of open source using configure and make so that’s not an issue. Instead of further description, let me just illustrate. Here’s what’s installed:

$ rustup show
Default host: x86_64-apple-darwin

installed toolchains

stable-x86_64-apple-darwin (default)

installed targets for active toolchain


active toolchain

stable-x86_64-apple-darwin (default)
rustc 1.32.0 (9fda7c223 2019-01-16)

Yet if I try to build using one of the targets I added:

$ cargo build --target=aarch64-apple-ios
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --target aarch64-apple-ios --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (exit code: 1)
--- stderr
error: Error loading target specification: Could not find specification for target "aarch64-apple-ios"
  = help: Use `--print target-list` for a list of built-in targets

And, in fact:

$ rustc --print target-list | grep ios

And of course, I was trying cargo-lipo first, and got the same error. Specifying a single specific architecture, creating a new empty library crate & and just adding a minimal [lib] config, were some attempts to troubleshoot this.

So how can this happen? And how to fix it?