Merging x11-libs/gtk+-2.24.28-r1 as non root user and when $ROOT is not '/' installs but produces the following error: ERROR: postinst ERROR: x11-libs/gtk+-2.24.28-r1::gentoo failed (postinst phase): Update immodules cache failed (for amd64) Call stack: ebuild.sh, line 93: Called pkg_postinst environment, line 3957: Called multilib_parallel_foreach_abi 'multilib_pkg_postinst' environment, line 3684: Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib_pkg_postinst' environment, line 3271: Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib_pkg_postinst' environment, line 3269: Called _multilib_multibuild_wrapper 'multilib_pkg_postinst' environment, line 759: Called multilib_pkg_postinst environment, line 3955: Called die The specific snippet of code: gnome2_query_immodules_gtk2 || die "Update immodules cache failed (for ${ABI})" If you need support, post the output of `emerge --info '=x11-libs/gtk+-2.24.28-r1::gentoo'`, the complete build log and the output of `emerge -pqv '=x11-libs/gtk+-2.24.28-r1::gentoo'`. The complete build log is located at '/home/portage/bin-xlalx/logs/x11-libs:gtk+-2.24.28-r1:20150823-154451.log'. The ebuild environment file is located at '/var/tmp/portage/tmpfs/xlalx/portage/x11-libs/gtk+-2.24.28-r1/temp/environment'. Working directory: '/usr/lib64/python3.4/site-packages' S: '/var/tmp/portage/tmpfs/xlalx/portage/x11-libs/gtk+-2.24.28-r1/work/gtk+-2.24.28' The relevant part of the build.log: * Updating desktop mime database ... * Updating shared mime info database ... Note that '/home/portage/bin-xlalx/root/usr/share' is not in the search path set by the XDG_DATA_HOME and XDG_DATA_DIRS environment variables, so applications may not be able to find it until you set them. The directories currently searched are: - /var/tmp/portage/tmpfs/xlalx/portage/x11-libs/gtk+-2.24.28-r1/temp/.local/share - /usr/local/share - /usr/share * abi_x86_64.amd64: running multilib_pkg_postinst Failed to create file '/usr/lib64/gtk-2.0/2.10.0/immodules.cache.ZQBU3X': Permission denied * ERROR: x11-libs/gtk+-2.24.28-r1::gentoo failed (postinst phase): * Update immodules cache failed (for amd64) * * Call stack: * ebuild.sh, line 93: Called pkg_postinst * environment, line 3957: Called multilib_parallel_foreach_abi 'multilib_pkg_postinst' * environment, line 3684: Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib_pkg_postinst' * environment, line 3271: Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib_pkg_postinst' * environment, line 3269: Called _multilib_multibuild_wrapper 'multilib_pkg_postinst' * environment, line 759: Called multilib_pkg_postinst * environment, line 3955: Called die * The specific snippet of code: * gnome2_query_immodules_gtk2 || die "Update immodules cache failed (for ${ABI})" * * If you need support, post the output of `emerge --info '=x11-libs/gtk+-2.24.28-r1::gentoo'`, * the complete build log and the output of `emerge -pqv '=x11-libs/gtk+-2.24.28-r1::gentoo'`. * The complete build log is located at '/home/portage/bin-xlalx/logs/x11-libs:gtk+-2.24.28-r1:20150823-154451.log'. * The ebuild environment file is located at '/var/tmp/portage/tmpfs/xlalx/portage/x11-libs/gtk+-2.24.28-r1/temp/environment'. * Working directory: '/usr/lib64/python3.4/site-packages' * S: '/var/tmp/portage/tmpfs/xlalx/portage/x11-libs/gtk+-2.24.28-r1/work/gtk+-2.24.28' * FAILED postinst: 1 >>> Regenerating /home/portage/bin-xlalx/root/etc/ld.so.cache... /sbin/ldconfig: need absolute file name for configuration file when using -r Possible fix: Portage should point gtk-query-immodules to the $ROOT instead of '/' (maybe by setting correct GTK_EXE_PREFIX) or skip running it when installing to non standard location. (I didn't checked gtk3, but the gnome2_query_immodules code looks exactly the same and will probably produce the same error.) --- gnome2-utils.eclass.orig 2015-08-23 20:02:57.160700201 +0300 +++ gnome2-utils.eclass 2015-08-23 20:12:13.067484966 +0300 @@ -447,7 +447,12 @@ local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-2.0 [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0 - "${updater}" --update-cache + if [[ "$ROOT" = "/" ]]; then + "${updater}" --update-cache + else + ewarn "We cannot run gtk-query-immodules-2.0 (most likely ROOT!=/)" + ewarn "Please run '${updater} --update-cache' manually" + fi } # @FUNCTION: gnome2_query_immodules_gtk3 @@ -458,7 +463,12 @@ local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-3.0 [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0 - "${updater}" --update-cache + if [[ "$ROOT" = "/" ]]; then + "${updater}" --update-cache + else + ewarn "We cannot run gtk-query-immodules-3.0 (most likely ROOT!=/)" + ewarn "Please run '${updater} --update-cache' manually" + fi } # @FUNCTION: gnome2_disable_deprecation_warning
Interesting. The best solution IMHO would be to patch gtk-query-immodules-2.0 so it writes to $ROOT/usr/lib64/gtk-2.0/2.10.0/immodules.cache instead of /usr/lib64/gtk-2.0/2.10.0/immodules.cache In fact, I am very surprised that it doesn't write to the right directory already (I thought we are passing the complete list of prefix directories to gtk's configure?) Please emerge strace (if you haven't already) and attach the output of "strace gtk-query-immodules-2.0 --update-cache" Also, please attach output of "emerge --info gtk+" for reference.
(In reply to Alexandre Rostovtsev from comment #1) > Interesting. The best solution IMHO would be to patch > gtk-query-immodules-2.0 so it writes to > $ROOT/usr/lib64/gtk-2.0/2.10.0/immodules.cache instead of > /usr/lib64/gtk-2.0/2.10.0/immodules.cache > > In fact, I am very surprised that it doesn't write to the right directory > already (I thought we are passing the complete list of prefix directories to > gtk's configure?) I am sorry, I misunderstood: you are talking about $ROOT for cross-compiling, not about prefix on another os. Then this is a bit of a problem because with cross-compiling there is no guarantee that we can execute gtk-query-immodules-2.0 at all. And we do want to generate the cache file somehow :/
Created attachment 409974 [details] ./emerge.sh --info gtk+ ./emerge.sh is copy pasted from sys-devel/crossdev package to setup crossbuild environment: #!/bin/sh # Copyright 2008-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 CHOST='x86_64-pc-linux-gnu' SYSROOT='/home/portage/bin-xlalx/root' PORTAGE_CONFIGROOT='/home/portage/bin-xlalx' export CHOST SYSROOT PORTAGE_CONFIGROOT # Portage defaults CBUILD to CHOST, so we have to remove CHOST # from the env to get a "good" value for CBUILD query_vars="CBUILD CFLAGS CXXFLAGS CPPFLAGS LDFLAGS" clean_vars="${query_vars} CHOST SYSROOT PORTAGE_CONFIGROOT" eval $(env $(printf -- '-u %s ' ${clean_vars}) \ portageq envvar -v ${query_vars} | sed s:^:_E_:) CBUILD="${_E_CBUILD}" BUILD_CFLAGS="${_E_CFLAGS}" BUILD_CXXFLAGS="${_E_CXXFLAGS}" BUILD_CPPFLAGS="${_E_CPPFLAGS}" BUILD_LDFLAGS="${_E_LDFLAGS}" export CBUILD BUILD_CFLAGS BUILD_CXXFLAGS BUILD_CPPFLAGS BUILD_LDFLAGS exec emerge --root-deps=rdeps $@
Created attachment 409976 [details] sudo strace root/usr/bin/gtk-query-immodules-2.0 --update-cache
Created attachment 409978 [details] sudo GTK_EXE_PREFIX=/home/portage/bin-xlalx/root/usr strace root/usr/bin/gtk-query-immodules-2.0 --update-cache
(In reply to Alexandre Rostovtsev from comment #2) It may be possible to use host's (native) gtk-query-immodules-2.0 for that.
Created attachment 409980 [details, diff] gnome2-utils.eclass patch Please check if this patch works for you.
(In reply to Alexandre Rostovtsev from comment #7) The patch works great. The immodules.cache was installed in ${ROOT}/usr/lib64/gtk-2.0/2.10.0/immodules.cache (for ABI_X86=64) and ${ROOT}/usr/lib32/gtk-2.0/2.10.0/immodules.cache (for ABI_X86=32) without any (visible) issues. Relevant part of the build.log: * Updating desktop mime database ... * Updating shared mime info database ... Note that '/home/portage/bin-xlalx/root/usr/share' is not in the search path set by the XDG_DATA_HOME and XDG_DATA_DIRS environment variables, so applications may not be able to find it until you set them. The directories currently searched are: - /var/tmp/portage/tmpfs/xlalx/portage/x11-libs/gtk+-2.24.28-r1/temp/.local/share - /usr/local/share - /usr/share * abi_x86_32.x86: running multilib_pkg_postinst * Updating gtk2 input method module cache ... [ ok ] * abi_x86_64.amd64: running multilib_pkg_postinst * Updating gtk2 input method module cache ... [ ok ] * Please install app-text/evince for print preview functionality. * Alternatively, check "gtk-print-preview-command" documentation and * add it to your gtkrc. >>> x11-libs/gtk+-2.24.28-r1 merged. >>> Regenerating /home/portage/bin-xlalx/root/etc/ld.so.cache...
Thanks a lot for reporting and testing this, committed! https://cgit.gentoo.org/repo/gentoo.git/commit/?id=9d3858da72879dbb8550bc09f99787e6d33f4815