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

Bug 518422

Summary: dev-libs/glib and all packages which install gio modules should run gio-querymodules in pkg_postinst() phase
Product: Gentoo Linux Reporter: Alexander Tsoy <alexander>
Component: [OLD] GNOMEAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED FIXED    
Severity: normal CC: arfrever.fta, esigra
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 262490    
Attachments: glib-2.40.0-r1.ebuild.patch
glib-2.40.0-r1.ebuild.patch
glib-networking-2.40.1-r1.ebuild.patch

Description Alexander Tsoy 2014-07-28 20:41:12 UTC
Created attachment 381746 [details, diff]
glib-2.40.0-r1.ebuild.patch

Would be nice if dev-libs/glib and all packages which install gio modules run gio-querymodules in pkg_postinst() phase. This should speed up GIO at runtime, preventing it from trying and opening all available modules. Fedora do the same in their spec files, see [1][2] for examples.

Attaching a patch for the glib ebuild. I'm not sure if it is implemented correctly, but it did what I wanted:

$ LANG=C ls -l /usr/bin/gio-querymodules-*
-rwxr-xr-x 1 root root 10088 Jul 28 23:06 /usr/bin/gio-querymodules-amd64
-rwxr-xr-x 1 root root  9452 Jul 28 23:06 /usr/bin/gio-querymodules-x86
$ LANG=C ls -l /usr/lib*/gio/modules/giomodule.cache
-rw-r--r-- 1 root root 158 Jul 28 23:07 /usr/lib/gio/modules/giomodule.cache
-rw-r--r-- 1 root root 317 Jul 28 23:07 /usr/lib64/gio/modules/giomodule.cache

Non-comprehensive list of packages which should do the same cache update:

$ qfile /usr/lib64/gio/modules/* | awk '{print $1}' | sort -u
gnome-base/dconf
gnome-base/gconf
gnome-base/gvfs
net-libs/glib-networking

[1] http://pkgs.fedoraproject.org/cgit/glib2.git/tree/glib2.spec
[2] http://pkgs.fedoraproject.org/cgit/dconf.git/tree/dconf.spec
Comment 1 Arfrever Frehtes Taifersar Arahesis 2014-07-29 05:05:50 UTC
pkg_postrm() should delete these cache files.
Comment 2 Alexander Tsoy 2014-07-29 05:38:32 UTC
Hmm.. maybe pkg_prerm() would be better in that case? This way empty dirs (/usr/lib64/gio{,/modules}) will be removed by PM.
Comment 3 Alexander Tsoy 2014-07-29 05:50:13 UTC
(In reply to Alexander Tsoy from comment #0)

> Non-comprehensive list of packages which should do the same cache update:
> 
> $ qfile /usr/lib64/gio/modules/* | awk '{print $1}' | sort -u
> gnome-base/dconf
> gnome-base/gconf
> gnome-base/gvfs
> net-libs/glib-networking

Cache should be updated in pkg_postinst() and pkg_postrm()
Comment 4 Alexander Tsoy 2014-09-19 12:21:56 UTC
Created attachment 385112 [details, diff]
glib-2.40.0-r1.ebuild.patch

- Use MULTILIB_CHOST_TOOLS instead of manually renaming binaries
- Remove cache files in pkg_prerm()
Comment 5 Alexander Tsoy 2014-09-19 13:37:42 UTC
Created attachment 385122 [details, diff]
glib-networking-2.40.1-r1.ebuild.patch

Just an example of the patch needed for other packages installing GIO modules.
Comment 6 Pacho Ramos gentoo-dev 2014-09-19 16:04:04 UTC
I think last time we talked about this in the team (months ago... I can't remember :S) were thinking on adding tools for this in gnome2-utils.eclass like it's done with gnome2_gdk_pixbuf_update gnome2_query_immodules_gtk*...
Comment 8 Mart Raudsepp gentoo-dev 2017-03-28 13:34:30 UTC
commit 0bd3df485ff4afda075d8872614c0ab04e1dfd1c
Author: Mart Raudsepp <leio@gentoo.org>
Date:   Tue Mar 28 16:32:33 2017 +0300

    dev-libs/glib: fix GIO module cache file ownership and cross-compilation
    
    Bug 518422 tried to fix module cache file ownership to glib, but the ebuild
    changes missed /modules path and used $libdir/gio/ instead of $libdir/gio/modules
    
    While cross-compiling, we can't generate the cache file, so we shouldn't
    die out either. Instead of removing the die, rework it all to not do any
    of it while cross-compiling, because we'd end up with an empty glib owned
    cache file, which could result in no modules working at all as a cache
    file is present from the preinst touch.
    
    Gentoo-bug: 518422
    Gentoo-bug: 613306
    Thanks-to: Alexis Ballier <aballier@gentoo.org>