@ledsun blog

Hのキーがhellで、Sのキーがslaveだ、と彼は思った。そしてYのキーがyouだ。

cargo-edit

2.7 プロジェクト:マンデルブロー集合のレンダリングのサンプルプログラムを動かしたいです。 numというクレートを使うようです。

rustにはクレートと呼ばれるJavaScriptでのnpmパッケージのようなものがあり、インストールアンインストールにはnpmコマンドのようなcargoコマンドを使うようです。 今回は、numクレートを使うためにcargo add numします。 エラーが起きます。

f:id:ledsun:20220112044502p:plain
cargo addのエラー

cargo addを使うには、先にcargo-editを入れる必要がありました。 実行すると何かがたくさん入ってきます。

PS C:\Users\led_l\rust_land\mandelbrot> cargo install cargo-edit
    Updating crates.io index
  Downloaded cargo-edit v0.8.0
  Downloaded 1 crate (61.1 KB) in 0.87s
  Installing cargo-edit v0.8.0
  Downloaded addr2line v0.17.0
  Downloaded adler v1.0.2
  Downloaded aho-corasick v0.7.18
  Downloaded base64 v0.13.0
  Downloaded cargo-platform v0.1.2
  Downloaded clap v2.34.0
  Downloaded dirs-sys-next v0.1.2
  Downloaded gimli v0.26.1
  Downloaded heck v0.3.3
  Downloaded itoa v1.0.1
  Downloaded miniz_oxide v0.4.4
  Downloaded libgit2-sys v0.12.26+1.3.0
  Downloaded pkg-config v0.3.24
  Downloaded quote v1.0.14
  Downloaded rustc-demangle v0.1.21
  Downloaded rustls v0.19.1
  Downloaded static_assertions v1.1.0
  Downloaded syn v1.0.85
  Downloaded tinyvec v1.5.1
  Downloaded unicode-width v0.1.9
  Downloaded url v2.2.2
  Downloaded webpki v0.21.4
  Downloaded ws2_32-sys v0.2.1
  Downloaded byteorder v1.4.3
  Downloaded cfg-if v1.0.0
  Downloaded dunce v1.0.2
  Downloaded git2 v0.13.25
  Downloaded idna v0.2.3
  Downloaded libc v0.2.112
  Downloaded matches v0.1.9
  Downloaded proc-macro-error v1.0.4
  Downloaded regex-syntax v0.6.25
  Downloaded regex v1.5.4
  Downloaded structopt-derive v0.4.18
  Downloaded spin v0.5.2
  Downloaded unicode-bidi v0.3.7
  Downloaded ureq v1.5.5
  Downloaded webpki-roots v0.21.1
  Downloaded atty v0.2.14
  Downloaded camino v1.0.5
  Downloaded crates-index v0.17.0
  Downloaded form_urlencoded v1.0.1
  Downloaded indexmap v1.8.0
  Downloaded libz-sys v1.1.3
  Downloaded pathdiff v0.2.1
  Downloaded ring v0.16.20
  Downloaded serde v1.0.133
  Downloaded serde_derive v1.0.133
  Downloaded tinyvec_macros v0.1.0
  Downloaded textwrap v0.11.0
  Downloaded winapi v0.2.8
  Downloaded backtrace v0.3.63
  Downloaded chunked_transfer v1.4.0
  Downloaded either v1.6.1
  Downloaded home v0.5.3
  Downloaded memchr v2.4.1
  Downloaded proc-macro2 v1.0.36
  Downloaded serde_json v1.0.74
  Downloaded unicode-segmentation v1.8.0
  Downloaded subprocess v0.2.8
  Downloaded vec_map v0.8.2
  Downloaded winapi-util v0.1.5
  Downloaded hashbrown v0.11.2
  Downloaded combine v4.6.2
  Downloaded libssh2-sys v0.2.23
  Downloaded proc-macro-error-attr v1.0.4
  Downloaded smartstring v0.2.9
  Downloaded termcolor v1.1.2
  Downloaded term_size v0.3.2
  Downloaded autocfg v1.0.1
  Downloaded dirs-next v2.0.0
  Downloaded itertools v0.10.3
  Downloaded once_cell v1.9.0
  Downloaded semver v1.0.4
  Downloaded version_check v0.9.4
  Downloaded toml_edit v0.3.1
  Downloaded cargo_metadata v0.14.1
  Downloaded hex v0.4.3
  Downloaded log v0.4.14
  Downloaded object v0.27.1
  Downloaded vcpkg v0.2.15
  Downloaded jobserver v0.1.24
  Downloaded vec1 v1.8.0
  Downloaded structopt v0.3.25
  Downloaded qstring v0.7.2
  Downloaded bytes v1.1.0
  Downloaded lazy_static v1.4.0
  Downloaded strsim v0.8.0
  Downloaded winapi-build v0.1.1
  Downloaded glob v0.3.0
  Downloaded unicode-normalization v0.1.19
  Downloaded cc v1.0.72
  Downloaded sct v0.6.1
  Downloaded env_proxy v0.4.1
  Downloaded socks v0.3.3
  Downloaded error-chain v0.12.4
  Downloaded bitflags v1.3.2
  Downloaded percent-encoding v2.1.0
  Downloaded ryu v1.0.9
  Downloaded unicode-xid v0.2.2
  Downloaded untrusted v0.7.1
  Downloaded winapi v0.3.9
  Downloaded 102 crates (16.4 MB) in 11.62s (largest was `ring` at 5.1 MB)
   Compiling jobserver v0.1.24
   Compiling winapi v0.3.9
   Compiling proc-macro2 v1.0.36
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.85
   Compiling serde_derive v1.0.133
   Compiling serde v1.0.133
   Compiling pkg-config v0.3.24
   Compiling version_check v0.9.4
   Compiling memchr v2.4.1
   Compiling vcpkg v0.2.15
   Compiling libc v0.2.112
   Compiling cfg-if v1.0.0
   Compiling autocfg v1.0.1
   Compiling tinyvec_macros v0.1.0
   Compiling log v0.4.14
   Compiling percent-encoding v2.1.0
   Compiling matches v0.1.9
   Compiling untrusted v0.7.1
   Compiling spin v0.5.2
   Compiling unicode-bidi v0.3.7
   Compiling winapi-build v0.1.1
   Compiling serde_json v1.0.74
   Compiling semver v1.0.4
   Compiling bitflags v1.3.2
   Compiling itoa v1.0.1
   Compiling ryu v1.0.9
   Compiling camino v1.0.5
   Compiling winapi v0.2.8
   Compiling adler v1.0.2
   Compiling unicode-width v0.1.9
   Compiling unicode-segmentation v1.8.0
   Compiling gimli v0.26.1
   Compiling static_assertions v1.1.0
   Compiling rustc-demangle v0.1.21
   Compiling byteorder v1.4.3
   Compiling either v1.6.1
   Compiling base64 v0.13.0
   Compiling bytes v1.1.0
   Compiling strsim v0.8.0
   Compiling hashbrown v0.11.2
   Compiling vec_map v0.8.2
   Compiling vec1 v1.8.0
   Compiling chunked_transfer v1.4.0
   Compiling glob v0.3.0
   Compiling once_cell v1.9.0
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.25
   Compiling dunce v1.0.2
   Compiling pathdiff v0.2.1
   Compiling cc v1.0.72
   Compiling tinyvec v1.5.1
   Compiling qstring v0.7.2
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling error-chain v0.12.4
   Compiling form_urlencoded v1.0.1
   Compiling ws2_32-sys v0.2.1
   Compiling miniz_oxide v0.4.4
   Compiling indexmap v1.8.0
   Compiling itertools v0.10.3
   Compiling heck v0.3.3
   Compiling addr2line v0.17.0
   Compiling unicode-normalization v0.1.19
   Compiling libz-sys v1.1.3
   Compiling ring v0.16.20
   Compiling libssh2-sys v0.2.23
   Compiling libgit2-sys v0.12.26+1.3.0
   Compiling backtrace v0.3.63
   Compiling quote v1.0.14
   Compiling object v0.27.1
   Compiling aho-corasick v0.7.18
   Compiling combine v4.6.2
   Compiling idna v0.2.3
   Compiling regex v1.5.4
   Compiling url v2.2.2
   Compiling term_size v0.3.2
   Compiling atty v0.2.14
   Compiling dirs-sys-next v0.1.2
   Compiling home v0.5.3
   Compiling winapi-util v0.1.5
   Compiling subprocess v0.2.8
   Compiling textwrap v0.11.0
   Compiling env_proxy v0.4.1
   Compiling dirs-next v2.0.0
   Compiling termcolor v1.1.2
   Compiling clap v2.34.0
   Compiling socks v0.3.3
   Compiling structopt-derive v0.4.18
   Compiling webpki v0.21.4
   Compiling sct v0.6.1
   Compiling structopt v0.3.25
   Compiling webpki-roots v0.21.1
   Compiling rustls v0.19.1
   Compiling cargo-platform v0.1.2
   Compiling hex v0.4.3
   Compiling smartstring v0.2.9
   Compiling toml_edit v0.3.1
   Compiling cargo_metadata v0.14.1
   Compiling ureq v1.5.5
   Compiling git2 v0.13.25
   Compiling crates-index v0.17.0
   Compiling cargo-edit v0.8.0
    Finished release [optimized] target(s) in 2m 20s
  Installing C:\Users\led_l\.cargo\bin\cargo-add.exe
  Installing C:\Users\led_l\.cargo\bin\cargo-rm.exe
  Installing C:\Users\led_l\.cargo\bin\cargo-set-version.exe
  Installing C:\Users\led_l\.cargo\bin\cargo-upgrade.exe
   Installed package `cargo-edit v0.8.0` (executables `cargo-add.exe`, `cargo-rm.exe`, `cargo-set-version.exe`, `cargo-upgrade.exe`)

ふたたびcargo add numします。

f:id:ledsun:20220112045157p:plain
今度は成功しました。

参考