配置cargo国内源

配置cargo国内源

1,配置cargo国内源

env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean all
  • Updating crates.io index更新慢
+ local '__rust_flags=--print native-static-libs -C target-feature=+sse4.1,+sse4.2,+avx,+avx2,+sse2,+sha,+adx,'
+ RUSTFLAGS='--print native-static-libs -C target-feature=+sse4.1,+sse4.2,+avx,+avx2,+sse2,+sha,+adx,'
+ cargo +nightly-2020-03-19 build --release
+ tee /storage/lotuswork/tmpdir/tmp.ycbzTmDKrQ
    Updating crates.io index
  • /root/.cargo新建配置文件config
  • cat /root/.cargo/config
[source.crates-io]
replace-with = 'tuna'

[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
# cargo install cargo-rls-install

  • 默认y
# cargo rls-install -i nightly-2020-03-19
# rustc -V
rustc 1.44.0-nightly (f509b26a7 2020-03-18)

参考:

  1. cargo-rls-install
  2. 配置 cargo 源

猜你喜欢

转载自blog.csdn.net/u010953692/article/details/106464851