Skip to content
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

Solving panics due to incorrect comparison function #888

Closed
2 tasks done
mdekstrand opened this issue Oct 2, 2024 · 2 comments · Fixed by #892
Closed
2 tasks done

Solving panics due to incorrect comparison function #888

mdekstrand opened this issue Oct 2, 2024 · 2 comments · Fixed by #892

Comments

@mdekstrand
Copy link

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

Rust 1.81 introduce stricter checks for the correctness of Ord and PartialOrd implementations when sorting, panicing when it detects a non-total ordering instead of proceeding and allowing the sorted results to be incorrect. This causes Rattler's tests, and Pixi's solving, to fail when built with Rust 1.81.

Test error output
$ cargo +1.81.0 test
...
failures:

---- channel_priority_strict stdout ----
thread 'channel_priority_strict' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order

---- channel_specific_requirement stdout ----
thread 'channel_specific_requirement' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order

---- resolvo::test_solve_tensorboard stdout ----
thread 'resolvo::test_solve_tensorboard' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order

---- resolvo::test_solve_quetz stdout ----
thread 'resolvo::test_solve_quetz' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order

---- resolvo::test_solve_tensorflow stdout ----
thread 'resolvo::test_solve_tensorflow' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order

---- compare_solve_tensorboard stdout ----
libsolv_c took 2139ms
thread 'compare_solve_tensorboard' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order

---- compare_solve_tensorflow stdout ----
libsolv_c took 3183ms
thread 'compare_solve_tensorflow' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order

---- compare_solve_quetz stdout ----
libsolv_c took 4744ms
thread 'compare_solve_quetz' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order


failures:
    channel_priority_strict
    channel_specific_requirement
    compare_solve_quetz
    compare_solve_tensorboard
    compare_solve_tensorflow
    resolvo::test_solve_quetz
    resolvo::test_solve_tensorboard
    resolvo::test_solve_tensorflow

test result: FAILED. 53 passed; 8 failed; 0 ignored; 0 measured; 0 filtered out; finished in 9.15s

This is likely the cause of prefix-dev/pixi#2122.

Additional Context

I discovered this issue because Homebrew builds Pixi with latest Rust, and my Pixi dependency solves were panicing.

@tdejager
Copy link
Collaborator

tdejager commented Oct 2, 2024

Ah yes we should definitely fix this, let's see if we can implement a correct total ordering for the things that error out.

@tdejager
Copy link
Collaborator

tdejager commented Oct 5, 2024

I've a PR up that should fix this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants