Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 910526 - gnome2-utils.eclass: gnome2_giomodule_cache_update calls binary from ROOT
Summary: gnome2-utils.eclass: gnome2_giomodule_cache_update calls binary from ROOT
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-19 01:51 UTC by Matt Jolly
Modified: 2024-03-13 09:13 UTC (History)
3 users (show)

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


Attachments
failing emerge in container (file_910526.txt,85.13 KB, text/plain)
2023-07-19 01:52 UTC, Matt Jolly
Details
successful emerge in container (file_910526.txt,82.54 KB, text/plain)
2023-07-19 01:52 UTC, Matt Jolly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Jolly gentoo-dev 2023-07-19 01:51:21 UTC
I am unable to successfully install `dev-libs/glib` into a different ROOT from a lightweight build container without `dev-libs/glib` installed.

`gnome2_giomodule_cache_update` fails to run for amd64:

```
# emerge --root=/tmp/test dev-libs/glib --verbose
* abi_x86_64.amd64: running multilib_pkg_postinst
 * Updating GIO modules cache ...
/tmp/test/usr/bin/x86_64-pc-linux-gnu-gio-querymodules: error while loading 
shared libraries: libgmodule-2.0.so.0: cannot open shared object file: No such file or directory

# find / -type f -iname '*libgmodule*'

/tmp/test/usr/lib64/libgmodule-2.0.so.0.7600.3

```

Reproducible: Always

Steps to Reproduce:
1. Install Kubler (see wiki; ebuild development)
2. Run up an interactive builder
3. emerge --root=/tmp/test dev-libs/glib --verbose

note; kubler has `--quiet-build` in the emerge default args
Comment 1 Matt Jolly gentoo-dev 2023-07-19 01:52:12 UTC
Created attachment 865770 [details]
failing emerge in container
Comment 2 Matt Jolly gentoo-dev 2023-07-19 01:52:50 UTC
Created attachment 865771 [details]
successful emerge in container
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-19 22:44:23 UTC
wait, is it running before ldconfig or something so the symlinked lib doesn't exist yet?
Comment 4 Mike Gilbert gentoo-dev 2023-07-20 17:13:23 UTC
The function skips the cache update when cross-compiling (${CBUILD} != ${CHOST}).

Calling binaries from ${ROOT} is probably a bad idea, regardless of whether we are cross-compiling. The runtime linker will always try to load libraries from ${BROOT}, which will lead to conflicts like this one.
Comment 5 Eli Schwartz gentoo-dev 2024-03-13 02:42:16 UTC
This is an interesting one. If I recall correctly, the command has to run in the actual ROOT because it fully regenerates the cache and simultaneously depends on plugins you've installed.

If you run without the plugins, that's not very good. But the plugins may be for files other than the ones you just installed. IDEPEND isn't a good fit for this as a) you can uninstall them, b) you might use a different BROOT to perform updates and the IDEPEND for some random other package isn't installed...

I think the conservative choice is to skip doing anything when ROOT != BROOT.

For bonus points we'd probably want to follow up by making this actually work, by chrooting in to run the command. Of course that would still need to guard against cross compiling, but it's still partial coverage of ROOT, which is better than *only* working via option 1.
Comment 6 Mart Raudsepp gentoo-dev 2024-03-13 09:13:02 UTC
Should we be trying to update it with the BROOT tooling if possible?
Haven't really thought about the specifics yet myself, just throwing it out there for consideration