Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 287067 - app-text/calibre hangs in install phase: "Setting up desktop integration..."
Summary: app-text/calibre hangs in install phase: "Setting up desktop integration..."
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Zac Medico
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2009-09-30 12:25 UTC by Erik Hoppe
Modified: 2009-10-05 20:48 UTC (History)
0 users

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


Attachments
calibre-0.6.16 (debug) build log (build.log.bz2,6.41 KB, text/plain)
2009-10-02 21:39 UTC, Erik Hoppe
Details
emerge --info (emerge.info.bz2,2.22 KB, text/plain)
2009-10-02 21:40 UTC, Erik Hoppe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Hoppe 2009-09-30 12:25:10 UTC
Calibre won't finish build
Takes forever during install phase
"Setting up desktop integration..."

Reproducible: Always

Steps to Reproduce:
emerge calibre

Actual Results:  
Install progress stops (not crash or exit !) at
"Setting up desktop integration..."


cpc ~ # emerge --info
Portage 2.1.6.13 (default/linux/x86/2008.0, gcc-4.4.1, glibc-2.10.1-r0, 2.6.31-gentoo-r1-cpc i686)
=================================================================
System uname: Linux-2.6.31-gentoo-r1-cpc-i686-Intel-R-_Atom-TM-_CPU_330_@_1.60GHz-with-gentoo-2.0.1
Timestamp of tree: Wed, 30 Sep 2009 08:30:01 +0000
app-shells/bash:     4.0_p33
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.2-r2
dev-util/cmake:      2.6.4-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.1
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer -fno-ident -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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 /etc/udev/rules.d"
CXXFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer -fno-ident -pipe -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"
LANG="de_DE"
LC_ALL="de_DE.utf8"
LDFLAGS="-Wl,--as-needed"
LINGUAS="de"
MAKEOPTS="-j6"
PKGDIR="/usr/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/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="7zip X a52 aac acl acpi alsa berkdb bluetooth boost bzip2 cairo cleartype cli consolekit cracklib crypt cups curl dbus djvu dri exif expat fam ffmpeg fftw flac fontconfig gcj gif glib gnutls hal hunspell iconv imagemagick inotify isdnlog java6 jpeg jpeg2k kde kdehiddenvisibility lame lcms libffi lm_sensors lua lzma lzo mad minimal mmap mmx mmxext mng modules mp3 mtp musepack nptl nptlonly ogg openal opencore-amr opengl openmp pam pcre pdf png pppd qt3support readline reflection rle rtc samba sdl sensord session slang smp sndfile speex spell spl sqlite sse sse2 ssl ssse3 svg sysfs threads tiff truetype unicode usb v4l2 vdpau vorbis webkit wmf x264 x86 xattr xcb xcomposite xml xorg xulrunner xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 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" CAMERAS="ptp2 digigr8 directory" DVB_CARDS="usb-dtt200u" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" QEMU_SOFTMMU_TARGETS="mips i386 x86_64" QEMU_USER_TARGETS="mips i386 x86_64" SANE_BACKENDS="pixma" USERLAND="GNU" VIDEO_CARDS="nv nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Zac Medico gentoo-dev 2009-10-01 19:57:50 UTC
It calls a bunch of scripts from x11-misc/xdg-utils there. What version of x11-misc/xdg-utils do you have? It worked for me with xdg-utils-1.0.2-r3. Can you reproduce the hang and use `pstree` or similar to find out which one of the xdg-* programs is hung?
Comment 2 Erik Hoppe 2009-10-02 11:40:41 UTC
I use version 1.0.2-r3 too.

cpc ~ # emerge -Cp x11-misc/xdg-utils

>>> These are the packages that would be unmerged:

 x11-misc/xdg-utils
    selected: 1.0.2-r3
   protected: none
     omitted: none

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

It hangs at

...
Installing lrfviewer script to /var/tmp/portage/app-text/calibre-0.6.11/image/usr/bin
Installing calibre script to /var/tmp/portage/app-text/calibre-0.6.11/image/usr/bin
Setting up desktop integration...

process is :
/usr/bin/python2.6 /var/tmp/portage/app-text/calibre-0.6.11/work/calibre-0.6.11/src/calibre/linux.py --use-destdir --do-not-reload-udev-hal --group-file=//etc/group --dont-check-root

Comment 3 Erik Hoppe 2009-10-02 12:01:42 UTC
Maybe this is deprecated,
i see that you released a new ebuild.
It compiles well but crashes at install phase

...
i686-pc-linux-gnu-g++ /var/tmp/portage/app-text/calibre-0.6.14-r1/work/calibre/build/pyqt/pictureflow/qt/moc_pictureflow.o /var/tmp/portage/app-text/calibre-0.6.14-r1/work/calibre/build/pyqt/pictureflow/qt/pictureflow.o -Wl,--as-needed -shared -Wl,-rpath,/usr/lib/qt4 -Wl,--version-script=pictureflow.exp -o pictureflow.so sippictureflowcmodule.o sippictureflowPictureFlow.o sippictureflowFlowImages.o -L/usr/lib/qt4 -L/usr/X11R6/lib -lQtCore -L/usr/lib/qt4 -L/usr/lib/qt4 -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -lpthread -ldl -lQtGui -L/usr/lib/qt4 -L/usr/X11R6/lib -L/usr/lib/qt4 -pthread -lpng -lfreetype -lgobject-2.0 -lSM -lICE -lQtCore -lz -pthread -lgthread-2.0 -lrt -lglib-2.0 -lpthread -lXrender -lXrandr -lfontconfig -lXext -lX11 -lm -ldl -lXext -lX11 -lm -lpthread
>>> Source compiled.
>>> Test phase [not enabled]: app-text/calibre-0.6.14-r1

>>> Install calibre-0.6.14-r1 into /var/tmp/portage/app-text/calibre-0.6.14-r1/image/ category app-text
python setup.py install --root=/var/tmp/portage/app-text/calibre-0.6.14-r1/image/ --no-compile --bindir=/var/tmp/portage/app-text/calibre-0.6.14-r1/image/usr/bin --sharedir=/var/tmp/portage/app-text/calibre-0.6.14-r1/image/usr/share
/usr/lib/python2.6/site-packages/Pyrex/Compiler/Errors.py:17: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  self.message = message
Dropping privileges to those of erik: 1000
Traceback (most recent call last):
  File "setup.py", line 99, in <module>
    sys.exit(main())
  File "setup.py", line 85, in main
    command.run_all(opts)
  File "/var/tmp/portage/app-text/calibre-0.6.14-r1/work/calibre/setup/__init__.py", line 158, in run_all

  File "/var/tmp/portage/app-text/calibre-0.6.14-r1/work/calibre/setup/__init__.py", line 149, in run_cmd

  File "/var/tmp/portage/app-text/calibre-0.6.14-r1/work/calibre/setup/install.py", line 127, in pre_sub_commands
ImportError: No module named calibre.utils.config
 *
 * ERROR: app-text/calibre-0.6.14-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_install
 *             environment, line 3029:  Called distutils_src_install '--bindir=/var/tmp/portage/app-text/calibre-0.6.14-r1/image/usr/bin' '--sharedir=/var/tmp/portage/app-text/calibre-0.6.14-r1/image/usr/share'
 *             environment, line  769:  Called die
 * The specific snippet of code:
 *           ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed";
 *  The die message:
 *   Installation failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/app-text/calibre-0.6.14-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-text/calibre-0.6.14-r1/temp/environment'.
 *

>>> Failed to emerge app-text/calibre-0.6.14-r1, Log file:

Some python (V 2.6.2-r2) related stuff is going wrong on my system.
I will do a revdep-rebuild dev-lang/python.
Comment 4 Zac Medico gentoo-dev 2009-10-02 18:50:52 UTC
(In reply to comment #3)
>   File
> "/var/tmp/portage/app-text/calibre-0.6.14-r1/work/calibre/setup/install.py",
> line 127, in pre_sub_commands
> ImportError: No module named calibre.utils.config

This is strange because the ebuild sets PYTHONPATH right there order to avoid this type of error. Can you add --debug to your emerge options, try again, and post the output?
Comment 5 Erik Hoppe 2009-10-02 21:39:12 UTC
Created attachment 205879 [details]
calibre-0.6.16 (debug) build log
Comment 6 Erik Hoppe 2009-10-02 21:40:28 UTC
Created attachment 205880 [details]
emerge --info
Comment 7 Erik Hoppe 2009-10-02 21:40:53 UTC
I updated python, problem still the same
Comment 8 Zac Medico gentoo-dev 2009-10-02 21:57:41 UTC
(In reply to comment #5)
> Created an attachment (id=205879) [edit]
> calibre-0.6.16 (debug) build log

The log shows PYTHONPATH=/var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src is set as it's supposed to. Can you check if /var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src/calibre/utils/config.py exists as it's supposed to?
Comment 9 Erik Hoppe 2009-10-03 01:13:42 UTC
config.py is in place.

cpc ~ # file /var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src/calibre/utils/config.py
/var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src/calibre/utils/config.py: ASCII Java program text
Comment 10 Zac Medico gentoo-dev 2009-10-03 01:44:35 UTC
Please test this command to see if it produces the same ImportError:

env PYTHONPATH=/var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src \
python -c "import calibre.utils.config as c"
Comment 11 Zac Medico gentoo-dev 2009-10-03 01:47:10 UTC
Also, which version of dev-python/setuptools do you have? I have setuptools-0.6.1-r1 here.
Comment 12 Erik Hoppe 2009-10-03 12:35:29 UTC
thanks for the help so far, here is the output :
cpc ~ # env PYTHONPATH=/var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src python -c "import calibre.utils.config as c"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src/calibre/__init__.py", line 16, in <module>
    from calibre.startup import plugins, winutil, winutilerror
  File "/var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src/calibre/startup.py", line 19, in <module>
    from calibre.constants import iswindows, preferred_encoding, plugins
  File "/var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src/calibre/constants.py", line 70, in <module>
    plugins = load_plugins()
  File "/var/tmp/portage/app-text/calibre-0.6.16/work/calibre/src/calibre/constants.py", line 54, in load_plugins
    plugin_path = sys.extensions_location
AttributeError: 'module' object has no attribute 'extensions_location'

cpc ~ # emerge -pv setuptools

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

Calculating dependencies... done!
[ebuild   R   ] dev-python/setuptools-0.6.3-r3  0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
Comment 13 Vadim Dyadkin 2009-10-04 17:24:40 UTC
The same thing, install phase dies with this message (I used setuptools-0.6.1-r3 and 0.6-r1):

calibre successfully installed. You can start it by running the command calibre
>>> Completed installing calibre-0.6.16-r1 into /var/tmp/portage/app-text/calibre-0.6.16-r1/image/

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-302.log"                                     

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status  
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path               
FORMAT: C - Command Line                 

F: open_wr
S: deny   
P: /usr/qt/3/etc/settings/.qtrc.lock
A: /usr/qt/3/etc/settings/.qtrc.lock
R: /usr/qt/3/etc/settings/.qtrc.lock
C: kbuildsycoca                     

F: unlink
S: deny  
P: /root/.kde/tmp-3lp
A: /root/.kde/tmp-3lp
R: /root/.kde/tmp-3lp
C: /usr/kde/3.5/bin/lnusertemp tmp 

F: symlink
S: deny   
P: /root/.kde/tmp-3lp
A: /root/.kde/tmp-3lp
R: /root/.kde/tmp-3lp
C: /usr/kde/3.5/bin/lnusertemp tmp 

F: unlink
S: deny  
P: /root/.kde/tmp-3lp
A: /root/.kde/tmp-3lp
R: /root/.kde/tmp-3lp
C: /usr/kde/3.5/bin/lnusertemp tmp 

F: symlink
S: deny   
P: /root/.kde/tmp-3lp
A: /root/.kde/tmp-3lp
R: /root/.kde/tmp-3lp
C: /usr/kde/3.5/bin/lnusertemp tmp 

F: unlink
S: deny  
P: /root/.kde/socket-3lp
A: /root/.kde/socket-3lp
R: /root/.kde/socket-3lp
C: /usr/kde/3.5/bin/lnusertemp socket 

F: symlink
S: deny   
P: /root/.kde/socket-3lp
A: /root/.kde/socket-3lp
R: /root/.kde/socket-3lp
C: /usr/kde/3.5/bin/lnusertemp socket 

F: unlink
S: deny  
P: /root/.kde/socket-3lp
A: /root/.kde/socket-3lp
R: /root/.kde/socket-3lp
C: /usr/kde/3.5/bin/lnusertemp socket 

F: symlink
S: deny   
P: /root/.kde/socket-3lp
A: /root/.kde/socket-3lp
R: /root/.kde/socket-3lp
C: /usr/kde/3.5/bin/lnusertemp socket 

F: open_wr
S: deny   
P: /usr/qt/3/etc/settings/.qtrc.lock
A: /usr/qt/3/etc/settings/.qtrc.lock
R: /usr/qt/3/etc/settings/.qtrc.lock
C: dcopserver --nosid --suicide     

F: open_wr
S: deny   
P: /usr/qt/3/etc/settings/.qtrc.lock
A: /usr/qt/3/etc/settings/.qtrc.lock
R: /usr/qt/3/etc/settings/.qtrc.lock
C: klauncher [kdeinit] --new-startup

F: open_wr
S: deny
P: /usr/qt/3/etc/settings/.qtrc.lock
A: /usr/qt/3/etc/settings/.qtrc.lock
R: /usr/qt/3/etc/settings/.qtrc.lock
C: kded --new-startup

F: open_wr
S: deny
P: /usr/qt/3/etc/settings/.qt_plugins_3.3rc.lock
A: /usr/qt/3/etc/settings/.qt_plugins_3.3rc.lock
R: /usr/qt/3/etc/settings/.qt_plugins_3.3rc.lock
C: kded --new-startup

F: open_wr
S: deny
P: /usr/qt/3/etc/settings/.kstylerc.lock
A: /usr/qt/3/etc/settings/.kstylerc.lock
R: /usr/qt/3/etc/settings/.kstylerc.lock
C: kded --new-startup

F: open_wr
S: deny
P: /usr/qt/3/etc/settings/.qtrc.lock
A: /usr/qt/3/etc/settings/.qtrc.lock
R: /usr/qt/3/etc/settings/.qtrc.lock
C: kded --new-startup

F: open_wr
S: deny
P: /usr/qt/3/etc/settings/.qtrc.lock
A: /usr/qt/3/etc/settings/.qtrc.lock
R: /usr/qt/3/etc/settings/.qtrc.lock
C: kbuildsycoca --incremental --checkstamps
--------------------------------------------------------------------------------

>>> Failed to emerge app-text/calibre-0.6.16-r1, Log file:

>>>  '/var/tmp/portage/app-text/calibre-0.6.16-r1/temp/build.log'
Comment 14 Zac Medico gentoo-dev 2009-10-04 19:57:13 UTC
(In reply to comment #13)
> --------------------------- ACCESS VIOLATION SUMMARY

This sandbox violation is a different problem, so please file a new bug.
Comment 15 Zac Medico gentoo-dev 2009-10-04 20:16:57 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > --------------------------- ACCESS VIOLATION SUMMARY
> 
> This sandbox violation is a different problem, so please file a new bug.
> 

I think that the sandbox violation will go away if we unset the DISPLAY environment variable. Please test:

  env -u DISPLAY emerge calibre
Comment 16 Vadim Dyadkin 2009-10-05 04:38:37 UTC
Yes! This helps fine! Should I open a new bug with it?
Comment 17 Zac Medico gentoo-dev 2009-10-05 07:51:12 UTC
(In reply to comment #16)
> Yes! This helps fine! Should I open a new bug with it?

No thanks, it's fixed in cvs now. Thanks for reporting.
Comment 18 Zac Medico gentoo-dev 2009-10-05 08:35:39 UTC
(In reply to comment #12)
> Dropping privileges to those of erik: 1000
> Traceback (most recent call last):

I'm pretty sure the "Dropping privileges" thing is what's triggering the problem for you, so I've updated the ebuild to disable that. Please test and let me know if it's fixed.
Comment 19 Erik Hoppe 2009-10-05 09:17:02 UTC
>I'm pretty sure the "Dropping privileges" thing is what's triggering the
>problem for you, so I've updated the ebuild to disable that. Please test and
>let me know if it's fixed.

That does the trick, thanks a lot.
But i don't get it, how does he get my username while running in a sandbox ?
Comment 20 Zac Medico gentoo-dev 2009-10-05 10:19:21 UTC
It uses SUDO_* environment variables.
Comment 21 Erik Hoppe 2009-10-05 20:48:45 UTC
>It uses SUDO_* environment variables.

Ok so it was just this, i commented out the privilege dropping patch
#sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
#       -i setup/install.py || die "sed'ing in the IMAGE path failed"
And installed it sucessfully, doing su instead of sudo to become root.