Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 954224 - dev-libs/nss: shlibsign: error while loading shared libraries
Summary: dev-libs/nss: shlibsign: error while loading shared libraries
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-22 18:28 UTC by whoisxy
Modified: 2025-04-24 07:26 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for nss-3.101.2 (nss-3.101.2.ebuild.patch,1.03 KB, patch)
2025-04-22 18:33 UTC, whoisxy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description whoisxy 2025-04-22 18:28:17 UTC
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
Comment 1 whoisxy 2025-04-22 18:33:16 UTC
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
Comment 2 Mike Gilbert gentoo-dev 2025-04-22 18:36:51 UTC
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 3 Mike Gilbert gentoo-dev 2025-04-22 18:40:20 UTC
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.
Comment 4 Mike Gilbert gentoo-dev 2025-04-22 18:40:30 UTC
PMS reference: https://dev.gentoo.org/~ulm/pms/head/pms.html#section-9.1
Comment 5 whoisxy 2025-04-22 18:50:42 UTC
(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.
Comment 6 Joonas Niilola gentoo-dev 2025-04-24 07:26:14 UTC
(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.