当前位置: 首页 > news >正文

Rust国内sparse镜像源配置

文章目录

  • 1. 遇到问题
    • 1.1 问题现象
    • 1.2 解决办法
  • 2. 重新设置最新 sparse源
  • 3. 更多参考资料
    • 3.1 字节源
    • 3.2 ustc 源
    • 3.3 清华源
    • 3.4 其他人的总结

1. 遇到问题

有好一阵子没有更新源和安装软件了, 使用ustc的源, 更新了好一阵子, 最后安装居然还出现网络错误。。。。

1.1 问题现象

warning: spurious network error (3 tries remaining)

$ cargo install cargo-asm
    Updating `ustc` index
warning: spurious network error (3 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2))
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 3 was not closed cleanly: INTERNAL_ERROR (err 2))
warning: spurious network error (1 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 5 was not closed cleanly: INTERNAL_ERROR (err 2))
error: failed to download from `https://crates-io.proxy.ustclug.org/api/v1/crates/cargo-asm/0.1.16/download`

1.2 解决办法

cargo 1.68 版本开始支持稀疏索引:不再需要完整克隆 crates.io-index 仓库,可以加快获取包的速度。如果您的 cargo 版本大于等于 1.68,可以在 $CARGO_HOME/config 中添加后面的内容:

注:sparse+ 表示在使用稀疏索引,链接末尾的 / 不能缺少。

注:$CARGO_HOME:在 Windows 系统默认为: %USERPROFILE%\.cargo,在类 Unix 系统默认为:$HOME/.cargo

建议 设置新的 sparse 的更新模式, 避免下载整个库, 切换也很灵活, 偶然发现字节的源速度还挺快, 故切换之;
在这里插入图片描述

2. 重新设置最新 sparse源

修改 ~/.cargo/config 文件, 并设置如下的内容: 可以按需修改 replace-with 的那一行, 我目前换成了 字节 的源, 还挺快的;

我的汇总后的当前配置如下:

[source.crates-io]
replace-with = 'ustc'

[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"

[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"

[source.ustc]
registry = "sparse+https://mirrors.ustc.edu.cn/crates.io-index/"

[source.tuna]
registry = "sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/"

[net]
git-fetch-with-cli = true

3. 更多参考资料

3.1 字节源

  • https://rsproxy.cn/

3.2 ustc 源

  • https://mirrors.ustc.edu.cn/help/crates.io-index.html

3.3 清华源

  • https://mirrors.tuna.tsinghua.edu.cn/help/crates.io-index/

3.4 其他人的总结

  • https://blog.csdn.net/qq_28550263/article/details/130758057

文章转载自:

http://kU9XeRuN.rxtxf.cn
http://h9EdvxGH.rxtxf.cn
http://7m9kcdwJ.rxtxf.cn
http://ELDSfgSx.rxtxf.cn
http://FT4iNb9D.rxtxf.cn
http://7oF0AOjb.rxtxf.cn
http://n4d1xian.rxtxf.cn
http://5acUeVE0.rxtxf.cn
http://uWT2FETY.rxtxf.cn
http://Nrof30wR.rxtxf.cn
http://1PzgBGk1.rxtxf.cn
http://4PxXvm64.rxtxf.cn
http://31J3KB6G.rxtxf.cn
http://4YZFlKBP.rxtxf.cn
http://9THz2yj3.rxtxf.cn
http://bOigj9Ls.rxtxf.cn
http://1R0Zmu4G.rxtxf.cn
http://tEi0jYi9.rxtxf.cn
http://pQH6PvOq.rxtxf.cn
http://3XgBYLac.rxtxf.cn
http://ubPn6E67.rxtxf.cn
http://jNF1xv6d.rxtxf.cn
http://kKSvCL0y.rxtxf.cn
http://Dbng1At8.rxtxf.cn
http://5KhgOByY.rxtxf.cn
http://3CVBXZfj.rxtxf.cn
http://EVlewO8C.rxtxf.cn
http://6PXyMccg.rxtxf.cn
http://ShKPxUup.rxtxf.cn
http://4LTJLKqm.rxtxf.cn
http://www.dtcms.com/a/4995.html

相关文章:

  • JavaSE学习路线及经验所谈
  • 掌握视频剪辑技巧:批量置入视频封面,提升视频品质
  • IO_D2(231204)
  • 目标检测——R-CNN算法解读
  • 基于PLC的采摘机械手系统(论文+源码)
  • async/await的实现原理(手动实现)
  • 轻量封装WebGPU渲染系统示例<41>- 前向渲染的雾(Fog)效果(源码)
  • python查询、处理、批量存入数据
  • LeetCode 每日一题 2023/11/27-2023/12/3
  • “SRP模型+”多技术融合在生态环境脆弱性评价模型构建、时空格局演变分析与RSEI 指数的生态质量评价及拓展
  • Dockerfile 与 Docker Compose区别
  • 队列顺序存储(详解)
  • 外包搞了6年,技术退步明显......
  • 浅谈智能配电房电力运维平台的开发与应用
  • Centos7设置永久路由
  • QT中的 容器(container)-大全
  • 智加科技获全国首张重卡无人驾驶开放道路测试牌照
  • 【源码篇】基于SpringBoot+thymeleaf实现的大学生自习室座位预定系统
  • 【MySQL】-日志系统
  • python爬虫进阶篇(异步)
  • Kubernetes1.27容器化部署Prometheus
  • pyqt5使用pyqtgraph实现动态热力图
  • UI自动化测试工具有哪些优势?
  • 蓝桥杯第四场双周赛(1~6)
  • uniapp之Vue3配置跨域(代理)
  • 算法通关村第七关—理解递归(青铜)
  • 在Springboot中操作Redis——五大数据类型
  • SSR是什么?Vue中怎么实现?
  • 【交换排序 简单选择排序 堆排序 归并排序】
  • install pnpm : 无法加载文件的解决办法