-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: add error message for github PR url in dep #15003
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
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2151,6 +2151,56 @@ Caused by: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.run(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#[cargo_test] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fn github_pull_request_url() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let p = project() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.file( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"Cargo.toml", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
r#" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[package] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name = "foo" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
version = "0.0.0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
edition = "2015" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
authors = [] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[dependencies.bar] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
git = "https://github.com/foo/bar/pull/123" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"#, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.file("src/lib.rs", "") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.build(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
p.cargo("check -v") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.with_status(101) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.with_stderr_data(str![[r#" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[WARNING] dependency (bar) git url https://github.com/foo/bar/pull/123 is not a repository. The path looks like a pull request. Try replacing the dependency with: `git = "https://github.com/foo/bar.git" rev = "refs/pull/123/head"` in the dependency declaration. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[UPDATING] git repository `https://github.com/foo/bar/pull/123` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[WARNING] spurious network error (3 tries remaining): unexpected http status code: 404; class=Http (34) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[WARNING] spurious network error (2 tries remaining): unexpected http status code: 404; class=Http (34) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[WARNING] spurious network error (1 tries remaining): unexpected http status code: 404; class=Http (34) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[ERROR] failed to get `bar` as a dependency of package `foo v0.0.0 ([ROOT]/foo)` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Caused by: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
failed to load source for dependency `bar` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Caused by: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Unable to update https://github.com/foo/bar/pull/123 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Caused by: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
failed to clone into: [ROOT]/home/.cargo/git/db/123-[HASH] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
unexpected http status code: 404; class=Http (34) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. I thought it was network flakiness. Anyway, you can use
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the problem with not making this change cause an error. If this is a warning, then after emitting the warning, cargo will attempt to load the github PR url, which is not a git repo, and so that attempt will 404 or some other error (e.g. not a git repo). I think that PS. feel free to squash this commit (I know Ed prefers atomic commits in the shape that will end up in the repo, but this is really a single change - not sure how that applies to this project). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"#]]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.run(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#[cargo_test] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fn fragment_in_git_url() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let p = project() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.