GNOME Bugzilla – Bug 759613
dependencies should be resilient against search paths and directory ordering
Last modified: 2015-12-19 22:57:59 UTC
Created attachment 317598 [details] [review] patch implementing topological sort Previously, if a plugin info was discovered with dependencies before it's dependency was discovered, there was a chance that the ordering would be undefined. Instead, this uses topological sort and reapplies the sorting after every addition so that delayed dependencies can be applied. Since this uses a GList for everything, I switched the GQueue plugin_list back to a GList *plugin_list.
Review of attachment 317598 [details] [review]: Apart from the typo, not sure what to say. What I would expect is an unit test though. ::: libpeas/peas-engine.c @@ +238,3 @@ + add_to_sorted: + if (depth == -1) + /* we failed to reolsve the dependency, so push to the end */ typo
We already have some unit tests for dependency solving, which this passes. The difficulty is that it is hard to control the order of children in the directory inode. However, maybe we can play with search paths to force it to happen.
Created attachment 317623 [details] [review] engine: use topological sort to resolve dependency graph Previously, if a plugin info was discovered with dependencies before it's dependency was discovered, there was a chance that the ordering would be undefined. Instead, this uses topological sort and reapplies the sorting after every addition so that delayed dependencies can be applied. Since this uses a GList for everything, I switched the GQueue plugin_list back to a GList *plugin_list.
Created attachment 317680 [details] [review] Fix sorting of PeasEngine:plugin-list The new "better order" ended up breaking the order to be correct in regards to dependencies.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.