-
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
'cargo update -p foo' fails with [patch]’ed depenedency #4315
Comments
Are you sure you were using the right version of Cargo? It looks like the code paths here should do the right thing, although I haven't super thoroughly checked. As a side note, I find these sorts of reports much more approachable if quotes like "with a silly commit ..." are all left out, we all just want to help everyone else get work done! |
Sorry about the unnecessary "silly commit" part. Thank you for your work on I was using cargo 0.21.0-nightly (ffab519 2017-07-18), built on Rust CI, which was updated in rust-lang/rust#43319. |
I tried to reproduce this with a minimal test case and didn’t get any error. So you’re right, I might have used |
Ok, lemme know if it keeps coming up though! I'm not 100% sure this isn't a bug yet. |
FWIW, here is the script I used to try to reproduce: cargo new matches
sed -i 's/0.1.0/999.0.0/' matches/Cargo.toml
cat matches/Cargo.toml
cargo new foo
echo 'matches = "999.0.0"' >> foo/Cargo.toml
echo '' >> foo/Cargo.toml
echo '[patch.crates-io]' >> foo/Cargo.toml
echo 'matches = {path = "../matches"}' >> foo/Cargo.toml
cat foo/Cargo.toml
cargo +nightly build --manifest-path foo/Cargo.toml # Succeeds
cargo +nightly update --manifest-path foo/Cargo.toml -p matches # I expected this to fail, but it succeeded
rm -r matches foo |
servo/rust-cssparser#171 makes a number of changes to the
cssparser
crate, including changing its version number from 0.17.0 to 0.18.0. That PR has not landed yet, 0.18.0 is not on crates.io yet. I want to test it in Servo beforehand. I already had a Servo branch with[replace]
(and a separate cssparser branch with a silly commit that reverses the version number change…) Now that rust-lang/rust#43319 has landed, I tried[patch]
instead.Starting from Servo master, I changed
cssparser = "0.17"
tocssparser = "0.18"
in a dozenCargo.toml
files, added the lines below to the workspace’sCargo.toml
, and cherry-picked the commits updating the code for API changes.At this point, with
[replace]
, I’d usually need to runcargo update -p cssparser
to getCargo.lock
in a state consistent with toml files. This fails:Though
cargo build
succeeds, so it looks like[patch]
is working as intended. It’s only theupdate
sub-command that apparently still needs to learn about it.The text was updated successfully, but these errors were encountered: