New comment by st3r4g on void-packages repository https://github.com/void-linux/void-packages/issues/20438#issuecomment-605719104 Comment: I think `xbps-src` could be improved to handle such a scenario, which is not so uncommon. For example, `libglvnd` needs at least one GL vendor to work, but adding `depends=mesa` would introduce an endless loop at the moment. One could detect the loop and break out of it, but it doesn't feel very elegant. Instead, what about making `xbps-src` build all the runtime dependencies **after** their "parent" package (i.e. the one that is being built)? I did a little experiment in this branch: https://github.com/st3r4g/void-packages/tree/xbps-src-rdeps Obviously this is not feasible right now, as packages would be added to the index before some of their dependencies are built. But I believe this could work with a better staging mechanism, handled outside of `xbps-rindex`. The current staging mechanism cannot handle multiple repositories, so it needs to be improved anyway. It was proposed something like: `xbps-rindex` always stages, a new tool (multirepo aware) checks for publishing the packages that are ready (shlibs and runtime deps checks).