PMS says a package's DEPEND must be present at the time of merge, but it doesn't say that for RDEPEND. ulm dug up the following interesting changes over time to the phrasing in PMS: - https://gitweb.gentoo.org/proj/pms.git/commit/?id=f7028c2758d8da7c1339ba33d89d21b3e720e0bb - https://gitweb.gentoo.org/proj/pms.git/commit/?id=2f0989d0b6ee10d60593f4d800a1cf5b662f450f - https://gitweb.gentoo.org/proj/pms.git/commit/?id=b7079f361efcc44d774b525b8907ae8d1a329b27
We've had a note about this in the devmanual for a long time at https://devmanual.gentoo.org/general-concepts/dependencies/#runtime-dependencies: """ Items which are in RDEPEND but not DEPEND could in theory be merged after the target package. Portage does not currently do this. """ Prompted by spotting https://issuetracker.google.com/issues/283464020 (although the phrasing there might be slightly different to what we want?)
This seems like a bad idea to me. Despite what PMS says, there are likely packages that require the current behavior. And I think the current behavior makes more sense anyway. I think PMS should be updated, not Portage. For example, see bug 902207. There, we have acct-group packages which are in RDEPEND in acct-user packages. The groups MUST be merged before the users, or useradd will fail. Listing the acct-group packages in DEPEND is wrong, and will be ineffective for binpkg installations. Listing the acct-group packages in IDEPEND is wrong when BROOT != ROOT.