Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 285687 - [FEATURES=test failure] x11-libs/gtk+-2.16.6: test failures (XDG variables management for building)
Summary: [FEATURES=test failure] x11-libs/gtk+-2.16.6: test failures (XDG variables ma...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords:
: 353506 356209 (view as bug list)
Depends on:
Blocks: gnome-tests
  Show dependency tree
 
Reported: 2009-09-20 13:00 UTC by Alexis Ballier
Modified: 2011-02-23 16:26 UTC (History)
2 users (show)

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


Attachments
build.log (gtk+-2.22.1:20101119-223017.log,1.44 MB, text/plain)
2010-11-19 22:50 UTC, Pacho Ramos
Details
build.log (gtk+-2.22.1-r1:20110114-122704.log,1.38 MB, text/plain)
2011-01-14 12:47 UTC, Pacho Ramos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Ballier gentoo-dev 2009-09-20 13:00:37 UTC
My home is 700, I have XDG_CONFIG_HOME set to my home which is kept by suing to build gtk.

$ echo $XDG_CONFIG_HOME
/home/alexis/.config

It's set by /usr/bin/startlxde it seems.


I'm not familiar enough with XDG_* stuff but this probably affects other packages.

TEST: object... (pid=16998)
Xlib:  extension "RANDR" missing on display ":101.0".
  /properties/GtkAboutDialog:                                          OK
  /properties/GtkAccelLabel:                                           OK
  /properties/GtkAlignment:                                            OK
  /properties/GtkArrow:                                                OK
  /properties/GtkAspectFrame:                                          OK
  /properties/GtkAssistant:                                            OK
  /properties/GtkButton:                                               OK
  /properties/GtkCalendar:                                             OK
  /properties/GtkCellView:                                             OK
  /properties/GtkCheckButton:                                          OK
  /properties/GtkCheckMenuItem:                                        OK
  /properties/GtkColorButton:                                          OK
  /properties/GtkColorSelectionDialog:                                 OK
  /properties/GtkColorSelection:                                       OK
  /properties/GtkComboBoxEntry:                                        OK
  /properties/GtkComboBox:                                             OK
  /properties/GtkCurve:                                                OK
  /properties/GtkDialog:                                               OK
  /properties/GtkDrawingArea:                                          OK
  /properties/GtkEntry:                                                OK
  /properties/GtkEventBox:                                             OK
  /properties/GtkExpander:                                             OK
  /properties/GtkFileChooserButton:                                    
Gtk-WARNING **: Failed to read filechooser settings from "/home/alexis/.config/gtk-2.0/gtkfilechooser.ini": Permission denied
aborting...
FAIL
GTester: last random seed: R02S2f9d3ec719be90fe04346aa5168238f9
Terminated
make[5]: *** [test] Error 143
make[5]: Leaving directory `/var/tmp/portage/x11-libs/gtk+-2.16.6/work/gtk+-2.16.6/gtk/tests'
make[4]: *** [test] Error 2
make[4]: Leaving directory `/var/tmp/portage/x11-libs/gtk+-2.16.6/work/gtk+-2.16.6/gtk'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/var/tmp/portage/x11-libs/gtk+-2.16.6/work/gtk+-2.16.6/gtk'
Comment 1 Mart Raudsepp gentoo-dev 2009-09-20 21:57:43 UTC
So the story here is that startlxde is setting and exporting XDG_CONFIG_HOME for him, and that's why most of us haven't seen this.
It sets it to the default of $HOME/.config if previously unset, to later use the variable once in figuring out some paths - it could instead use ${XDG_CONFIG_HOME:-$HOME/.config} or some such in that place. Anyhow, users are allowed to change their config directory per the spec, and FEATURES="userpriv test" portage installs shouldn't be affected by that.
With all that it would actually still work, but alexis has his $HOME permission 700, so the user for FEATURES=userpriv gets an unexpected permission denied error probably. That said, ebuilds still have no business reading stuff from regular user dirs.

Some eclasses already deal with this kind of situation, namely kde and qt ones, but differently from eachother. grep eclass/* for XDG to see them.

So the point is that we need to fully figure out what XDG vars we need to unset or set to something, and then apply it all around, gnome2.eclass, gtk+ (it doesn't inherit gnome2), and more. Pretty much all fdo related stuff, might actually be worth looking into getting this more into the core of things, like to ebuild.sh of portage in an EAPI.

Hence this bug to track these thoughts. Independently of discussing about that, we can temporarily apply a temporary fix for gtk+, as that actually exhibits test failures in some situations, while the global fixing is preventative and slight privacy matter instead.
Comment 2 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-09-21 06:34:23 UTC
imho this only needs work in fdo kind of eclass, exporting a function that would set the environment for the portage user in the same way that is described on the upstream webpage to load all these XDG_* vars in a shell. Then kde/qt should be fixed to use that as well.
Comment 3 Gilles Dartiguelongue (RETIRED) gentoo-dev 2010-11-15 22:59:29 UTC
+  15 Nov 2010; Gilles Dartiguelongue <eva@gentoo.org> -gtk+-2.18.7.ebuild,
+  gtk+-2.20.1-r1.ebuild, gtk+-2.22.0.ebuild:
+  Set HOME for tests and re-enable recently-used tests, bug #285687. Do not
+  show evince elog message if it is installed, bug #236547.
+
Should be fixed now. Thanks for reporting.
Comment 4 Pacho Ramos gentoo-dev 2010-11-19 22:50:06 UTC
Sadly, it's still valid :-(
Comment 5 Pacho Ramos gentoo-dev 2010-11-19 22:50:47 UTC
Created attachment 254871 [details]
build.log
Comment 6 Pacho Ramos gentoo-dev 2010-12-23 14:05:07 UTC
Have tried to set XDG_DATA_HOME="${T}" without success, not sure how to solve this :-/
Comment 7 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-01-12 16:37:33 UTC
Updated src_test in 2.22.1-r1, please test when you get the occasion.
Comment 8 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-01-12 16:39:25 UTC
erm silly me, I might have set the wrong variable according to comment #0 should give a shot at XDG_CONFIG_HOME.
Comment 9 Pacho Ramos gentoo-dev 2011-01-14 12:47:59 UTC
Created attachment 259803 [details]
build.log

It sill fails with XDG_DATA_ or XDG_CONFIG_, maybe I could report this to upstream to know why that variables are not honored, or, doesn't this test fail when run manually and not allowed to write in /root/?
Comment 10 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-01-14 14:34:33 UTC
I'd rather have a check at the code path. That's where I got the variables from in the beginning, it is strange that you are still having this problem, maybe I missed something but since I cannot reproduce I'd really like it if you could analyze a bit further.
Comment 11 Pacho Ramos gentoo-dev 2011-01-19 19:47:45 UTC
(In reply to comment #10)
> I'd rather have a check at the code path. That's where I got the variables from
> in the beginning, it is strange that you are still having this problem, maybe I
> missed something but since I cannot reproduce I'd really like it if you could
> analyze a bit further.
> 

I have tried to edit gtk/tests/recentmanager script adding a lot of "echo $HOME" statements to try to know if that variable is lose but looks like it's preserved :-( 

Do you have any idea? I am lost here. I have emerged gtk+ with the following steps:
1. Login in my gnome session.
2. Open a terminal and become root using "su -"
3. Run emerge -O1 gtk+

But I think it also failed when running from console.

I have also tried to compile and run tests manually inside "sandbox" and they fail the same way trying to write at my home, then, it looks to be reading home variable from somewhere but I don't know from where :-(


My emerge --info:

Portage 2.1.9.31 (default/linux/amd64/10.0/desktop/gnome, gcc-4.4.4, glibc-2.11.2-r3, 2.6.37-ck x86_64)
=================================================================
System uname: Linux-2.6.37-ck-x86_64-AMD_Athlon-tm-_64_Processor_3200+-with-gentoo-1.12.14
Timestamp of tree: Mon, 17 Jan 2011 12:00:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/ccache:     2.4-r9
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="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 /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/distfiles"
FEATURES="assume-digests binpkg-logs ccache distlocks fixlafiles fixpackages multilib-strict news parallel-fetch protect-owned sandbox sfperms sign split-log strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org 		http://ftp.ussg.iu.edu/linux/gentoo 		http://mirror.ovh.net/gentoo-distfiles/ 		http://ftp.heanet.ie/pub/gentoo/ 		http://gentoo-euetib.upc.es/mirror/gentoo/ 		http://ftp.udc.es/gentoo/ 		http://darkstar.ist.utl.pt/gentoo/"
LANG="es_ES.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="es es_ES en_US"
MAKEOPTS="-j2"
PKGDIR="/usr/local/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 applet avahi bash-completion berkdb branding bzip2 cairo cdda cddb cdinstall cdr cdrom cleartype cli consolekit cracklib crypt css cups cxx daap dbus djvu dri dts dvd dvdr dvi eds emboss encode evo exif fam fat ffmpeg firefox flac fortran fuse gdbm gdu gif git gnome gnome-keyring gpm gstreamer gtk hddtemp iconv java jpeg kpathsea latex lcdfilter lcms libnotify lm_sensors lyx lzma mad mikmod mmx mmxext mng modules mono mp3 mp4 mpeg mudflap multilib musicbrainz nautilus ncurses network network-cron nls nptl nptlonly ntfs nvidia ogg opengl openmp pam pango pch pcre pdf perl png policykit ppds pppd python qt3support qt4 readline reiserfs scanner sdl session spell sse sse2 sse3 ssl startup-notification subversion svg sysfs t1lib tcpd test threads tiff truetype udev unicode usb v4l2 vcd vorbis webkit x264 xattr xcb xml xmp xorg xpm xulrunner xv xvid zeroconf zlib" ALSA_CARDS="via82xx" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" 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 ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="es es_ES en_US" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa" 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" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 12 Pacho Ramos gentoo-dev 2011-02-02 11:00:43 UTC
*** Bug 353506 has been marked as a duplicate of this bug. ***
Comment 13 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-02-04 14:14:08 UTC
ok this is actually a lot trickier than what I thought. I changed my root homedir to /root/temp to make sure my root homedir would not get polluted by random packages and it is actually filling up quite a bit since I did this change without ever logging in as root.

Anyway, gtk+ actually uses glib to determine home through g_get_home_dir which is using multiple validations to get the real home of the user executing the program. It looks at an env variable but if it is in contradiction with the uid of the executing user, it falls back to using the home of the executing user.

This is also why sandbox fails to catch this, it has a ${HOME}/.recently-used* entry but here $HOME is different than the home determined by glib.

I think the only reasonable solution here is indeed to disable the check and we are going to need to do the same for pygtk.
Comment 14 Pacho Ramos gentoo-dev 2011-02-04 18:13:36 UTC
I reported some time ago this issue to upstream:
https://bugzilla.gnome.org/show_bug.cgi?id=639832
Comment 15 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-02-09 17:19:25 UTC
+*gtk+-2.24.0 (09 Feb 2011)
+
+  09 Feb 2011; Gilles Dartiguelongue <eva@gentoo.org> -gtk+-2.18.9.ebuild,
+  -gtk+-2.22.0.ebuild, -gtk+-2.22.1.ebuild, gtk+-2.22.1-r1.ebuild,
+  +gtk+-2.24.0.ebuild:
+  Clean up unused la files. Disable recentmanager tests, bug #285687. Drop
+  jpeg, jpeg2k and tiff use flags unneeded since the gdk-pixbuf split. Version
+  bump to 2.24. Drop old revisions.

Should be fixed in 2.22 and 2.24.
Thanks all for helping with this issue.
Comment 16 Pacho Ramos gentoo-dev 2011-02-09 18:36:57 UTC
Thanks a lot! Should a similar approach be applied to pygtk? (bug #245103)
Comment 17 Drake Wyrm 2011-02-14 00:07:32 UTC
Tests now pass. Many thanks.
Comment 18 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-02-23 16:26:17 UTC
*** Bug 356209 has been marked as a duplicate of this bug. ***