Skip to content

Commit b219517

Browse files
authored
Merge pull request #330 from Mikachu2333/main
修复 `Rust` `Cargo` 测速链接404的问题
2 parents 7fd79ea + f15d8a9 commit b219517

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/recipe/lang/Rust/Cargo.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* SPDX-License-Identifier: GPL-3.0-or-later
33
* ------------------------------------------------------------*/
44

5+
#define RAWSTR_pl_rust_cargo_default_download_url "https://static.crates.io/crates/windows/windows-0.58.0.crate"
6+
#define RAWSTR_pl_rust_cargo_custom_default_download_url "api/v1/crates/windows/0.58.0/download"
7+
58
def_target(pl_rust_cargo, "rust/cargo/crate/crates");
69

710
void
@@ -10,8 +13,8 @@ pl_rust_cargo_prelude (void)
1013
chef_prep_this (pl_rust_cargo, gsr);
1114

1215
chef_set_created_on (this, "2023-08-30");
13-
chef_set_last_updated (this, "2025-10-06");
14-
chef_set_sources_last_updated (this, "2025-06-18");
16+
chef_set_last_updated (this, "2025-12-30");
17+
chef_set_sources_last_updated (this, "2025-12-30");
1518

1619
chef_set_chef (this, NULL);
1720
chef_set_cooks (this, 2, "@Mikachu2333", "@ccmywish");
@@ -23,28 +26,28 @@ pl_rust_cargo_prelude (void)
2326

2427

2528
// 以下都支持稀疏索引,我们换源时都将默认添加 `sparse+`。链接末尾的 `/` 不能缺少
29+
// 2025-12-29: 许多镜像站的 dl 字段指向 static.crates.io,因此测速链接也指向 static.crates.io,原api失效
2630
def_sources_begin()
27-
{&UpstreamProvider, "https://crates.io/", FeedByPrelude},
28-
{&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/", FeedByPrelude},
29-
{&RsProxyCN, "https://rsproxy.cn/index/", FeedByPrelude},
30-
{&Ali, "https://mirrors.aliyun.com/crates.io-index/", FeedByPrelude},
31-
{&Zju, "https://mirrors.zju.edu.cn/crates.io-index/", FeedByPrelude},
31+
{&UpstreamProvider, "https://crates.io/", RAWSTR_pl_rust_cargo_default_download_url},
32+
{&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/", RAWSTR_pl_rust_cargo_default_download_url},
33+
{&RsProxyCN, "https://rsproxy.cn/index/", "https://rsproxy.cn/" RAWSTR_pl_rust_cargo_custom_default_download_url},
34+
{&Ali, "https://mirrors.aliyun.com/crates.io-index/", "https://mirrors.aliyun.com/crates/" RAWSTR_pl_rust_cargo_custom_default_download_url},
35+
{&Zju, "https://mirrors.zju.edu.cn/crates.io-index/", RAWSTR_pl_rust_cargo_default_download_url},
3236

3337
/* 注释原因: (2025-06-17) 镜像同步失败,多数包都不可用 */
3438
// {&Nju, "https://mirror.nju.edu.cn/git/crates.io-index.git/", FeedByPrelude},
3539

36-
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/", FeedByPrelude},
37-
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/",FeedByPrelude},
38-
{&Bfsu, "https://mirrors.bfsu.edu.cn/crates.io-index/", FeedByPrelude},
39-
{&Ustc, "https://mirrors.ustc.edu.cn/crates.io-index/", FeedByPrelude},
40+
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/", "https://mirror.sjtu.edu.cn/crates.io/crates/windows/windows-0.58.0.crate"},
41+
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/",RAWSTR_pl_rust_cargo_default_download_url},
42+
{&Bfsu, "https://mirrors.bfsu.edu.cn/crates.io-index/", RAWSTR_pl_rust_cargo_default_download_url},
43+
{&Ustc, "https://mirrors.ustc.edu.cn/crates.io-index/", "https://crates-io.proxy.ustclug.org/" RAWSTR_pl_rust_cargo_custom_default_download_url},
4044

4145
/* 注释原因: (2025-06-17) 镜像同步失败,多数包都不可用 */
4246
// {&Hust, "https://mirrors.hust.edu.cn/crates.io-index/", FeedByPrelude},
4347

44-
{&Cqu, "https://mirrors.cqu.edu.cn/crates.io-index/", FeedByPrelude}
48+
{&Cqu, "https://mirrors.cqu.edu.cn/crates.io-index/", RAWSTR_pl_rust_cargo_default_download_url}
4549
def_sources_end()
4650

47-
chef_set_sources_speed_measure_url_with_postfix (this, "api/v1/crates/windows/0.58.0/download");
4851
}
4952

5053

0 commit comments

Comments
 (0)