-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nasty cargo fetch #12386
Comments
I added [[package]]
name = "libc"
version = "0.2.147"
registry = "sf" <-- this line
source = "registry+http://mirrors.sf.com/nexus/repository/rust-crates"
checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" but I modified [dependencies]
blake3 = { version = "1.2.0", registry = "sf" }
libc = { version = "0.2.132", registry = "sf" } Still no luck. |
How frustrating! |
This is my second try on building a same rust project. Any help is really appreciated. |
The index has a file called config.json that specifies where to download the My guess is that So Cargo is successfully getting the metadata about the crates from your mirror, but when it's actually attempting to download the crate files, it's going to You can read more about |
Thanks for the reply. But I have to say this looks not so true for me. As: $ grep 'crates.io' -r $CARGO_HOME/
<-- no output
$ tcpdump -A -v -i eth0 <-- pre run tcpdump in another terminal
$ cargo fetch
... fail tcpdump shows that $ tcpdump -A -v -i eth0
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
20:01:08.101720 IP (tos 0x0, ttl 64, id 12790, offset 0, flags [DF], proto UDP (17), length 55)
839e41e4590b.60429 > public1.114dns.com.53: 8825+ A? crates.io. (27) <-- this line, want resolving crates.io
E..71.@[email protected].#./"y...........crates.io.....
20:01:08.101826 IP (tos 0x0, ttl 64, id 12791, offset 0, flags [DF], proto UDP (17), length 55)
839e41e4590b.60429 > public1.114dns.com.53: 23679+ AAAA? crates.io. (27)
E..71.@[email protected].#./\............crates.io.....
20:01:08.129170 IP (tos 0x0, ttl 56, id 58572, offset 0, flags [none], proto UDP (17), length 119)
public1.114dns.com.53 > 839e41e4590b.60429: 8825 4/0/0 crates.io. A 13.224.167.52, crates.io. A 13.224.167.65, crates.io. A 13.224.167.34, crates.io. A 13.224.167.116 (91)
E..w....8...rrrr.....5...c5{"y...........crates.io....................4...............A..............."...............t
(... omited data) strace shows strace cargo fetch |& grep config.json
<-- no output |
If that still doesn't explain it, run with environment variable Also, please post a copy of your |
$ CARGO_HTTP_DEBUG=true cargo update --dry-run
Updating `sf-crates-proxy` index
warning: not updating lockfile due to dry run
$ export CARGO_HTTP_DEBUG=true
$ cargo update --dry-run
Updating `sf-crates-proxy` index
warning: not updating lockfile due to dry run
How to obtain that? Accessing "http://mirrors.sf.com/nexus/repository/rust-crates/config.json" results in 404 error. Just like accessing "https://rsproxy.cn/crates.io-index/config.json" (this is a similar mirror site) |
It's a git repository. For example on rsproxy.cn.
Note that the |
well, that config.json is actually pointing to crates.io $ git clone http://mirrors.sf.com/nexus/repository/rust-crates
$ cd rust-crates
$ cat config.json
{
"dl": "https://crates.io/api/v1/crates",
"api": "https://crates.io"
} that explains! So is there any method to dynamically replace this value to mirror site during |
That's something that would need to be done on the registry server. Of course, you'll also need a place to actually host all the |
Problem
I 'm in isolated network. I want to make
cargo fetch
to use alternative crates source, so I configured inPROJECT_DIR/.cargo/config.toml
:Steps
So why is
cargo fetch
still attempting to connect to crates.io ?What more configuration am I missing?
Version
The text was updated successfully, but these errors were encountered: