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

Internal error in solver #90

Closed
growler opened this issue Dec 31, 2024 · 6 comments · Fixed by #93
Closed

Internal error in solver #90

growler opened this issue Dec 31, 2024 · 6 comments · Fixed by #93

Comments

@growler
Copy link

growler commented Dec 31, 2024

Hello.

I am developing a tool to work with Debian repositories, which involves finding solutions for package recipes. I decided to give a shot to Resolvo, and it has been significantly faster than the APT solver over EDSP. However, I encountered an internal error during execution:

thread 'main' panicked at /home/growler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/resolvo-0.8.4/src/solver/mod.rs:1155:25:
internal error: entered unreachable code: when we get here it means that all candidates have been assigned false. This should not be able to happen at this point because during propagation the solvable should have been assigned false as well.

I couldn't create a minimal example, so I extracted the relevant code into a separate library. You can reproduce the issue with the following steps

git clone https://github.com/growler/deb-repo
cd deb-repo
cargo run -- fetch -u https://snapshot.debian.org/archive/debian/20241201T025825Z/ bookworm main --output Packages
RUST_LOG=trace cargo run -- solve sendmail

For some reason, the issue occurs only with exim4 and sendmail.

Please let me know if I can provide more information or help debug this issue further.

Oh, and thank you for resolve and have a Happy New Year!

@growler
Copy link
Author

growler commented Jan 1, 2025

Hello. I managed to extract the minimal package set triggering the issue and I added it as a test. With the latest commit

RUST_LOG=trace cargo test --lib -- --nocapture --test universe::tests::test_solver_issue

should be enough.

@wolfv
Copy link
Member

wolfv commented Jan 1, 2025

Is it possible to make a test case in resolvo?

@growler
Copy link
Author

growler commented Jan 1, 2025

Do you mean translating the set into the BundleBox terms? Well I could try, it seems technically possible, I just need to figure out how to map the debian versions into ranges. Any suggestions are welcome.

@growler
Copy link
Author

growler commented Jan 1, 2025

The BundleBox versioning system represents a discrete set of versions, whereas Debian versions resemble an infinite, continuous set. Additionally, Debian's constraint semantics include concepts such as "no version of the package" and "any version of the package except for the specified one." I'm uncertain how to translate these concepts into the BundleBox range syntax, especially the latter.

@baszalmstra
Copy link
Contributor

baszalmstra commented Jan 1, 2025

Thanks to your reproducer I found the bug and fixed in it #93 . With that fix both your reproducers produce a valid solution.

Happy new year! 😄

@growler
Copy link
Author

growler commented Jan 1, 2025

Wow, that was quick. Thank you!

@growler growler closed this as completed Jan 1, 2025
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.

3 participants