-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Panic when patching dependency #7346
Comments
Thanks for the report! I think that this may have bene fixed recently on nightly, mind trying again with an updated nightly and see if it fixes the issue? |
@alexcrichton It's still present on the nightly of today. I worked around it by forking the dependency and patching some code - but this shouldn't be happening ofcourse 😅 |
Sorry for the delay in getting back to this, but @PvdBerg1998 I'm unfortunately unable to reproduce this. Does this still reproduce for you? If so can you list out the instructions I need to do to reproduce it? |
No worries @alexcrichton. I'm able to reproduce this by adding the
Hopefully it is reproducable. |
Ah ok I was able to reproduce, thanks! Looks like this bug was relatively recently introduced since only beta/nightly, and I was trying to reproduce with stable! |
Ok a local test for this looks like: #[cargo_test]
fn semver_eq_versions_and_wrenches() {
let bar = git::repo(&paths::root().join("override"))
.file("Cargo.toml", &basic_manifest("bar", "0.1.3"))
.file("src/lib.rs", "")
.build();
Package::new("bar", "0.1.1").publish();
Package::new("bar", "0.1.2").publish();
let p = project()
.file(
"Cargo.toml",
&format!(
r#"
[package]
name = "foo"
version = "0.0.1"
[dependencies]
bar = "=0.1.1"
baz = {{ path = 'baz' }}
[patch.crates-io]
bar = {{ git = '{}', version = "^0.1.2" }}
"#,
bar.url(),
),
)
.file("src/lib.rs", "")
.file(
"baz/Cargo.toml",
r#"
[package]
name = "baz"
version = "0.2.0"
[dependencies]
bar = "^0.1.2"
"#,
)
.file("baz/src/lib.rs", "")
.build();
p.cargo("build").run();
} @Eh2406 you may be interested in this as well, the panicking line is this one which was added in #7118 which sure enough probably wouldn't happen if we didn't have special handling for |
Assuming we do need to check both: I'd lean toward the later, as I don't think this will be common, and it limits the code that is special for |
I'd like to take a crack at implementing the fixes outlined by Eh2406. I'm going to be using it as an introductory issue for making changes to Cargo and the Resolver, so progress may be somewhat slow. |
@pyrrho How is it going? Rereading my comment, I would entirely understand if it is entirely gibberish |
Slower than I would have liked, but I think I have a handle on the components you and Alex were discussing. I expect I'll have something today or tomorrow (even if it is just a couple concrete tests and questions about the semantics of these features). |
Hmm, I still run into this with the latest nightly (which includes the fix from #7452). This is on https://github.com/hyperium/h2 with [patch.crates-io]
tokio = { git = "https://github.com/tokio-rs/tokio", branch = "jonhoo/next-alpha" }
tokio-codec = { git = "https://github.com/tokio-rs/tokio", branch = "jonhoo/next-alpha" }
tokio-io = { git = "https://github.com/tokio-rs/tokio", branch = "jonhoo/next-alpha" }
tokio-sync = { git = "https://github.com/tokio-rs/tokio", branch = "jonhoo/next-alpha" }
tokio-rustls = { path = "../tokio-rustls" } where [patch.crates-io]
tokio = { git = "https://github.com/tokio-rs/tokio", branch = "jonhoo/next-alpha" }
tokio-io = { git = "https://github.com/tokio-rs/tokio", branch = "jonhoo/next-alpha" } The backtrace (if relevant) is:
|
Current nightly does not contain #7452, unless you built cargo yourself? Unfortunately, even with #7452, I get a new error:
|
Ohh, because nightly isn't cargo nightly. What PR can I submit to make that be the case? |
It gets updated about once a week. I'll go ahead and submit a PR, but as noted above it probably won't help with your case. You can also build cargo from source to test out a local version. |
@ehuss What's your reproducer for that error? I just built cargo@7ac51b7 with +nightly and did a |
Problem
I'm patching one of my dependencies (
mysql-async
) to a branch on github. The crate on this branch requirespin-project:^0.4.0-alpha.10
. I'm also usinghyper
, which requirespin-project:=0.4.0-alpha.7
. This in itself causes compilation failure:So I tried to patch it to the current master branch like so:
This results in the following panic:
https://github.com/rust-lang/cargo/blob/master/src/cargo/core/resolver/context.rs#L153
Steps
Cargo.lock
(not sure if required)cargo update/run/check
Notes
Output of
cargo version
:cargo 1.39.0-nightly (22f7dd049 2019-08-27)
.Compiler:
rustc 1.39.0-nightly (c6e9c76c5 2019-09-04)
withnightly-x86_64-pc-windows-msvc (default)
.Unfortunately I'm unable to share the erroring code nor have I created a minimized example.
The text was updated successfully, but these errors were encountered: