-
Notifications
You must be signed in to change notification settings - Fork 38
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
Negative dependencies/conflicts? #122
Comments
Hello @the-eater. Conflicts, or also called constraints, can be expressed by the internal representation of pubgrub, by what are called "incompatibilities" in pubgrub but not by the currently exposed API. The guide provides a formal presentation of these in a dedicated section.
This means if any version of A is present, and any version of B is present, both terms are evaluated true and the incompatibility is called "satisfied" which is what the solver tries to avoid. @the-eater I suggest you follow issue #120 as it is related to the same question and maybe there can be some collaboration there regarding interface discussions and implementations. |
Specifically, what is your practical use case? I want to make sure that whatever we design is ergonomic for real world needs. |
Ah I will take a look! @Eh2406 I am atm, writing a system package manager (ala apt-get, apk, xbps etc) where certain packages may conflict with each other because they provide the same functionality but with a different implementation say e.g. the model of system package managers are in a sense also a bit different because there is less direct dependencies and more dependencies based on what a package provides, say e.g. So I'm not sure how good of a fit pubgrub actually is, but I have been interested in pubgrub for a while and think this could be a fitting application (even more so because of the clear conflict reporting) |
I see. Well as you said nothing prevents you to have finer granularity on what you tell to pubgrub what "packages" are. You could tell But when I say "you could" I mean hypothetically. Currently, depending on "either A or B" cannot be expressed with API of pubgrub v0.2. You can play smart with packages with the "bucket" trick as we call it in the guide to have something similar. Otherwise, one such kind of constraint will require an incompatibility of the shape:
This incompatibility forbids a situation where we have libc, and not glibc and not musl.
It forbids situations where we have both glibc and musl installed. Anyway, it's just to say that the base mechanism inside pubgrub, of "incompatibilities" is rather powerful, but currently we only expose a simple API, allowing only typical dependencies. Because it's always easier to start with simple case and improve later. Thank you for expressing you use case, it's important to keep pubgrub as user-friendly as possible. As for your use case, it's definitely related to #120 or at least will require similar loosening of pubgrub's API so it's great if you could participate in those design discussions. |
How can conflicts be implemented via this pubgrub package?
e.g. package A can only be installed if package B isn't there, or package A can only be installed if package B is at least version 5, but isn't a dependency of package A
The text was updated successfully, but these errors were encountered: