右下角一直是这样的状态👇
已经根据 《安装 rust 和配置国内镜像》 这篇文章配置了 rustup
和 cargo
的 ustc
镜像。
╭─bot@3c06302cdebd ~/Desktop/rust/hello-rust ‹master*›
╰─➤ which cargo
/Users/bot/.cargo/bin/cargo
╭─bot@3c06302cdebd ~/Desktop/rust/hello-rust ‹master*›
╰─➤ which rustup
/Users/bot/.cargo/bin/rustup
╭─bot@3c06302cdebd ~/Desktop/rust/hello-rust ‹master*›
╰─➤ echo $RUSTUP_DIST_SERVER
https://mirrors.ustc.edu.cn/rust-static
╭─bot@3c06302cdebd ~/Desktop/rust/hello-rust ‹master*›
╰─➤ echo $RUSTUP_UPDATE_ROOT
https://mirrors.ustc.edu.cn/rust-static/rustup
╭─bot@3c06302cdebd ~/Desktop/rust/hello-rust ‹master*›
╰─➤ cat ~/.cargo/config
[source.crates-io]
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"
但是直接在终端中使用 cargo build
是很快的,几秒钟就好了。
╭─bot@3c06302cdebd ~/Desktop/rust/hello-rust ‹master*›
╰─➤ cargo build
Updating `git://mirrors.ustc.edu.cn/crates.io-index` index
Downloaded ferris-says v0.2.1 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded smallvec v0.4.5 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded smawk v0.3.1 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded textwrap v0.13.4 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded unicode-width v0.1.9 (registry `git://mirrors.ustc.edu.cn/crates.io-index`)
Downloaded 5 crates (97.7 KB) in 7.51s
Compiling unicode-width v0.1.9
Compiling smawk v0.3.1
Compiling smallvec v0.4.5
Compiling textwrap v0.13.4
Compiling ferris-says v0.2.1
Compiling hello-rust v0.1.0 (/Users/bot/Desktop/rust/hello-rust)
Finished dev [unoptimized + debuginfo] target(s) in 1m 04s
cargo run
也是瞬间完成
╭─bot@3c06302cdebd ~/Desktop/rust/hello-rust ‹master*›
╰─➤ cargo run
Blocking waiting for file lock on package cache
Finished dev [unoptimized + debuginfo] target(s) in 11.26s
Running `target/debug/hello-rust`
Hello, world!
但是 clion
不管等上几个小时都永远是阻塞状态
下面是 clion
的版本信息
下面是 mac
信息