Repository navigation
Conversation
|
Don't we have topological sort for that purposes? |
|
Not sure what topological sorting has to do with this issue. In the test I added there are just two packages depending on each other. Without this fix the |
That's the main purpose of topological sort. You're proposing to use O(N^2) check for names lookup that doesn't look nice. If you need something like "seen" definition, you need a simple set. If you need dependency graph lookup to find cycles, pkg already has topological sort for that somewhere in the solver. For sure, O(N^2) here is usually not a problem once number of packages that are added is low, but this sort of things are usually just waiting to blow up for someone in the future. I'm also pretty sure that |
Yes, ideally we want a set there, but since this is not C++ and there is no
That was my assumption that the number of packages we go over when doing
I just wanted to add a safety belt. We haven't seen cycles in the official repos until now, but with shlib provides/requires being enabled it is now possible to pick up a wrong provider package, which in turn will lead to a cycle. This change allows for a graceful failure in this case. |
Got it, then I guess it will be suitable to use a set and be sure it's not leaking memory on error paths. Upper interfaces, such as pkg-install, provides safeguards from cycles but it's always good to have some extra layer of safety if it's cheap :) |
|
I'll employ |
No description provided.