serpent-os / moss

The safe, fast and sane package manager for Linux
https://serpentos.com
128 stars 12 forks source link

Add a conflict type to stone #39

Open ikeycode opened 12 months ago

ikeycode commented 12 months ago

Conflict will essentially be identical to Dependency/Provider, allowing us to conflict with a specific type of identity.

Sidequest:

GZGavinZhao commented 9 months ago

Working on autobuild right now but I want to come back to this at a later date, so writing in case I forget.

Detecting and outputting conflicts is a 2-SAT problem and can be done in O(N + M) time where N is the number of packages and M is the number of dependency relations. The only graph algorithm I need is the ability to form a strongly connected component, which petgraph does provide so I believe this is doable.

I haven't come up with a way to output the conflict between providers. In other words, in my current design, when a conflict happens, all I can do is to say hey surprise package X conflicts with packages Y, Z, ... I haven't figured out a way to say provider bin(X) conflicts with providers soname(liby) and name(Z).

This is not true, I over-complicated things. See #94 for details.