-
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
Panic with [patch]
and conflicting equal versions.
#7463
Comments
This is definitely a bug. Thank you for the clere report and test case. At one level the panic is caused by .expect("not currently active!?"), witch should be a |
I am getting same issue
Found out the cause, I had
|
I hit the same with:
as that branch is version |
cargo update fails with 'not currently active!?'. A workaround is here rust-lang/cargo#7463.
cargo update fails with 'not currently active!?'. A workaround is here rust-lang/cargo#7463.
I've experienced this issue as well. |
@rustbot claim |
Just got this error when trying to patch something in a huge workspace. |
I just got this error. Backtrace:
|
Currently, we are importing the `ahash` crate for only one reason: to test that CachingSession works with custom hasher implementations. The custom hasher quality doesn't matter at all in this test, so it's very easy to write own implementation for testing purposes, rendering the dependency on `ahash` obsolete. The change was prompted by a report from one of our users which use a fork of the driver and managed to trigger a bug in cargo - most likely this one: rust-lang/cargo#7463 . The most likely cause was that the project specified a different, non-compatible version of ahash in the dependencies than the one in scylla's dev-dependencies. While it doesn't fix the cargo bug and it can still happen with other dev-dependencies, the bug should no longer happen with conflicting `ahash`. Moreover, removing an unneeded depdencency from a project is a good motivation in itself.
Currently, we are importing the `ahash` crate for only one reason: to test that CachingSession works with custom hasher implementations. The custom hasher quality doesn't matter at all in this test, so it's very easy to write own implementation for testing purposes, rendering the dependency on `ahash` obsolete. The change was prompted by a report from one of our users which use a fork of the driver and managed to trigger a bug in cargo - most likely this one: rust-lang/cargo#7463 . The most likely cause was that the project specified a different, non-compatible version of ahash in the dependencies than the one in scylla's dev-dependencies. While it doesn't fix the cargo bug and it can still happen with other dev-dependencies, the bug should no longer happen with conflicting `ahash`. Moreover, removing an unneeded depdencency from a project is a good motivation in itself.
This saved my day. Thanks. |
Fixed Cargo nonsense rust-lang/cargo#7463 rework winit_term configuration
relocate crates out dir wip fix decouple winit/webrender set surfman size fmt decouple input_processor decouple window from output cleanup wr_render_init move scale_factor to display_info move color bits to display info new canvas from frame directly some clean up window id usin raw handle wr output decouput font wip wip wr output decouput font build: use rust --cfg Fixed Cargo nonsense rust-lang/cargo#7463 rework winit_term configuration
Fixed Cargo nonsense rust-lang/cargo#7463 rework winit_term configuration
relocate crates out dir wip fix decouple winit/webrender set surfman size fmt decouple input_processor decouple window from output cleanup wr_render_init move scale_factor to display_info move color bits to display info new canvas from frame directly some clean up window id usin raw handle wr output decouput font wip wip wr output decouput font build: use rust --cfg Fixed Cargo nonsense rust-lang/cargo#7463 rework winit_term configuration build pgtk with webrender configure pgtk with webrender
webrender: Fix missing wr-frame-edges winit and webrender decouple relocate crates out dir wip fix decouple winit/webrender set surfman size fmt decouple input_processor decouple window from output cleanup wr_render_init move scale_factor to display_info move color bits to display info new canvas from frame directly some clean up window id usin raw handle wr output decouput font wip wip wr output decouput font build: use rust --cfg Fixed Cargo nonsense rust-lang/cargo#7463 rework winit_term configuration build pgtk with webrender configure pgtk with webrender
webrender: Fix missing wr-frame-edges winit and webrender decouple relocate crates out dir wip fix decouple winit/webrender set surfman size fmt decouple input_processor decouple window from output cleanup wr_render_init move scale_factor to display_info move color bits to display info new canvas from frame directly some clean up window id usin raw handle wr output decouput font wip wip wr output decouput font build: use rust --cfg Fixed Cargo nonsense rust-lang/cargo#7463 rework winit_term configuration build pgtk with webrender configure pgtk with webrender
webrender: Fix missing wr-frame-edges winit and webrender decouple relocate crates out dir wip fix decouple winit/webrender set surfman size fmt decouple input_processor decouple window from output cleanup wr_render_init move scale_factor to display_info move color bits to display info new canvas from frame directly some clean up window id usin raw handle wr output decouput font wip wip wr output decouput font build: use rust --cfg Fixed Cargo nonsense rust-lang/cargo#7463 rework winit_term configuration build pgtk with webrender configure pgtk with webrender
webrender: Fix missing wr-frame-edges winit and webrender decouple relocate crates out dir wip fix decouple winit/webrender set surfman size fmt decouple input_processor decouple window from output cleanup wr_render_init move scale_factor to display_info move color bits to display info new canvas from frame directly some clean up window id usin raw handle wr output decouput font wip wip wr output decouput font build: use rust --cfg Fixed Cargo nonsense rust-lang/cargo#7463 rework winit_term configuration build pgtk with webrender configure pgtk with webrender
webrender: Fix missing wr-frame-edges winit and webrender decouple relocate crates out dir wip fix decouple winit/webrender set surfman size fmt decouple input_processor decouple window from output cleanup wr_render_init move scale_factor to display_info move color bits to display info new canvas from frame directly some clean up window id usin raw handle wr output decouput font wip wip wr output decouput font build: use rust --cfg Fixed Cargo nonsense rust-lang/cargo#7463 rework winit_term configuration build pgtk with webrender configure pgtk with webrender
patch can conflict on not activated packages ### What does this PR try to resolve? In the resolver there is a data structure called a `conflicting_activations`, which records all the reasons a "better" version was not picked for the package being resolved. Normally, these are packages that are currently active that for one reason or another block one of the other versions. Several optimizations assumed that this was always true, even going so far as to use `.expect`. This was a mistake because when there's a `patch` involved there can be conflicts on a version that is not selected. So the correct behavior is to fall back to skip the optimizations and try all versions when a `conflicting_activations` are not active. ### How should we test and review this PR? This adds two automated tests based on the reproductions in #7463 and #11336. So the test suite now covers this case. It can also be tested by reconstructing the repositories originally reported in those issues. ### Additional information It could be that in the long term the correct fix is to figure out how to support patch without having a conflicting activation that is not activated. But that would be a much bigger change. And for now this assumption is only used in optimizations, so this gets people unstuck.
Should be fixed by #11770 in 1.70.0. Thanks for the report and the test example! |
When testing out #7346, I came across a strange case where the resolver panics. I neglected to update every version across multiple packages in a workspace. Below is a fairly minimal reproduction. Notice that it has both
=0.1.0
and=0.1.1
.Fails with:
I think it should fail with an error like the non-patch version ("failed to select a version for
bar
").Currently on latest master f4d1b77
The text was updated successfully, but these errors were encountered: