cargo: Patching dependencies does not work if it's for the same location but a different branch
E.g.
[patch.'https://github.com/sdroege/gobject-subclass']
gobject-subclass = { git = 'https://github.com/sdroege/gobject-subclass', branch = 'refactoring' }
This gives
error: failed to resolve patches for `https://github.com/sdroege/gobject-subclass`
Caused by:
patch for `gobject-subclass` in `https://github.com/sdroege/gobject-subclass` points to the same source, but patches must point to different sources
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 58
- Comments: 21 (8 by maintainers)
Commits related to this issue
- remove workaround for https://github.com/rust-lang/cargo/issues/5478 — committed to oxidecomputer/hubris by bcantrill 3 years ago
- kludge: dust off the feat-non-generic branch from 2020 Because of a change in how Cargo normalizes dependency URLs, we are now unable to change the `ut-utp/core` branch that this crate depends On fro... — committed to ut-utp/tm4c-misery-and-torment-inflicted-by-rahul by rrbutani 2 years ago
- kludge: dust off the feat-non-generic branch from 2020 Because of a change in how Cargo normalizes dependency URLs, we are now unable to change the `ut-utp/core` branch that this crate depends On fro... — committed to ut-utp/tm4c-misery-and-torment-inflicted-by-rahul by rrbutani 2 years ago
- chore: temp fix to quaint due to https://github.com/rust-lang/cargo/issues/5478 — committed to prisma/prisma-engines by jkomyno 2 years ago
- chore: temp fix to quaint due to https://github.com/rust-lang/cargo/issues/5478 — committed to prisma/prisma-engines by jkomyno 2 years ago
- chore: temp fix to quaint due to https://github.com/rust-lang/cargo/issues/5478 — committed to prisma/prisma-engines by jkomyno 2 years ago
- Merge #211 211: Prebuilt Godot artifacts r=Bromeon a=Bromeon Closes #12 Closes #107 From now on, gdext by default fetches pre-generated versions of these files, published in the [`godot4-prebu... — committed to godot-rust/gdext by bors[bot] a year ago
Nice workaround hack! Further ways to change the URL string include adding
/to the url like https://github.com////user///repo . This method scales to unlimited amounts of different urls for the same repo.These workarounds no longer do it for me (using
cargo 1.52.0)–perhaps Cargo is now normalizing repo names?If anyone is having trouble with overriding SSH URLs, and can’t use HTTPS for whatever reason (eg. private git repo) I found another workaround is to add the port number to the URL, like
ssh://git@github.com:22/<org>/<repo>.gitHave you tried this:
The canonicalization code only strips trailing
/and.git. For extra/inside the URL, it doesn’t do anything.For GitHub repositories, one can work around this by
[patch]ing https://github.com/user/repo to https://github.com/user/repo.git (or the other way around).This worked for me (www and .git) :