出现错误 "some components unavailable for target i386-apple-ios/armv7s-apple-ios" 时如何更新稳定工具链?

How can I update the stable toolchain when I get the error "some components unavailable for target i386-apple-ios/armv7s-apple-ios"?

我尝试运行

rustup update stable

我得到以下输出。

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2020-05-07, rust version 1.43.1 (8d69840ab 2020-05-04)
error: some components unavailable for download for channel stable: 'rust-std' for target 'i386-apple-ios', 'rust-std' for target 'armv7s-apple-ios', 'rust-std' for target 'armv7-apple-ios'
If you require these components, please install and use the latest successful build version,
which you can find at <https://rust-lang.github.io/rustup-components-history>.

After determining the correct date, install it with a command such as:

    rustup toolchain install nightly-2018-12-27

Then you can use the toolchain with commands such as:

    cargo +nightly-2018-12-27 build

虽然我可以使用

安装最新的稳定工具链
rustup toolchain install stable-2020-05-07

这将创建一个单独的工具链。

rustup toolchain list
stable-2020-05-07-x86_64-unknown-linux-gnu (default)
stable-x86_64-unknown-linux-gnu
nightly-2020-05-07-x86_64-unknown-linux-gnu

我可以使用这个新的工具链作为默认工具链(就像我现在一样),但是向前推进会很痛苦,因为我不能只使用 rustup update.

运行 rustup toolchain install stable 产生相同的错误。

如何通过 rustup update run 更新稳定的 Rust 工具链?

The Rust team regrets to announce that Rust 1.41.0 (to be released on January 30th, 2020) will be the last release with the current level of support for 32-bit Apple targets. Starting from Rust 1.42.0, those targets will be demoted to Tier 3.

Reducing support for 32-bit Apple targets

您将需要使用 rustup component remove 删除这些组件。我无法测试确切的调用,但类似于:

rustup component remove --toolchain stable --target i386-apple-ios rust-std
rustup component remove --toolchain stable --target armv7s-apple-ios rust-std
rustup component remove --toolchain stable --target armv7-apple-ios rust-std

删除后,您可以更新编译器。