1
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?

More than 3 years have passed since last update.

WSL1(Ubuntu20.04)にRustをインストールしようとしてエラーが出た時の解決方法

Last updated at Posted at 2020-08-01

エラー内容

公式の通りにcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh を実行すると以下のエラーが発生

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `22`,
 right: `4`', src/libstd/sys/unix/thread.rs:179:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `22`,
 right: `4`', src/libstd/sys/unix/thread.rs:179:21
stack backtrace:
   0:     0x7f21efcdaffd - backtrace::backtrace::libunwind::trace::h812748238d609e46
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1:     0x7f21efcdaffd - backtrace::backtrace::trace_unsynchronized::h7c97e818aebf09c8
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2:     0x7f21efcdaffd - std::sys_common::backtrace::_print_fmt::h60d914263b0ccd71
                               at src/libstd/sys_common/backtrace.rs:78
   3:     0x7f21efcdaffd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf78227137afc7565
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x7f21ef96524c - core::fmt::write::h543cdf60775f89bf
                               at src/libcore/fmt/mod.rs:1069
   5:     0x7f21efcda904 - std::io::Write::write_fmt::h0c7f3ce24c679426
                               at src/libstd/io/mod.rs:1504
   6:     0x7f21efcda105 - std::sys_common::backtrace::_print::h80e55e24be231368
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x7f21efcda105 - std::sys_common::backtrace::print::h3b197b9c1261c865
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x7f21efcda105 - std::panicking::default_hook::{{closure}}::ha6c807149ce20f8f
                               at src/libstd/panicking.rs:198
   9:     0x7f21efcd98f4 - std::panicking::default_hook::he49a9c12e358cc45
                               at src/libstd/panicking.rs:218
  10:     0x7f21efcd93b6 - std::panicking::rust_panic_with_hook::h93f74f5ef2f71f31
                               at src/libstd/panicking.rs:515
  11:     0x7f21efcd9198 - rust_begin_unwind
                               at src/libstd/panicking.rs:419
  12:     0x7f21efcd9140 - std::panicking::begin_panic_fmt::hfa6ef29ba81f400e
                               at src/libstd/panicking.rs:373
  13:     0x7f21efc11671 - <rustup::diskio::threaded::Threaded as rustup::diskio::Executor>::join::habf6ee901a47a8a4
  14:     0x7f21efc10c78 - core::ptr::drop_in_place::h0b1b0dcb4b07c267
  15:     0x7f21efb76c40 - core::ptr::drop_in_place::h09572fbec04e583f
  16:     0x7f21efc2842e - rustup::dist::component::package::unpack_without_first_dir::h99f4b0c2cae349ff
  17:     0x7f21efbe559f - rustup::dist::manifestation::Manifestation::update::hacf67fad3b44f03a
  18:     0x7f21efbd563c - rustup::dist::dist::update_from_dist_::h1462627f9c58c494
  19:     0x7f21efbd227a - rustup::install::InstallMethod::install::hbb6430b2dfaf5792
  20:     0x7f21efbd0d21 - rustup::toolchain::DistributableToolchain::install_from_dist::h7b9bf9317c9aa2c5
  21:     0x7f21efcc5aa2 - rustup::cli::self_update::install::h8ca0f61a773526a9
  22:     0x7f21efccbd3d - rustup::cli::setup_mode::main::h4d335e1871435d70
  23:     0x7f21ef8df42a - rustup_init::main::h22da971c634937a2
  24:     0x7f21efcf3e83 - std::rt::lang_start_internal::{{closure}}::{{closure}}::h4ed4ab1fb893cc93
                               at src/libstd/rt.rs:52
  25:     0x7f21efcf3e83 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1f01c818c00c4f70
                               at src/libstd/sys_common/backtrace.rs:130
  26:     0x7f21ef8e053f - main
  27:     0x7f21ef4b70b3 - __libc_start_main
  28:     0x7f21ef8db029 - <unknown>
thread panicked while panicking. aborting.
Illegal instruction (core dumped)

環境

powershell
PS > wsl --list --verbose
  NAME                   STATE           VERSION
  Ubuntu                 Running         1
wsl
$ cat /etc/issue
Ubuntu 20.04.1 LTS \n \l

解決方法

1. WSL2にアップグレードする

WSL2ではインストールすることができました。

2. 古いバージョンのUbuntuを使う

Ubuntu18.04ではインストールすることができました。

3. 環境変数 RUSTUP_IO_THREADS=1 を設定する

export RUSTUP_IO_THREADS=1
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

環境変数 RUSTUP_IO_THREADS=1 を設定するとWSL1, Ubuntu20.04 でもインストールすることができました!

参考: https://github.com/rust-lang/rustup/issues/2245

1
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
1
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?