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

"short-circuit" evaluation of boolean dependencies #570

Open
voxik opened this issue Jul 8, 2024 · 3 comments
Open

"short-circuit" evaluation of boolean dependencies #570

voxik opened this issue Jul 8, 2024 · 3 comments

Comments

@voxik
Copy link

voxik commented Jul 8, 2024

I am coming here from https://bugzilla.redhat.com/show_bug.cgi?id=2295752. The issue is that given Requires: (weston or cage or kwin-wayland or mutter or gnome-kiosk), it would be natural (due to to commonly used "short-circuit" evaluation in programing languages) to assume weston is the preferred choice, but in reality cage is installed. I think this should change.

@mlschroe
Copy link
Member

mlschroe commented Jul 8, 2024

There's no easy way to implement this due to libsolv being a SAT solver that translates dependencies to rules on packages. With this translation all ordering information is gone. So the implementation would need to map the rule back to the originating dependency/dependencies.

I'm not sure if it's such a good idea, though, as it implies that there is always a preferred choice.

@voxik
Copy link
Author

voxik commented Jul 8, 2024

There's no easy way to implement this due to libsolv being a SAT solver that translates dependencies to rules on packages. With this translation all ordering information is gone. So the implementation would need to map the rule back to the originating dependency/dependencies.

If libsolv can leverage Suggests as a hint, this in my naive view is not really different.

I'm not sure if it's such a good idea, though, as it implies that there is always a preferred choice.

Why there should not be?

In my specific example, I really cannot judge why cage should be preferred. There likely is some metric baked into the solver, but that is not user transparent. Is that dependency chain length? But why that should be preferable to download size?

Looking into Fedora, there are 56 packages using the boolean syntax. From these 56, there are 8 which combines this with Sugests and one which is question, being reason for this RFE. And I doubt the Suggest hint is widely known.

@voxik
Copy link
Author

voxik commented Jul 8, 2024

And I doubt the Suggest hint is widely known.

Not mentioning that hinting the preferred package is not the original purpose of Suggests. It certainly is not capture in RPM documentation.

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

No branches or pull requests

2 participants