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

Bug 673872

Summary: qtchooser ignores prefix configuration
Product: Gentoo/Alt Reporter: Burak Arslan <burak.arslan>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Burak Arslan 2018-12-28 08:36:01 UTC
QtChooser keeps using the Qt installation from the host because it's looking for configuration files in /etc/xdg/qtchooser instead of $EPREFIX/etc/xdg/qtchooser

This results in qt packages (besides dev-qt/qtcore) to be built with the wrong Qt version.

This is generally undesirable as results in everything from random segfaults to both static and dynamic linking errors due to ABI mismatch, depending on the version of Qt installed in the host system.

Reproducible: Always

Steps to Reproduce:
1. Run ./bootstrap-prefix.conf $PWD/prefix noninteractive
2. Run ./prefix/usr/bin/emerge layman
3. Run ./prefix/usr/bin/layman -c ./prefix/etc/layman/layman.cfg -f -a qt
4. Run ./prefix/usr/bin/emerge qtcore
5. Run ./prefix/usr/bin/emerge qtgui

This is supposed to install qtcore-5.12 and depending on the qt version installed on the host, step 5 may or may not fail. In my experience, with a host that had 5.11, emerge operations succeed but I see random errors. With a host that had 5.9, step 5 fails.

Actual Results:  
qmake -v print the version from host Qt installation.

Expected Results:  
qmake -v should print the version of the Qt installation in the prefix.

Running

    echo XDG_CONFIG_DIRS=$PWD/prefix/etc/xdg > ./prefix/etc/env.d/99prefix 

solves the problem. This should be taken care of by the bootstrap script.
Comment 1 Burak Arslan 2018-12-28 08:53:41 UTC
The following also seems to be required:

    echo export XDG_CONFIG_DIRS=$PWD/prefix/etc/xdg > ./prefix/etc/profile.d/qt5.sh
Comment 2 Burak Arslan 2018-12-28 09:07:56 UTC
Caveat: Looking at the QtChooser source, I see that $XDG_CONFIG_HOME/.config (or $HOME/.config if $XDG_CONFIG_HOME is empty) is consulted before $XDG_CONFIG_DIRS. It could be *possible* for the config from the prefix user's homedir to interfere with the config from the prefix.
Comment 3 Burak Arslan 2018-12-28 09:09:21 UTC
It'd also be nice to have the prefix'd qtchooser -l output be different from the non-prefix'd qtchooser -l output. Assuming that the host and prefix Qt versions are the same, the only way to be sure that the qtchooser points to the correct Qt is to inspect the strace qtchooser -l output.

Host config:

$ ls -l /etc/xdg/qtchooser/
total 4
lrwxrwxrwx 1 root root 28 Nov 16 10:31 5.conf -> qt5-x86_64-pc-linux-gnu.conf
lrwxrwxrwx 1 root root  8 Nov 16 10:31 default.conf -> qt5.conf
-rw-r--r-- 1 root root 30 Nov 16 10:31 qt5-x86_64-pc-linux-gnu.conf
lrwxrwxrwx 1 root root 28 Nov 16 10:31 qt5.conf -> qt5-x86_64-pc-linux-gnu.conf

Whis results in the following output:

$ qtchooser -l
5
default
qt5-x86_64-pc-linux-gnu
qt5

Renaming the files here could be nice for the prefix user.
Comment 4 Benda Xu gentoo-dev 2019-01-27 10:56:00 UTC

*** This bug has been marked as a duplicate of bug 589314 ***
Comment 5 Benda Xu gentoo-dev 2019-01-27 10:59:19 UTC
Thanks Burak for your report.  We have started to deal with this issue in 2016 but the progress is stalled.  You are invited to voice your opinion on the bug 589314.