2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rust 1.84.0にアップデート時に発生した "error: component 'rust-std' for target 'wasm32-wasi' is unavailable for download for channel 'stable'" エラーの解消方法

Posted at

rustupでRust 1.84.0にアップデートしようとしたところ、以下のエラーが発生しました。

$ rustup update
info: syncing channel updates for 'stable-aarch64-apple-darwin'
info: latest update on 2025-01-09, rust version 1.84.0 (9fc6b4312 2025-01-07)
error: component 'rust-std' for target 'wasm32-wasi' is unavailable for download for channel 'stable'
error: If you don't need the component, you could try a minimal installation with:
error:
error:     rustup toolchain add stable --profile minimal
error:
error: If you require these components, please install and use the latest successful build version,
error: which you can find at <https://rust-lang.github.io/rustup-components-history>.
error:
error: After determining the correct date, install it with a command such as:
error:
error:     rustup toolchain install nightly-2018-12-27
error:
error: Then you can use the toolchain with commands such as:
error:
error:     cargo +nightly-2018-12-27 build

  stable-aarch64-apple-darwin update failed - rustc 1.83.0 (90b35a623 2024-11-26)

info: cleaning up downloads & tmp directories
info: self-update is disabled for this build of rustup
info: any updates to rustup will need to be fetched with your system package manager

エラーの原因を調べたところ、WASI 0.2がリリースされた関係でRust 1.84.0からターゲットに新たに wasm32-wasip2 が追加され、さらにWASI 0.1と区別するため wasm32-wasiwasm32-wasip1 にリネームされた模様です。

エラー解消方法

rustupのターゲットから wasm32-wasi を取り除く必要があります。

まず追加済みのターゲットを確認します。

$ rustup target list --installed
aarch64-apple-darwin
aarch64-unknown-linux-gnu
aarch64-unknown-linux-musl
wasm32-unknown-unknown
wasm32-wasi
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

wasm32-wasi が含まれているのが確認できたので、これを取り除きます。

rustup target remove wasm32-wasi

そして改めて rustup update を実行します。

rustup update

無事アップデートできれば完了です。

あとは必要に応じて、wasm32-wasip1wasm32-wasip2 をターゲットに追加するとよさそうです。

# WASI 2.0
rustup target add wasm32-wasip2

# WASI 1.0 (旧wasm32-wasi)
rustup target add wasm32-wasip1

めでたしめでt

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?