Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 611030

Summary: gnome2-utils.eclass: gnome2_query_immodules_gtk2(), gnome2_query_immodules_gtk3() should use ${EROOT}; x11-libs/gtk+ should ignore failure of gnome2_query_immodules_gtk${SLOT}()
Product: Gentoo Linux Reporter: William Throwe <wtt6>
Component: EclassesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED FIXED    
Severity: normal CC: chewi, mgorny
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
URL: https://archives.gentoo.org/gentoo-dev/message/8f6e842ed85609e707e464de9849f5d4
Whiteboard:
Package list:
Runtime testing required: ---

Description William Throwe 2017-02-26 19:59:15 UTC
This log is from a binpkg install, but I don't think it matters for this.

>>> Extracting info
 * Package:    x11-libs/gtk+-2.24.31-r1
 * Repository: gentoo
 * USE:        elibc_glibc abi_x86_64 introspection kernel_linux amd64 userland_
GNU
 * FEATURES:   compressdebug preserve-libs sandbox splitdebug userpriv usersandb
ox
>>> Extracting x11-libs/gtk+-2.24.31-r1
 * abi_x86_64.amd64: running multilib_pkg_preinst
 * abi_x86_64.amd64: running multilib_pkg_postinst
 * Updating gtk2 input method module cache ...
/var/tmp/portage/x11-libs/gtk+-2.24.31-r1/temp/environment: line 2797: /usr/bin/
gtk-query-immodules-2.0: No such file or directory
 [ !! ]
 * ERROR: x11-libs/gtk+-2.24.31-r1::gentoo failed (postinst phase):
 *   Update immodules cache failed (for amd64)


The problem is that gnome2_query_immodules_gtk2 tries to call ${EPREFIX}/usr/bin/
gtk-query-immodules-2.0 in pkg_postinstall.  That executable is provided by gtk+ itself, but it just got installed to ROOT rather than /.  Since gtk+ can't DEPEND on itself to ensure the executable is present and the one in ROOT cannot generally be run, I think this call should either be skipped for ROOT != / or any failure should be ignored.
Comment 1 Arfrever Frehtes Taifersar Arahesis 2017-02-27 18:49:16 UTC
These are 2 separate bugs:


1. gnome2-utils.eclass: gnome2_query_immodules_gtk2(), gnome2_query_immodules_gtk3() should use ${EROOT}

Some functions in gnome2-utils.eclass have updater=${EROOT}... but gnome2_query_immodules_gtk2() and gnome2_query_immodules_gtk3() have updater=${EPREFIX}/...


2. x11-libs/gtk+ should ignore failure of gnome2_query_immodules_gtk${SLOT}()

x11-libs/gtk+ ebuilds have:
multilib_pkg_postinst() {
    gnome2_query_immodules_gtk${SLOT} \
        || die "Update immodules cache failed (for ${ABI})"
}

Probably it is better to drop this '|| die ...'.
Comment 2 James Le Cuirot gentoo-dev 2017-04-22 09:09:20 UTC
The problem is this will break when cross-compiling. This is why we need bug #317337 sorted. Even then, I'm not sure that it would work in this case though. Why is the tool prefixed with CHOST? Does it do something platform-specific?
Comment 3 Larry the Git Cow gentoo-dev 2020-12-07 22:06:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f6f9ad2c9c3dd85ae5f538a0a50cb1cd3a84ada

commit 9f6f9ad2c9c3dd85ae5f538a0a50cb1cd3a84ada
Author:     David Michael <fedora.dm0@gmail.com>
AuthorDate: 2020-12-03 04:04:39 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2020-12-07 22:06:34 +0000

    gnome2-utils.eclass: skip executing cross-compiled tools
    
    Executing tools installed in ROOT will fail when cross-compiling,
    so this prints a warning about manually running the command instead
    in that case.  The warning is copied from dev-libs/glib.
    
    This also reorders the exception handling by increasing severity so
    that the "nothing to do" non-error returns first, otherwise the
    expected problem of unexecutable cross-compiled commands returns,
    otherwise the unexpected problem of missing commands returns.
    
    The immodule cache functions were updated to handle a different
    problem.  They run native tools from BROOT, but they are not
    guaranteed to exist while cross-compiling (e.g. gtk+ can't BDEPEND
    on itself, so the cross-compiled gtk+ can be installed before the
    native gtk+, which fails from gtk-query-immodules not existing).
    
    Closes: https://bugs.gentoo.org/611030
    Closes: https://bugs.gentoo.org/757483
    Signed-off-by: David Michael <fedora.dm0@gmail.com>
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 eclass/gnome2-utils.eclass | 98 +++++++++++++++++++++++++++++++++++-----------
 1 file changed, 75 insertions(+), 23 deletions(-)