Summary: | sys-libs/musl ldconfig does not respect -r/$ROOT | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Vic Kerr (wikky) <wikky> |
Component: | Current packages | Assignee: | Anthony Basile <blueness> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jstein, lu_zero, musl, sam, toolchain, wikky |
Priority: | Normal | Keywords: | PATCH, PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/gentoo/gentoo/pull/22984 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Proposed fix |
>emerge --root=/foo calls ldconfig -r -X /foo.
Of course I meant ldconfig -X -r /foo.
(In reply to Wiktor Kerr from comment #1) > >emerge --root=/foo calls ldconfig -r -X /foo. > > Of course I meant ldconfig -X -r /foo. i haven't had a chance to look at this, but i assume you've tested emerging both with and without --root=/foo I don't want to commit this and break existing systems. the patch seems correct but i'd like confirmation that it works in both cases. (In reply to Anthony Basile from comment #2) > (In reply to Wiktor Kerr from comment #1) > > >emerge --root=/foo calls ldconfig -r -X /foo. > > > > Of course I meant ldconfig -X -r /foo. > > i haven't had a chance to look at this, but i assume you've tested emerging > both with and without --root=/foo I don't want to commit this and break > existing systems. the patch seems correct but i'd like confirmation that it > works in both cases. like here's the kind of thing i'm concerned about. there is a sanity check near the top: LDSO_CONF="/etc/ld.so.conf" if [[ ! -e $LDSO_CONF ]]; then echo "$LDSO_CONF not found" >&2 exit 1 fi this will only check the current root's ld.so.conf, not $ROOT/ld.so.conf. Oh boo, I think I just hit this. I was getting horrifying errors about being unable to find libgcc* but running ldconfig within the chroot helped. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd2656625bf0ed0b05e5b6de9ead4a73f09c58fe commit bd2656625bf0ed0b05e5b6de9ead4a73f09c58fe Author: Sam James <sam@gentoo.org> AuthorDate: 2021-11-18 00:45:48 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-11-19 03:02:40 +0000 sys-libs/musl: additional ROOT fixes for ldconfig Move around some declarations so we get sensible default values but only perform the sanity checks _after_ we parse command line arguments to take into account e.g. -r (root). Bug: https://bugs.gentoo.org/666246 Signed-off-by: Sam James <sam@gentoo.org> sys-libs/musl/files/ldconfig.in-r1 | 17 ++-- sys-libs/musl/musl-1.2.2-r5.ebuild | 167 +++++++++++++++++++++++++++++++++++++ sys-libs/musl/musl-9999.ebuild | 2 +- 3 files changed, 177 insertions(+), 9 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d41e6bdaff27bd16fbd33f46406f77e9074ae78 commit 9d41e6bdaff27bd16fbd33f46406f77e9074ae78 Author: Wiktor Kerr <w@kerr.sh> AuthorDate: 2021-11-18 00:43:49 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-11-19 03:02:31 +0000 sys-libs/musl: make ldconfig script respect -r Bug: https://bugs.gentoo.org/666246 Signed-off-by: Wiktor Kerr <w@kerr.sh> Signed-off-by: Sam James <sam@gentoo.org> sys-libs/musl/files/ldconfig.in-r1 | 146 +++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) Thanks both. This seems to work fine for me so far. This is being used in stages too without issue. |
Created attachment 546966 [details, diff] Proposed fix emerge --root=/foo calls ldconfig -r -X /foo. However, the ldconfig script bundled with the ebuild ignores the argument. When running emerge as user this manifests in most emerges asking: mv: replace '/etc/ld-musl-x86_64.path', overriding mode 0644 (rw-r--r--)? When running as root, it is even worse as the file in / is silently overwritten and the file in /foo is never created. Attached proposed patch that fixes the issue.