-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Patching dependencies does not work if it's for the same location but a different branch #5478
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
Comments
Ah yeah this is sort of an unfortunate side-effect of the implementation of |
For GitHub repositories, one can work around this by |
Nice workaround hack! Further ways to change the URL string include adding |
The above workaround doesn't work for us, because what we patch has dependencies as well which need to be patched by the workspace patch. However, as the url now changed, it won't be patched.
but that won't work:
also linking it back to the original url won't work:
because:
|
this bug has been open for a long time. is there hope? we're stuck with a suboptimal setup due to this. |
Any progress on this issue? |
this could IMO be fixed by #7497 |
I've definitely been confused by this because I didn't understand how the |
These workarounds no longer do it for me (using |
I think this workaround fails with ethers-rs = { git = "https://github.com:443/gakonst/ethers-rs.git?rev=test", branch = "test" } |
This comment was marked as off-topic.
This comment was marked as off-topic.
I think that's sufficiently different to have its own GitHub issue. |
Ah, I think my problem is already covered by #9227 |
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-prebuilt`](https://github.com/godot-rust/godot4-prebuilt) repo: * `extension_api.json` (from Godot binary) * `gdextension_interface.h` (from Godot binary) * `gdextension_interface.rs` (through bindgen -- currently supports 3 platforms) This has several benefits: 1. Significantly fewer dependencies, as bindgen is no longer needed, and thus smaller compile times. 2. Most CI jobs no longer need the Godot binary (clippy, test), speeding up CI _in addition_ to (1). 3. It's possible to change the Godot API behind gdext without manually rebuilding the artifacts. 4. Easy comparison between the Godot APIs of different released versions. ### Using a custom Godot binary It is still possible to generate those files locally like before, through the use of the `custom-godot` feature on the `godot` crate. This is necessary for any platform/configuration different from the 3 main supported ones (because bindgen generates different Rust bindings), as well as any in-development or modified Godot versions. ### Changing the Godot release By default, the latest Godot release is used as input to gdext. Switching between different Godot versions is easily possible, although a bit cumbersome. If you want to use an older version `4.0`, add this to your **workspace** (not sub-crate) `Cargo.toml`: ```toml # We need to trick Cargo into seeing a different URL; rust-lang/cargo#5478 [patch."https://github.com/godot-rust/godot4-prebuilt"] godot4-prebuilt = { git = "https://github.com//godot-rust/godot4-prebuilt", branch = "4.0"} ``` We're looking into ways to simplify this. In a crates.io release (#2), we would need to rethink this anyway, mapping Godot versions to Rust release versions (which is not trivial). Co-authored-by: Jan Haller <[email protected]>
This worked for me (www and .git) : [patch.'https://github.com/foo/bar']
baz = { git = "https://www.github.com/foo/bar.git", branch = "test" } |
Note that the `http://` is really intended, as it works around rust-lang/cargo#5478
Conversation on prerequisites to addressing this issue: https://internals.rust-lang.org/t/how-to-assist-with-bug-5478/21819/1 |
Backports presage commit 35c2c98 to fix connectivity to Signal backend.
Using |
If you want to patch a crate from crates.io with crates.io itself (which often comes up when you just want to change the version), you can do it like this: # Cargo.toml
[patch.crates-io]
zip = { version = "=2.5.0", registry = "crates-io-2" } # .cargo/config.toml
[registries]
crates-io-2 = { index = "sparse+https://index.crates.io/" } This can lead to the same sub-dependency being downloaded from both crates-io and crates-io-2. It’s not a major issue to download the same dependency twice, but just be aware of it. |
TIL: |
E.g.
This gives
The text was updated successfully, but these errors were encountered: