-
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 specify precise crate version if there are multiple versions #2773
Comments
Oh dear this looks like it's an unfortunate interaction with how In other words, definitely a bug! In theory shouldn't be too hard to fix though. |
Ok, thinking a bit more, I think the easiest solution here is basically to keep the local hack for now and encode a bit more information. So right now we encode In scope, however, we have the actual dependency with the concrete version, so I think that we want to instead encode the previous version as well as the target precise version. That is if you previously had Later on when we actually read out this encoding (which yes is a hack but oh well) I think we'll just want to extract the two fields (0.3.2 and 0.3.4) above. We only return the precise 0.3.4 target if the version requirement matches the previous one. That is, if we see a dependency for 0.2.0 then we won't return 0.3.4 as a matching package because 0.2.0 doesn't match 0.3.2. I'm gonna tag this as |
Remember that a version can be more than just numbers separated by periods: http://semver.org/spec/v2.0.0.html . But it looks like anything besides [0-9A-Za-z.-+] is ok for encoding separators. |
Ah good point, and of course if someone's working on this and otherwise sees a better way to transmit this information, that would also be perfectly acceptable as well! |
Any workarounds for this as it is now? |
@roysc2 Workaround is manually edit Cargo.lock |
Hello, I'm working on the solution proposed by @alexcrichton as my first rust/cargo contribution. I'm also looking if is possible to change the resover in order to accept a list of -=[version contraints]. |
@gibix nice! Lemme know if you need any help! |
A
cargo build
will result in getting spin versions0.3.5
and0.4.2
. Now, because of a bug, I'd like to downgrade0.4.2
to0.4.0
. Let's try this:Well ok, that makes sense. So let's specify
spin:0.4.2
:I thought I just said to only touch
0.4.2
?When I manually edit Cargo.lock and change all occurences of
0.4.2
to0.4.0
, it builds fine.The text was updated successfully, but these errors were encountered: