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

Bug 523012

Summary: (Qt5) no Qt5 package provides an env.d file with QT_PLUGIN_PATH
Product: Gentoo Linux Reporter: Karol Herbst <gentoo>
Component: [OLD] LibraryAssignee: Qt Bug Alias <qt>
Status: RESOLVED INVALID    
Severity: normal CC: kde
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Karol Herbst 2014-09-17 10:46:37 UTC
Some Qt5 application may produce a "could not find or load the Qt platform plugin “xcb”" error on start.

This issue came up (not on my machine) by running teamspeak installed through this ebuild: https://504604.bugs.gentoo.org/attachment.cgi?id=384928

currently QT_PLUGIN_PATH is only provided by kde-frameworks/kf-env-2 from the kde overlay, so teamspeak starts on a machine with Kf5 installed, but not without it.

Reproducible: Always

Steps to Reproduce:
1. unmask needed qt5 ebuilds needed by the mentioned ebuild
2. install media-sound/teamspeak-client-bin-3.0.16
3. try to start it
Actual Results:  
application fails to start with a "could not find or load the Qt platform plugin “xcb”" error

Expected Results:  
application does start.
Comment 1 Davide Pesavento (RETIRED) gentoo-dev 2014-09-17 13:44:01 UTC
An env.d file shouldn't be needed at all, so something else must be wrong.

Did you alter your qt.conf?

What are the contents of the env.d file installed by kde?

What's the output of `strings /usr/lib64/libQt5Core.so | grep plugpath` ?


(In reply to Karol Herbst from comment #0)
> Some Qt5 application may produce a "could not find or load the Qt platform
> plugin “xcb”" error on start.

Only "some" applications? "may"? Do you mean that not all apps fail, and for those that fail the problem is not reproducible every time?
Comment 2 Karol Herbst 2014-09-17 15:41:15 UTC
(In reply to Davide Pesavento from comment #1)
> An env.d file shouldn't be needed at all, so something else must be wrong.
> 
> Did you alter your qt.conf?
> 

oh I forgot that. Now with removing the qt.conf file it does indeed work.

> What are the contents of the env.d file installed by kde?
> 

PATH=/usr/lib64/qt5/bin
ROOTPATH=/usr/lib64/qt5/bin
CONFIG_PROTECT=/usr/share/config
COLON_SEPARATED=QT_PLUGIN_PATH
QT_PLUGIN_PATH=/usr/lib64/plugins:/usr/lib64/qt5/plugins:/usr/lib64/kde4/plugins
QML2_IMPORT_PATH=/usr/lib64/qml:/usr/lib64/qt5/qml

> What's the output of `strings /usr/lib64/libQt5Core.so | grep plugpath` ?
> 
> 
> (In reply to Karol Herbst from comment #0)
> > Some Qt5 application may produce a "could not find or load the Qt platform
> > plugin “xcb”" error on start.
> 
> Only "some" applications? "may"? Do you mean that not all apps fail, and for
> those that fail the problem is not reproducible every time?

I wasn't testing more applications, I just assume it could hit others. It seems like it was a packaging issue on my side.
Comment 3 Davide Pesavento (RETIRED) gentoo-dev 2014-09-19 22:34:01 UTC
(In reply to Karol Herbst from comment #2)
> (In reply to Davide Pesavento from comment #1)
> > What are the contents of the env.d file installed by kde?
> > 
> 
[...]
> QT_PLUGIN_PATH=/usr/lib64/plugins:/usr/lib64/qt5/plugins:/usr/lib64/kde4/
> plugins
> QML2_IMPORT_PATH=/usr/lib64/qml:/usr/lib64/qt5/qml
> 

@kde, /usr/lib64/qt5/plugins and /usr/lib64/qt5/qml are redundant because both paths are always included by default. Also, I'm not sure if the "kde4" above is intentional or a typo...
Comment 4 Michael Palimaka (kensington) gentoo-dev 2014-09-20 17:56:39 UTC
kde4 is leaking from the environment: echo "QT_PLUGIN_PATH=${libdir}/plugins:${libdir}/qt5/plugins:${QT_PLUGIN_PATH}" >> ${envfile}
Comment 5 Davide Pesavento (RETIRED) gentoo-dev 2014-09-20 19:14:07 UTC
(In reply to Michael Palimaka (kensington) from comment #4)
> kde4 is leaking from the environment: echo
> "QT_PLUGIN_PATH=${libdir}/plugins:${libdir}/qt5/plugins:${QT_PLUGIN_PATH}"
> >> ${envfile}

this should be "....${QT_PLUGIN_PATH:+:}${QT_PLUGIN_PATH}" in any case.

Are you going to remove the redundant paths? or is there a reason for them to be there?
Comment 6 Michael Palimaka (kensington) gentoo-dev 2014-09-20 19:20:29 UTC
(In reply to Davide Pesavento from comment #5)
> (In reply to Michael Palimaka (kensington) from comment #4)
> > kde4 is leaking from the environment: echo
> > "QT_PLUGIN_PATH=${libdir}/plugins:${libdir}/qt5/plugins:${QT_PLUGIN_PATH}"
> > >> ${envfile}
> 
> this should be "....${QT_PLUGIN_PATH:+:}${QT_PLUGIN_PATH}" in any case.
> 
> Are you going to remove the redundant paths? or is there a reason for them
> to be there?

I filed bug #523314 to track this (and other) improvements to the env file