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

Bug 567192

Summary: [TRACKER] dev-libs/gobject-introspection-1.46.0: g-ir-scanner causes sandbox violation - packages trying to use XDG_CACHE_HOME in real file system
Product: Gentoo Linux Reporter: r3lgar <r3lgar>
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: CONFIRMED ---    
Severity: normal CC: darwinskernel, leho, mudler, nbowler, office, printing, reavertm, redwolfe, sam, toralf, zsojka
Priority: Normal Keywords: Tracker
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: https://git.gnome.org/browse/gobject-introspection/commit/?id=047244537c8ad5725cc3f8e4f9ea0d5e226fe7e0
See Also: https://bugs.gentoo.org/show_bug.cgi?id=575890
https://bugs.gentoo.org/show_bug.cgi?id=529182
https://bugs.gentoo.org/show_bug.cgi?id=499288
https://bugs.gentoo.org/show_bug.cgi?id=444568
Whiteboard: Failing packages need to use xdg.eclass or, at least, xdg_environment_reset from xdg-utils.eclass
Package list:
Runtime testing required: ---
Bug Depends on: 583610, 586722, 586872, 587946, 603062, 622778, 641102, 649932, 652870, 656504, 660854, 661526, 666878, 678982, 679050, 679072, 679078, 679080, 679082, 679086, 679116, 679118, 679120, 679154, 679164, 679186, 679190, 679208, 679306, 679308, 679334, 679348, 679364, 679542, 679550, 679614, 679616, 679712, 679830, 679832, 679974, 680074, 680078, 680142, 680146, 680154, 680156, 680254, 680960, 681206, 681958, 682024, 682114, 683418, 572256, 575140, 577702, 577704, 578078, 583072, 583636, 585484, 586202, 586408, 586518, 586588, 586596, 586600, 586604, 586660, 586662, 586720, 586756, 586758, 586806, 586818, 586830, 586832, 587020, 587034, 587036, 587038, 587148, 587160, 587330, 587384, 587418, 587446, 587552, 587580, 587656, 587660, 587700, 587770, 587810, 587832, 587834, 587868, 587870, 587876, 587888, 587944, 588158, 588178, 588570, 588686, 589074, 589112, 589310, 589426, 590022, 590638, 591014, 591162, 591462, 591952, 592228, 592322, 592762, 593792, 596166, 597336, 599128, 599576, 600324, 601500, 603058, 605702, 606484, 607458, 609152, 612002, 614300, 618670, 621040, 621164, 621238, 621760, 622774, 622940, 623166, 623662, 623824, 623934, 623992, 625982, 627078, 627850, 628114, 632273, 633474, 633560, 635022, 636910, 638352, 638706, 639460, 647042, 650628, 651934, 653104, 653414, 656780, 656926, 657346, 658686, 660722, 662478, 662596, 667182, 669680, 670400, 674824, 675514, 675894, 677740, 677810, 678198, 678960, 678964, 678966, 678968, 678970, 678974, 678980, 678984, 678986, 679000, 679012, 679052, 679054, 679056, 679060, 679062, 679064, 679066, 679068, 679070, 679076, 679092, 679110, 679112, 679114, 679128, 679130, 679152, 679182, 679192, 679216, 679248, 679272, 679280, 679282, 679320, 679328, 679344, 679434, 679544, 679606, 679608, 679610, 679638, 679708, 679796, 679946, 679970, 680064, 680068, 680080, 680144, 680150, 680166, 680356, 680358, 680476, 680566, 680734, 680946, 681072, 681202, 681204, 681208, 681544, 682102, 682346, 682536, 682608, 683310, 684052    
Bug Blocks:    
Attachments: media-libs/harfbuzz-1.0.6 log
app-text/poppler-0.38.0 log
/var/log/sandbox/sandbox-29794.log
harfbuzz sandbox log
poppler sandbox log

Description r3lgar 2015-11-30 21:53:41 UTC
# emerge --info
Portage 2.2.26 (python 2.7.10-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.3, glibc-2.22-r1, 4.3.0-gentoo x86_64)
=================================================================
System uname: Linux-4.3.0-gentoo-x86_64-Intel-R-_Core-TM-_i7-4770K_CPU_@_3.50GHz-with-gentoo
KiB Mem:     8057224 total,    411552 free
KiB Swap:   33554428 total,  33554384 free
Timestamp of repository gentoo: Mon, 30 Nov 2015 19:41:51 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10-r3::gentoo, 3.4.3-r2::gentoo
dev-util/cmake:           3.4.0-r1::gentoo
dev-util/pkgconfig:       0.29::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/sandbox:         2.9::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r1::gentoo
Repositories:

gentoo
    location: /usr/overlays/gentoo
    sync-type: git
    sync-uri: git://github.com/gentoo-mirror/gentoo.git
    priority: -1000

mozilla
    location: /usr/overlays/mozilla
    sync-type: git
    sync-uri: git://gitweb.gentoo.org/proj/mozilla.git
    masters: gentoo
    priority: 10

nightmare
    location: /usr/overlays/nightmare
    sync-type: git
    sync-uri: https://gitlab.com/r3lgar/nightmare.git
    masters: gentoo
    priority: 1000

Installed sets: @kernel
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=y --quiet-fail=y --autounmask=y --autounmask-write=y 	--with-bdeps=y --keep-going -Aa"
FCFLAGS="-O2 -pipe"
FEATURES="binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync news notitles parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms split-elog split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X aac acl acpi aes alac alsa amd64 apng audiofile avx avx2 btrfs bzip2 cairo classic cli cracklib crypt cue curl custom-cflags custom-optimization cxx dbus dirac dmx dri drm dts dv e2fsprogs egl encode exif faac faad fam fat fbcon ffmpeg fftw firefox flac fma3 fontconfig fortran ftp gallium ggi gif glamor glib gmp gpm gstreamer gtk gtk2 gtkstyle gudev hddtemp iconv icu id3tag idn imlib imlib2 introspection iproute2 ipv4 jabber joystick jpeg ladspa lame lcms libass libffi libmpeg2 libnotify libsamplerate lm_sensors lua lzma lzo mad matroska midi minizip mmx mng modules mp3 mp4 mp4v2 mpd mpeg mpg123 multilib ncurses nettle nls nptl nss ntfs ogg openal opencl opengl openmp openssl pam pango pcre png policykit popcnt postproc ppds python qt4 quicktime rar readline reiserfs script sdl seccomp session shine smp sndfile sound sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg symlink system-libvpx systemd taglib tga theora threads tiff tls tools truetype twolame udev udisks unicode upnp upower usb v4l vaapi vdpau vorbis wav wavpack wma wma-fixed wxwidgets x264 xattr xcb xcomposite xinerama xml xmpp xpm xrandr xv xvid xvmc zip zlib zsh-completion" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="x86_64 i386" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="radeonsi amdgpu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="-2.6 2.7 -3.2 3.4"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 r3lgar 2015-11-30 21:56:07 UTC
Created attachment 418248 [details]
media-libs/harfbuzz-1.0.6 log
Comment 2 r3lgar 2015-11-30 21:58:05 UTC
Created attachment 418250 [details]
app-text/poppler-0.38.0 log
Comment 3 r3lgar 2015-11-30 22:00:39 UTC
 # emerge -pv media-libs/harfbuzz app-text/poppler

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] media-libs/harfbuzz-1.0.6:0/0.9.18::gentoo  USE="cairo fontconfig glib graphite icu introspection truetype -static-libs {-test}" ABI_X86="32 (64) (-x32)" 0 KiB
[ebuild  N     ] app-text/poppler-0.38.0:0/57::gentoo  USE="cairo curl cxx introspection jpeg jpeg2k lcms png qt4 tiff utils -cjk -debug -doc (-qt5)" 0 KiB
Comment 4 SpanKY gentoo-dev 2015-12-02 17:27:39 UTC
i don't see what sandbox has to do with it.  packages shouldn't access /root/.
Comment 5 r3lgar 2015-12-02 19:30:26 UTC
(In reply to SpanKY from comment #4)
You're right. FEATURES=-sandbox gives same result.
Comment 6 r3lgar 2015-12-02 19:33:49 UTC
Created attachment 418390 [details]
/var/log/sandbox/sandbox-29794.log
Comment 7 r3lgar 2015-12-02 19:35:15 UTC
Created attachment 418392 [details]
harfbuzz sandbox log
Comment 8 r3lgar 2015-12-02 19:36:53 UTC
Created attachment 418394 [details]
poppler sandbox log
Comment 9 Gilles Dartiguelongue (RETIRED) gentoo-dev 2015-12-02 23:03:40 UTC
Could you paste the output of:
$ getent passwd portage

I guess something is using /root as its home while building and gobject-introspection uses /root/.cache to cache some of its work which results in this sandbox error.

To solve this, the ebuilds can use xdg.eclass that should properly setup the environment to a temporary directory under portage control.
Comment 10 r3lgar 2015-12-03 00:36:49 UTC
(In reply to Gilles Dartiguelongue from comment #9)

>getent passwd portage
portage:x:250:250:portage:/var/tmp/portage:/bin/false
Comment 11 Gilles Dartiguelongue (RETIRED) gentoo-dev 2015-12-22 08:09:35 UTC
I tried reproducing this problem using sudo su - or su - to get root access but without success. I don't see what's causing this.
Comment 12 Andreas K. Hüttel archtester gentoo-dev 2015-12-26 22:31:34 UTC
In both cases this is caused by the g-ir-scanner... :/ does that have global configuration files where things might go wrong?

[ 97%] [34m[1mGenerating Poppler-0.18.gir[0m
[ 98%] [34m[1mGenerating Poppler-0.18.gir[0m
cd /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib && /usr/bin/g-ir-scanner "--add-include-path=/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib --warn-all" --namespace=Poppler --nsversion=0.18 --no-libtool --library=poppler-glib --include=GObject-2.0 --include=Gio-2.0 --include=cairo-1.0 --pkg-export=poppler-glib --c-include poppler.h -I/usr/include -I/usr/include -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0 -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/fofi -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/goo -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/poppler -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/poppler -I/usr/include/freetype2 -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include/openjpeg-2.1 -I/usr/include -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/cairo /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-action.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-date.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-document.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-page.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-attachment.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-form-field.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-annot.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-layer.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-movie.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-media.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-cached-file-loader.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-input-stream.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-structure-element.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-action.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-date.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-document.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-page.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-attachment.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-form-field.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-annot.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-layer.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-movie.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-media.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-structure-element.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib/poppler-enums.c /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib/poppler-enums.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib/poppler-features.h --output /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib/Poppler-0.18.gir
cd /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib && /usr/bin/g-ir-scanner "--add-include-path=/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib --warn-all" --namespace=Poppler --nsversion=0.18 --no-libtool --library=poppler-glib --include=GObject-2.0 --include=Gio-2.0 --include=cairo-1.0 --pkg-export=poppler-glib --c-include poppler.h -I/usr/include -I/usr/include -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0 -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/fofi -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/goo -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/poppler -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/poppler -I/usr/include/freetype2 -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include/openjpeg-2.1 -I/usr/include -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib -I/var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/cairo /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-action.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-date.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-document.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-page.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-attachment.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-form-field.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-annot.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-layer.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-movie.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-media.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-cached-file-loader.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-input-stream.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-structure-element.cc /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-action.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-date.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-document.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-page.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-attachment.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-form-field.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-annot.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-layer.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-movie.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-media.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0/glib/poppler-structure-element.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib/poppler-enums.c /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib/poppler-enums.h /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib/poppler-features.h --output /var/tmp/portage/app-text/poppler-0.38.0/work/poppler-0.38.0_build/glib/Poppler-0.18.gir
 * ACCESS DENIED:  mkdir:        /root/.cache
 * ACCESS DENIED:  mkdir:        /root/.cache
Comment 13 Gilles Dartiguelongue (RETIRED) gentoo-dev 2015-12-27 09:45:57 UTC
Afaik, there is no configuration for g-ir-scanner. Could you dump the ebuild environment and attach it ?
Comment 14 Yury Zhuravlev 2015-12-27 20:03:45 UTC
I have a similar error.
Comment 15 Alex Xu (Hello71) 2016-01-13 01:17:09 UTC
I am assigning this to gnome as maintainer of gobject-introspection because I believe that to be the source of the issue.

If you require more specific information from the reporter(s), then please specify exactly what from where. (which ebuild, where to find "environment", etc)
Comment 16 Gilles Dartiguelongue (RETIRED) gentoo-dev 2016-01-13 08:16:25 UTC
All instruction are provided by portage when the build stops. Example of failing libgdiplus on my box:

 ^[[31;01m*^[[0m ERROR: dev-dotnet/libgdiplus-3.12::gentoo failed (compile phase):
 ^[[31;01m*^[[0m   emake failed
 ^[[31;01m*^[[0m
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=dev-dotnet/libgdiplus-3.12::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=dev-dotnet/libgdiplus-3.12::gentoo'`.
 ^[[31;01m*^[[0m The complete build log is located at '/var/tmp/portage/portage/dev-dotnet/libgdiplus-3.12/temp/build.log'.
 ^[[31;01m*^[[0m The ebuild environment file is located at '/var/tmp/portage/portage/dev-dotnet/libgdiplus-3.12/temp/environment'.
 ^[[31;01m*^[[0m Working directory: '/var/tmp/portage/portage/dev-dotnet/libgdiplus-3.12/work/libgdiplus-3.12'
 ^[[31;01m*^[[0m S: '/var/tmp/portage/portage/dev-dotnet/libgdiplus-3.12/work/libgdiplus-3.12'
Comment 17 r3lgar 2016-01-15 06:05:59 UTC
(In reply to Gilles Dartiguelongue from comment #16)
What do you mean?

harfbuzz failing with this:

 * 
 * The following package has failed to build, install, or execute postinst:
 * 
 *  (media-libs/harfbuzz-1.1.3:0/0.9.18::gentoo, ebuild scheduled for merge), Log file:
 *   '/var/log/portage/pkg/build/media-libs/harfbuzz-1.1.3:20160115-065842.log'
 *
Comment 18 Dmytro 2016-01-26 06:52:23 UTC
I had the same error

unset XDG_CACHE_HOME

fixed the problem. I think this is somehow related:

https://bugs.gentoo.org/show_bug.cgi?id=444568
Comment 19 Pacho Ramos gentoo-dev 2016-01-26 19:43:55 UTC
Then, until this is covered at EAPI level it will be a problem to track all potential packages that could break with this :S (another reason for fixing bug 499288 some decade... but I am too pessimistic on that)
Comment 20 r3lgar 2016-01-31 16:07:38 UTC
(In reply to Pacho Ramos from comment #19)

>track all potential packages that could break with this

Some of them:

media-libs/gexiv2-0.10.3
media-libs/gstreamer-1.6.2 
x11-libs/gdk-pixbuf-2.32.3
x11-libs/libnotify-0.7.6-r1
media-libs/harfbuzz-1.1.3
gnome-base/librsvg-2.40.13
media-libs/gegl-0.3.4

Potentially all that binds to GObject Introspection. I think so.
Comment 21 Pacho Ramos gentoo-dev 2016-02-16 09:39:09 UTC
*** Bug 574772 has been marked as a duplicate of this bug. ***
Comment 22 Pacho Ramos gentoo-dev 2016-02-16 09:45:12 UTC
This looks to be caused by people running emerge with a "polluted" XDG_CACHE_HOME var (per duplicate bug it could be caused, for example, when people becomes root using "su" without the - and, then, getting the var set to their old home.

I cannot run test now, but it seems that this could be reproduce if we set XDG_CACHE_HOME to a wrong value on purpose to detect what packages need to inherit xdg.eclass for cleaning their environments. If that is the case, I would try to ask Toralf to run a tinderbox with that for helping us to fix that packages and make them inherit the eclass. I also wonder if PMS team would finally accept to, at least, introduce the concrete vars that are being cleaned in xdg.eclass for eapi7 for, at least, cover them in the future :|
Comment 23 Nick Bowler 2016-02-23 15:28:55 UTC
(In reply to Pacho Ramos from comment #22)
> This looks to be caused by people running emerge with a "polluted"
> XDG_CACHE_HOME var (per duplicate bug it could be caused, for example,
> when people becomes root using "su" without the - and, then, getting
> the var set to their old home.

XDG_CACHE_HOME is explicitly intended to be set by the user, and this
issue occurs if it is set to anything at all, not just a "polluted" or
"wrong" value inherited from the user env.

I see that gobject-introspection-1.46.0 was just stabilized, so this
problem just got that much more widespread.  At least the following
recently stabilized packages all fail now:

  - harfbuzz
  - libosinfo
  - libvirt-glib

The problem does not occur with the previous stable version of
gobject-introspection (1.44.0).
Comment 24 Andreas K. Hüttel archtester gentoo-dev 2016-02-25 17:05:57 UTC
Looking at the code of xdg-utils.eclass, the easiest way to fix this should be

* inherit xdg-utils (has no phases)
* call xdg_environment_reset at the start of src_configure
Comment 25 Andreas K. Hüttel archtester gentoo-dev 2016-02-25 23:03:02 UTC
a6a5345 x11-libs/libnotify: Clean up XDG environment, bug 567192
e1652c1 x11-libs/gdk-pixbuf: Clean up XDG environment, bug 567192
a8bd058 media-libs/gstreamer: Clean up XDG environment, bug 567192
08e2306 media-libs/gexiv2: Clean up XDG environment, bug 567192
be703cb app-emulation/libvirt-glib: Clean up XDG environment, bug 567192
8d4f779 sys-libs/libosinfo: Clean up XDG environment, bug 567192
1ce49ec app-text/poppler: Clean up XDG environment, bug 567192
7e3be4b media-libs/harfbuzz: Clean up XDG environment, bug 567192

... always fixed in newest ~arch or in newly created ~arch revbump (plus live ebuild if it exists).

Yes I know we need this in stable too, but let's wait first whether anything explodes.
Comment 26 Pacho Ramos gentoo-dev 2016-02-26 09:29:09 UTC
(In reply to Andreas K. Hüttel from comment #25)

I do not understand how packages using gnome2.eclass (like gdk-pixbuf) were failing. They are already cleaning the enbvironment as gnome2.eclass does it using xdg.eclass :/

Was the breakage on that concrete packages really tested or was only following the advise of people talking about potential broken packages?

I also wonder about revbumping for this build time change :|
Comment 27 Pacho Ramos gentoo-dev 2016-02-26 09:36:20 UTC
(In reply to Nick Bowler from comment #23)
> XDG_CACHE_HOME is explicitly intended to be set by the user, and this
> issue occurs if it is set to anything at all, not just a "polluted" or
> "wrong" value inherited from the user env.

If you keep intentionally changing the defaults of XDG_ (and not only XDG_) vars to random values you will get many random problems. That is the reason for trying to become root with su - instead of simply root because, as soon as package managers keep preserving most of the environment variables, build of multiple packages are prone to randomly fail as soon as they start to honor that variables that are set to uncontrolled values (that is a bit more developed in bug 499288)
Comment 28 Andreas K. Hüttel archtester gentoo-dev 2016-02-26 13:41:18 UTC
(In reply to Pacho Ramos from comment #26)
> (In reply to Andreas K. Hüttel from comment #25)
> 
> I do not understand how packages using gnome2.eclass (like gdk-pixbuf) were
> failing. They are already cleaning the enbvironment as gnome2.eclass does it
> using xdg.eclass :/

hmm interesting :/ feel free to revert

> I also wonder about revbumping for this build time change :|

well, I didnt want to change stable ebuilds in-place where I wasnt familiar with them. we can always just forward-port stable keywords from -r0 to -r1 once we know the change doesnt hurt.
Comment 29 Pacho Ramos gentoo-dev 2016-02-26 13:49:52 UTC
(In reply to Pacho Ramos from comment #27)
> for trying to become root with su - instead of simply root because

simply su I meant

(In reply to Andreas K. Hüttel from comment #28)
> hmm interesting :/ feel free to revert

Bleh, I do not have access to my dev machine now, but I will try when I am able to
Comment 30 Pacho Ramos gentoo-dev 2016-02-28 11:14:23 UTC
(In reply to Andreas K. Hüttel from comment #25)

[...]

All this commits reviewed finally

@Toralf, we would need to get an amd64 stable tinderbox run running emerge with something like:


XDG_CACHE_HOME=/home/pacho/tmp/ emerge -1 ...

Being the directory a folder in your real filesystem to see if it tries to write there. If that is the case, you will get a sandbox violation error and you will be able to make that bugs block this tracker. 

Thanks a lot
Comment 31 Toralf Förster gentoo-dev 2016-02-28 14:31:39 UTC
(In reply to Pacho Ramos from comment #30)
is /tmp a sufficient FS too or are the perms too weak there (rw for all) ?
Comment 32 Pacho Ramos gentoo-dev 2016-02-28 14:44:58 UTC
If I don't misremember, /tmp can be written and sandbox won't die
Comment 33 Gilles Dartiguelongue (RETIRED) gentoo-dev 2016-03-01 08:13:57 UTC
As a rule of thumb, always use xdg.eclass, xdg-utils is really for cases where maintainer does not want any phase changes. xdg.eclass is meant to cover XDG_* variables and all other xdg spec that would need to be taken care of, now or in the future (desktop and mime files for now). I will add that info somewhere in the eclasses.
Comment 34 Alex Xu (Hello71) 2016-03-06 17:04:37 UTC
*** Bug 576478 has been marked as a duplicate of this bug. ***
Comment 35 Ben Kohler gentoo-dev 2016-04-08 14:46:24 UTC
*** Bug 579346 has been marked as a duplicate of this bug. ***
Comment 36 Toralf Förster gentoo-dev 2019-04-23 19:54:01 UTC
as per IRC EAPI 7 solves this entirely:

[21:51] <willikins> toralf, you have notes! [Apr-22 05:39] <mgorny> please either stop those XDG* runs or limit them to EAPI 7. there's no purpose in having people hack around this (rare) stuff when EAPI bump will usually solve it