-
Notifications
You must be signed in to change notification settings - Fork 280
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
New scheduler breaks new installation with circular dependencies #2332
Comments
Hmm, from my perspective I don't see a convincing use-case for circular dependencies. In the example given where libarchive depends on runtime and runtime depends on libarchive it seems to me that this is a strong indication that they should be merged into a single package. The FreeBSD porter's handbook agrees that circular dependencies are to be avoided: https://docs.freebsd.org/en/books/porters-handbook/makefiles/#makefile-circular-dependencies
However, since pkg has allowed installing circular dependencies in the past, there are almost certainly existing pkg databases in the wild with circular dependencies installed. In its current state, the new scheduler will not only refuse to install packages part of a circular dependency loop but refuse to upgrade or delete such packages as well. This of course poses a problem. It's impossible for any scheduler to uphold the desired ordering guarantees in the presence of circular dependencies. We could however add some kind of optional bypass that breaks the strict ordering guarantees made by the scheduler and allows fixing an old pkg database with circular dependencies installed by uninstalling/upgrading packages to break the dependency loop. It's not clear to me how widespread existing databases with circular dependencies installed are in practice. Neither @bapt or I had any issues with this while testing. Could you share more about your use case/where you are obtaining these packages with circular dependencies from? |
pkg should not accept circular dependencies and we should kill them if any |
Hi Isaac, thank you for the detailed answer. I ran into this while looking at https://bugs.freebsd.org/bugzilla//show_bug.cgi?id=265061 With externalizing the problem into shlibs_required/shlibs_provided you are allowing and in fact relying on "soft" circularity between packages. I am always in favour of more strict/well defined, so for my use case I will need to look for a different angle to solve it. Cheers, |
@kevemueller I've actually been looking into PR 265061 as well, I just opened #2333 and outlined the next steps I plan to take as a comment on #2331. Let's keep discussion specific to that issue/potential solutions out of this thread though. In any case, if we hit circular dependencies in pkgbase packages I think the correct solution is to restructure the packages such that there are no circular dependencies. I personally would be fine closing this issue for now and kicking the can down the road to when a user complains about pkg refusing to delete/upgrade circular dependencies in their existing pkg database. It seems too optimistic to assume that will never happen, though it will be good to identify where the circular dependencies came from when it eventually does I guess. |
Thx & keep up the good work! |
The new scheduler implemented via #2330 changes previously accepted package installations.
Previously two packages depending on each other could be installed. E.g.
On an empty database
pkg install runtime
installed both packages.The new scheduler determines the needed packages to be installed, but then bails with
@ifreund
I wonder if this use case was considered and the change breaking previously acceptable lenient functionality made deliberately.
The text was updated successfully, but these errors were encountered: