When installing shlibsign to a seperate ROOT, the dynamic dependencies for shlibsign may not be available. i.e. the dependancies libnspr4.so, libplc4.so from dev-libs/nspr are installed in the root but may not be available in a standard path for the loader e.g. emerge --root /somewhere dev-libs/nss (ensuring dev-libsnspr isn't already installed on the host calling emerge) Reproducible: Always Steps to Reproduce: 1.emerge --root /somewhere dev-libs/nss 2. 3. Actual Results: shlibsign: error while loading shared libraries: libnspr4.so Expected Results: No fatal error
Created attachment 925699 [details, diff] Patch for nss-3.101.2 In this patch I move the call to shlibsign from post_pkginstall to pkg_config. If ROOT is unset then proccedd to call pkg_config else display a message to the user to invoke emerge --config
Yeah, calling dynamically linked binaries from ROOT during pkg_postinst really cannot work reliably. The runtime linker will always look for libs in /, not ROOT.
Comment on attachment 925699 [details, diff] Patch for nss-3.101.2 PMS says that ebuilds cannot call phase functions, so calling pkg_config from pkg_postinst is not allowed. You could move the logic out of pkg_config into a separate function that can be called from both pkg_config and pkg_postinst.
PMS reference: https://dev.gentoo.org/~ulm/pms/head/pms.html#section-9.1
(In reply to Mike Gilbert from comment #3) > Comment on attachment 925699 [details, diff] [details, diff] > Patch for nss-3.101.2 > > PMS says that ebuilds cannot call phase functions, so calling pkg_config > from pkg_postinst is not allowed. > > You could move the logic out of pkg_config into a separate function that can > be called from both pkg_config and pkg_postinst. Okay. I can ammend the patch, if that's useful.
(In reply to whoisxy from comment #5) > (In reply to Mike Gilbert from comment #3) > > Comment on attachment 925699 [details, diff] [details, diff] [details, diff] > > Patch for nss-3.101.2 > > > > PMS says that ebuilds cannot call phase functions, so calling pkg_config > > from pkg_postinst is not allowed. > > > > You could move the logic out of pkg_config into a separate function that can > > be called from both pkg_config and pkg_postinst. > > Okay. I can ammend the patch, if that's useful. Yes please, if you have the environment to test it and verify it's working fine after. I'd also prefer getting a proper pull request via https://github.com/gentoo/gentoo (https://wiki.gentoo.org/wiki/Creating_GitHub_Pull_Requests) but if you're not familiar with that, patch here is okay too.