cargo update crates.io index 失败的研究

git-fetch-with-cli

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

查询命令行:

wmic:root\cli>process where caption="git.exe" get ExecutablePath, caption, CommandLine
Caption  CommandLine                                                                                                       ExecutablePath
git.exe  "git" fetch --force --update-head-ok https://github.com/rust-lang/crates.io-index +HEAD:refs/remotes/origin/HEAD  C:\cygwin64\bin\git.exe
git.exe  "C:\cygwin64\usr\libexec\git-core\git.exe"                                                                        C:\cygwin64\usr\libexec\git-core\git.exe
git.exe  "C:\cygwin64\usr\libexec\git-core\git.exe"                                                                        C:\cygwin64\usr\libexec\git-core\git.exe


wmic:root\cli>process where caption="git-remote-https.exe" get ExecutablePath, caption, CommandLine
Caption               CommandLine                                              ExecutablePath
git-remote-https.exe  "C:\cygwin64\usr\libexec\git-core\git-remote-https.exe"  C:\cygwin64\usr\libexec\git-core\git-remote-https.exe

proxy

$ cargo build
    Updating crates.io index
warning: spurious network error (2 tries remaining): [28] Timeout was reached (Operation too slow. Less than 10 bytes/sec transferred th
e last 30 seconds); class=Net (12)
warning: spurious network error (1 tries remaining): [28] Timeout was reached (Operation too slow. Less than 10 bytes/sec transferred th
e last 30 seconds); class=Net (12)
error: failed to get `libc` as a dependency of package `ndk v0.1.0 (F:\Github\rust\ndk)`

Caused by:
  failed to load source for dependency `libc`

Caused by:
  Unable to update registry `crates-io`

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  network failure seems to have happened
  if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  [28] Timeout was reached (Operation too slow. Less than 10 bytes/sec transferred the last 30 seconds); class=Net (12)

本地仓库

$ cargo build
    Updating `mirror` index
error: failed to get `libc` as a dependency of package `ndk v0.1.0 (F:\Github\rust\ndk)`

Caused by:
  failed to load source for dependency `libc`

Caused by:
  Unable to update registry `crates-io`

Caused by:
  failed to update replaced source registry `crates-io`

Caused by:
  failed to fetch `file:///E:/crates.io-index-master`

Caused by:
  process didn't exit successfully: `git fetch --force --update-head-ok file:///E:/crates.io-index-master +HEAD:refs/remotes/origin/HEAD
` (exit code: 128)
  --- stderr
  fatal: '/E:/crates.io-index-master' does not appear to be a git repository
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.

posted @ 2022-07-25 16:59  develon  阅读(1988)  评论(1编辑  收藏  举报