fix(): error context for git_fetch refspec not found#14806
Merged
weihanglo merged 3 commits intorust-lang:masterfrom Nov 17, 2024
Merged
fix(): error context for git_fetch refspec not found#14806weihanglo merged 3 commits intorust-lang:masterfrom
weihanglo merged 3 commits intorust-lang:masterfrom
Conversation
Collaborator
a91d980 to
7c698e5
Compare
weihanglo
reviewed
Nov 11, 2024
ehuss
reviewed
Nov 14, 2024
7c698e5 to
cbb6075
Compare
weihanglo
reviewed
Nov 17, 2024
weihanglo
reviewed
Nov 17, 2024
e04acef to
6838bee
Compare
weihanglo
reviewed
Nov 17, 2024
tests/testsuite/git.rs
Outdated
Comment on lines
+4119
to
+4143
| [UPDATING] git repository `https://github.com/rust-lang/bitflags.git` | ||
| [WARNING] spurious network error (3 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20) | ||
| [WARNING] spurious network error (2 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20) | ||
| [WARNING] spurious network error (1 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20) | ||
| [ERROR] failed to get `bitflags` as a dependency of package `foo v0.1.0 ([ROOT]/foo)` | ||
|
|
||
| Caused by: | ||
| failed to load source for dependency `bitflags` | ||
|
|
||
| Caused by: | ||
| Unable to update https://github.com/rust-lang/bitflags.git?rev=11111b376b93484341c68fbca3ca110ae5cd2790 | ||
|
|
||
| Caused by: | ||
| failed to clone into: [ROOT]/home/.cargo/git/db/bitflags-[HASH] | ||
|
|
||
| Caused by: | ||
| revision 11111b376b93484341c68fbca3ca110ae5cd2790 not found | ||
|
|
||
| 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: | ||
| could not read from remote repository; class=Net (12); code=Eof (-20) |
Member
There was a problem hiding this comment.
It is interesting that the error message doesn't seem to be emitted on GitHub Actions machine, but only on my local machine.
If it still happens, instead of asserting the entire message, try omitting some parts we're not interested in with ... (For the syntax, see https://doc.rust-lang.org/nightly/nightly-rustc/cargo_test_support/compare/index.html).
Suggested change
| [UPDATING] git repository `https://github.com/rust-lang/bitflags.git` | |
| [WARNING] spurious network error (3 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20) | |
| [WARNING] spurious network error (2 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20) | |
| [WARNING] spurious network error (1 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20) | |
| [ERROR] failed to get `bitflags` as a dependency of package `foo v0.1.0 ([ROOT]/foo)` | |
| Caused by: | |
| failed to load source for dependency `bitflags` | |
| Caused by: | |
| Unable to update https://github.com/rust-lang/bitflags.git?rev=11111b376b93484341c68fbca3ca110ae5cd2790 | |
| Caused by: | |
| failed to clone into: [ROOT]/home/.cargo/git/db/bitflags-[HASH] | |
| Caused by: | |
| revision 11111b376b93484341c68fbca3ca110ae5cd2790 not found | |
| 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: | |
| could not read from remote repository; class=Net (12); code=Eof (-20) | |
| [UPDATING] git repository `https://github.com/rust-lang/bitflags.git` | |
| ... | |
| [ERROR] failed to get `bitflags` as a dependency of package `foo v0.1.0 ([ROOT]/foo)` | |
| Caused by: | |
| failed to load source for dependency `bitflags` | |
| Caused by: | |
| Unable to update https://github.com/rust-lang/bitflags.git?rev=11111b376b93484341c68fbca3ca110ae5cd2790 | |
| Caused by: | |
| failed to clone into: [ROOT]/home/.cargo/git/db/bitflags-[HASH] | |
| Caused by: | |
| revision 11111b376b93484341c68fbca3ca110ae5cd2790 not found | |
| ... |
Member
There was a problem hiding this comment.
For the context:
---- git::git_fetch_libgit2_error_message stdout ----
running `/Users/runner/work/cargo/cargo/target/debug/cargo fetch`
thread 'git::git_fetch_libgit2_error_message' panicked at tests/testsuite/git.rs:4163:10:
---- expected: tests/testsuite/git.rs:4135:27
++++ actual: stderr
1 1 | [UPDATING] git repository `[https://github.com/rust-lang/bitflags.git`](https://github.com/rust-lang/bitflags.git%60)
2 - [WARNING] spurious network error (3 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20)
3 - [WARNING] spurious network error (2 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20)
4 - [WARNING] spurious network error (1 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20)
5 2 | [ERROR] failed to get `bitflags` as a dependency of package `foo v0.1.0 ([ROOT]/foo)`
6 3 |
7 4 | Caused by:
8 5 | failed to load source for dependency `bitflags`
9 6 |
⋮
15 12 |
16 13 | Caused by:
17 14 | revision 11111b376b93484341c68fbca3ca110ae5cd2790 not found
18 15 |
19 16 | Caused by:
20 - network failure seems to have happened
21 - if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
22 - https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
17 + Could not decode server reply
23 18 |
24 19 | Caused by:
25 - could not read from remote repository; class=Net (12); code=Eof (-20)
20 + Unknown or unsupported header: "ERR upload-pack: not our ref 11111b376b93484341c68fbca3ca110ae5cd2790"
```
6838bee to
a247968
Compare
a247968 to
43a5dee
Compare
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 20, 2024
Update cargo 5 commits in 69e595908e2c420e7f0d1be34e6c5b984c8cfb84..66221abdeca2002d318fde6efff516aab091df0e 2024-11-16 01:26:11 +0000 to 2024-11-19 21:30:02 +0000 - Docs for optional registry JSON fields (rust-lang/cargo#14839) - Allow registries to omit empty/default fields in JSON (rust-lang/cargo#14838) - docs(unstable): Link to -Zwarnings issue, tracking issue (rust-lang/cargo#14836) - fix(): error context for git_fetch refspec not found (rust-lang/cargo#14806) - you we distinction (rust-lang/cargo#14829)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 20, 2024
Update cargo 5 commits in 69e595908e2c420e7f0d1be34e6c5b984c8cfb84..66221abdeca2002d318fde6efff516aab091df0e 2024-11-16 01:26:11 +0000 to 2024-11-19 21:30:02 +0000 - Docs for optional registry JSON fields (rust-lang/cargo#14839) - Allow registries to omit empty/default fields in JSON (rust-lang/cargo#14838) - docs(unstable): Link to -Zwarnings issue, tracking issue (rust-lang/cargo#14836) - fix(): error context for git_fetch refspec not found (rust-lang/cargo#14806) - you we distinction (rust-lang/cargo#14829)
RalfJung
pushed a commit
to RalfJung/miri
that referenced
this pull request
Nov 21, 2024
Update cargo 5 commits in 69e595908e2c420e7f0d1be34e6c5b984c8cfb84..66221abdeca2002d318fde6efff516aab091df0e 2024-11-16 01:26:11 +0000 to 2024-11-19 21:30:02 +0000 - Docs for optional registry JSON fields (rust-lang/cargo#14839) - Allow registries to omit empty/default fields in JSON (rust-lang/cargo#14838) - docs(unstable): Link to -Zwarnings issue, tracking issue (rust-lang/cargo#14836) - fix(): error context for git_fetch refspec not found (rust-lang/cargo#14806) - you we distinction (rust-lang/cargo#14829)
lnicola
pushed a commit
to lnicola/rust-analyzer
that referenced
this pull request
Nov 28, 2024
Update cargo 5 commits in 69e595908e2c420e7f0d1be34e6c5b984c8cfb84..66221abdeca2002d318fde6efff516aab091df0e 2024-11-16 01:26:11 +0000 to 2024-11-19 21:30:02 +0000 - Docs for optional registry JSON fields (rust-lang/cargo#14839) - Allow registries to omit empty/default fields in JSON (rust-lang/cargo#14838) - docs(unstable): Link to -Zwarnings issue, tracking issue (rust-lang/cargo#14836) - fix(): error context for git_fetch refspec not found (rust-lang/cargo#14806) - you we distinction (rust-lang/cargo#14829)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
Fixes Issue : #14621
Adds more error context for fetching a commit that doesn't exists.
How should we test and review this PR?
I've created two tests, one for fast_path and one for libgit2.
r? @weihanglo