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

Bug 510556

Summary: [qt overlay] dev-qt/qtgui:5[-egl] QT_CONFIG contains 'egl'
Product: Gentoo Linux Reporter: Davide Pesavento <pesa>
Component: [OLD] LibraryAssignee: Qt Bug Alias <qt>
Status: RESOLVED FIXED    
Severity: critical    
Priority: Highest    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=515080
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 454132    
Attachments: qconfig.pri with QT_CONFIG with egl but qtgui[-egl]

Description Davide Pesavento (RETIRED) gentoo-dev 2014-05-17 12:33:33 UTC
See this commit and comments

https://github.com/gentoo/qt/commit/294785ead65c5debc18335e7f5a381dc4264f25f
Comment 1 Uwe L. Korn 2014-05-17 12:39:12 UTC
Created attachment 377136 [details]
qconfig.pri with QT_CONFIG with egl but qtgui[-egl]

My qconfig.pri contains egl but qtgui is built without egl (but was previously installed with egl).

% emerge -qpv qtgui
[ebuild   R   ] dev-qt/qtgui-5.3.9999  USE="accessibility evdev gif glib jpeg opengl png udev xcb -debug -egl -eglfs -gles2 -harfbuzz -ibus -kms {-test}"
Comment 2 Davide Pesavento (RETIRED) gentoo-dev 2014-05-17 12:42:31 UTC
Adding -no-egl to configure in qt5-build.eclass should fix it.
Comment 3 Uwe L. Korn 2014-05-23 21:05:24 UTC
Adding -no-egl to configure (see https://github.com/gentoo/qt/pull/45 ) fixes this for "fresh" installations but the following sequence is still broken:

1. Install qtcore
2. Install qtgui[+egl]
3. Install qtgui[-egl]
4. qconfig.pri still contains egl

The problem (which is not only related to egl alone) is that keywords are always added to qconfig.pri but never removed.
Currently, we read qconfig.pri, parse its keywords, add the keywords of the other qt-packages and then save the keywords in qconfig.pri again. Only on reinstalls of qtcore we reset qconfig.pri and by this remove the keywords that were neither supplied by qtcore or another qt package.

To fix this issue I would suggest that qtcore should install qconfig.pri to mkspecs/gentoo/qconfig.pri .
When we rebuilt qconfig.pri, we should then read this file, built up the list of keywords from the other packages and afterwards write out the new file (with the updated keywords) to mkspecs/qconfig.pri .
This would solve the issue that we do not get rid of Q_CONFIG keywords that do not belong to any package anymore.
Sadly, I do not know how to add this in a backwards-compatible way to the eclass.
Comment 4 Uwe L. Korn 2014-07-02 18:19:24 UTC
See https://github.com/gentoo/qt/pull/65 for a first try to fix this.
Comment 5 Davide Pesavento (RETIRED) gentoo-dev 2014-07-02 23:17:47 UTC
(In reply to Uwe L. Korn from comment #3)
> The problem (which is not only related to egl alone) is that keywords are
> always added to qconfig.pri but never removed.
> Currently, we read qconfig.pri, parse its keywords, add the keywords of the
> other qt-packages and then save the keywords in qconfig.pri again.

This is not entirely correct. Currently we also discard all keywords that are in QCONFIG_REMOVE. The problem is that qtgui does not define any QCONFIG_REMOVE.

In general, QCONFIG_REMOVE should always contain at least the keywords in QCONFIG_ADD with their condition negated. It should be noted however that, with the current API exposed to ebuilds, doing this is very tedious and error-prone.

> To fix this issue I would suggest that qtcore should install qconfig.pri to
> mkspecs/gentoo/qconfig.pri .
> When we rebuilt qconfig.pri, we should then read this file, built up the
> list of keywords from the other packages and afterwards write out the new
> file (with the updated keywords) to mkspecs/qconfig.pri .
> This would solve the issue that we do not get rid of Q_CONFIG keywords that
> do not belong to any package anymore.

This could help in version bumps where a keyword that was previously enabled is completely removed from a package, although I don't think this can happen in practice due to the backwards compatibility promise of qt.
Comment 6 Davide Pesavento (RETIRED) gentoo-dev 2014-07-24 01:22:08 UTC
The particular issues with egl should be fixed in git with commits d81b3b0001165085978c2e4a79f754fd871037ed, 3b968a1e761d32b1f87cfcecda24178ee1da95ec, and 91d676a9b5f7e0d6fbac03cb5be88989757e0d2a.

The more general problem will be completely solved once I finish converting all of qtbase modules to QT5_GENTOO_CONFIG in the next few days.

As these changes are quite intrusive and touch a very delicate part of the eclass/ebuild machinery, testing with different USE flags combinations is highly appreciated.
Comment 7 Michael Palimaka (kensington) gentoo-dev 2014-07-24 12:28:52 UTC
Thanks for working on this.

I've done a number of builds of the packages converted so far and everything appears correct.
Comment 8 Davide Pesavento (RETIRED) gentoo-dev 2014-07-26 10:57:53 UTC
Everything is now disabled by default and what can be enabled has been converted to QT5_GENTOO_CONFIG, therefore I'm considering this as fixed. Thanks!