-
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
Can't [patch] the rust-s3 crate #9370
Comments
So I think that the problem is the I think there are 2 ways I can think of to get this working:
|
I get the same result if I use that string. |
I also cloned the upstream repo and reset it to the last released version
And I get the same result.
There are no longer any pre-releases in sight, so I don't think that can be the problem. Thank you for the suggestion; it would be nice if that had been it... |
I think the versions in the suggestions were backwards. They should be:
The error message could definitely be a lot better here. |
I can't get your suggestion # 1 (specify a rev, tag, or branch) to work. For example, using my fork that's reset to the previous non-prerelease rust-s3 release, this still fails:
Adding The good news: Your suggestion # 2 (name a prerelease version in the dependency string) does work. For example:
It still works if I give it other valid prerelease versions, e.g. Note the prerelease version given must actually exist-- I can't type |
@ehuss, thank you for your help! |
The reason your first example doesn't work is that the 0.26 version on crates.io is 0.26.4. It's not clear where that version came from since it is not tagged in the git repo. The patch in your first example is pointing at 0.26.3. Cargo eagerly fetches the newer version (0.26.4) and thus skips the patch. The patch
That should cause it to switch over to the patched version. The way
Cargo's resolver always fetches the "newest" semver-compatible version, so it goes with 0.26.4 in this case. Using |
Good to know, thanks! |
Problem
I am using
[patch.crates-io]
to test out some modifications to upstream crates, and I find that one crate in particular (rust-s3
) is unable to be patched this way. I have no idea why-- this method works fine on several other crates.Steps
Cargo.toml
:cargo build
,cargo check
, orcargo update
. Any of them print:and the patched crate is not used in the build.
Possible Solution(s)
It's possible that there's something wrong with the
rust-s3
crate that triggers this, but I can't figure out what it is.Could this be related to #6827 ? I notice that the library name (
s3
) does not match the crate name (rust-s3
).Notes
Output of
cargo version
:The same behavior happens with
cargo 1.53.0-nightly (65d57e6f3 2021-04-04)
.The text was updated successfully, but these errors were encountered: