Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 497312 - dev-qt/qt*:5 - Qt5*_PRIVATE_INCLUDE_DIRS are empty in generated Qt5*Config.cmake files in shadow builds
Summary: dev-qt/qt*:5 - Qt5*_PRIVATE_INCLUDE_DIRS are empty in generated Qt5*Config.cm...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL: https://bugreports.qt.io/browse/QTBUG...
Whiteboard:
Keywords: UPSTREAM
: 499882 501872 504450 510100 510746 (view as bug list)
Depends on:
Blocks: 530152
  Show dependency tree
 
Reported: 2014-01-06 22:18 UTC by Nikita Zlobin
Modified: 2021-09-04 16:47 UTC (History)
10 users (show)

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


Attachments
patch to fix a problem (qt5-generate-extras-with-private-include-dirs.patch,1.05 KB, patch)
2014-02-16 17:33 UTC, Alex Turbov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Zlobin 2014-01-06 22:18:06 UTC
Variable Qt5Widgets_PRIVATE_INCLUDE_DIRS appears empty in qt5/style/CMakeLists.txt. It seems, for maintainer int works.

Issue on github, still no known solution: https://github.com/QtCurve/qtcurve/issues/35

Marking as major, since indeed - Major Feature is broken :)

Reproducible: Always

Steps to Reproduce:
Just try to build with qt5 support
Comment 1 Nikita Zlobin 2014-01-06 22:19:10 UTC
More exactly it happens on argbhelper.cpp in qt5 sruff.
Comment 2 Davide Pesavento (RETIRED) gentoo-dev 2014-01-07 16:12:01 UTC
Might be an issue with qtwidgets ebuild, needs investigation.
Comment 3 Davide Pesavento (RETIRED) gentoo-dev 2014-02-05 17:45:25 UTC
*** Bug 499882 has been marked as a duplicate of this bug. ***
Comment 4 Eugene Shalygin 2014-02-09 13:39:26 UTC
It seems like all Qt5_*_PRIVATE_INCLUDE_DIRS are empty in Qt5*Config.cmake files. 

For instance on ArchLinux:
$ grep -A 3 -m 1  Qt5Core_PRIVATE_INCLUDE_DIRS /usr/lib64/cmake/Qt5Core/Qt5CoreConfig.cmake

set(Qt5Core_PRIVATE_INCLUDE_DIRS
    "${_qt5Core_install_prefix}/include/qt/QtCore/5.2.1"
    "${_qt5Core_install_prefix}/include/qt/QtCore/5.2.1/QtCore"
)

On Gentoo:
set(Qt5Core_PRIVATE_INCLUDE_DIRS "")
include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL)

foreach(_dir ${_Qt5Core_OWN_INCLUDE_DIRS})


And it is true for other *Config.cmake files
Comment 5 Davide Pesavento (RETIRED) gentoo-dev 2014-02-09 16:20:05 UTC
Arch does an in-source build, right?
Comment 6 Davide Pesavento (RETIRED) gentoo-dev 2014-02-09 17:13:32 UTC
Removing "CMAKE_NO_PRIVATE_INCLUDES = true" from create_cmake.prf fixes it, although I'm not sure if that's the proper fix.

I also found some inconsistencies (bugs possibly) elsewhere in that same file wrt the handling of ExtraSourceIncludes.cmake, thus I'd like to speak with upstream about the whole thing first.
Comment 7 Eugene Shalygin 2014-02-10 14:47:00 UTC
> Arch does an in-source build, right?
Yes
Comment 8 Michael Palimaka (kensington) gentoo-dev 2014-02-16 17:23:59 UTC
Which Qt version are you using?

I had a problem like this with QtGui and KF5, but only with 5.2.1 - it works fine with 5.9999
Comment 9 Alex Turbov 2014-02-16 17:33:19 UTC
Created attachment 370550 [details, diff]
patch to fix a problem

generate ExtraSourceIncludes.cmake which will be included by the Qt5xxxConfig.cmake and define xxx_PRIVATE_INCLUDE_DIRS in it...
so packages like kf5 KGuiAddons can compile
Comment 10 Davide Pesavento (RETIRED) gentoo-dev 2014-02-16 17:37:44 UTC
(In reply to Alex Turbov from comment #9)
> Created attachment 370550 [details, diff] [details, diff]
> patch to fix a problem
> 

NAK

If we are going to implement a workaround, then removing CMAKE_NO_PRIVATE_INCLUDES (comment #6) is far easier.
Comment 11 Michael Palimaka (kensington) gentoo-dev 2014-02-20 10:46:29 UTC
*** Bug 501872 has been marked as a duplicate of this bug. ***
Comment 12 Malte E. 2014-02-26 10:31:27 UTC
I just tried removing "CMAKE_NO_PRIVATE_INCLUDES = true", that did not fix the problem for me. Maybe bug #501872 is a different problem?
Comment 13 Davide Pesavento (RETIRED) gentoo-dev 2014-02-26 13:10:07 UTC
(In reply to Malte E. from comment #12)
> I just tried removing "CMAKE_NO_PRIVATE_INCLUDES = true", that did not fix
> the problem for me. Maybe bug #501872 is a different problem?

And did you rebuild the qt module afterwards (seems to be qtgui in your case)?
Comment 14 Malte E. 2014-02-26 21:35:02 UTC
I just did that, but the problem remains.
Comment 15 Michael Palimaka (kensington) gentoo-dev 2014-03-05 14:10:04 UTC
In 4fd568fa0633b17b4a8e24736a4766e81afff4f3 split_incpath is set for non-git builds (which would be why this is not an issue for qt-9999).
In this case, ExtraSourceIncludes.cmake is created with set(Qt5Gui_PRIVATE_INCLUDE_DIRS /var/tmp/portage/dev-qt/...) but is not installed, which I guess is what comment #9 is trying to address.

Maybe this is an artifact from assuming that (binary) distros will be packaging the private headers separately?
Comment 16 Michael Palimaka (kensington) gentoo-dev 2014-03-05 16:47:56 UTC
In any case, this is definitely related to shadow builds. It works fine in-source with our configure arguments, but not with out-of-source.
Comment 17 Davide Pesavento (RETIRED) gentoo-dev 2014-03-05 17:34:52 UTC
(In reply to Michael Palimaka (kensington) from comment #16)
> In any case, this is definitely related to shadow builds. It works fine
> in-source with our configure arguments, but not with out-of-source.

Yep, I suspected that while reading the .prf files of qt build system (comment #5) and Eugene confirmed it as well.
Comment 18 Davide Pesavento (RETIRED) gentoo-dev 2014-03-05 17:43:59 UTC
(In reply to Michael Palimaka (kensington) from comment #15)
> In 4fd568fa0633b17b4a8e24736a4766e81afff4f3 split_incpath is set for non-git
> builds (which would be why this is not an issue for qt-9999).
> In this case, ExtraSourceIncludes.cmake is created with
> set(Qt5Gui_PRIVATE_INCLUDE_DIRS /var/tmp/portage/dev-qt/...) but is not
> installed, which I guess is what comment #9 is trying to address.
> 

I noticed that too (sorry for not reporting here, I could have saved you some time). And even if ExtraSourceIncludes.cmake were installed, the path in it is wrong because it refers to the build directory.

I'm starting to think that it's not actually our fault, but rather that the build system is buggy in our particular scenario (wouldn't be the first time).
Comment 19 Michael Palimaka (kensington) gentoo-dev 2014-03-05 17:48:54 UTC
(In reply to Davide Pesavento from comment #18)
> I'm starting to think that it's not actually our fault, but rather that the
> build system is buggy in our particular scenario (wouldn't be the first
> time).

What can we do then - is there any chance of upstream actually fixing this, or should we just switch to in-source builds (at least temporarily)?
Comment 20 Davide Pesavento (RETIRED) gentoo-dev 2014-03-05 18:02:31 UTC
(In reply to Michael Palimaka (kensington) from comment #19)
> What can we do then - is there any chance of upstream actually fixing this,

I think so, maybe even for 5.3 (otherwise we can backport the fix). I suspect they don't even know about this issue however, so a good first step would be to report it :)
Comment 21 Michael Palimaka (kensington) gentoo-dev 2014-03-06 12:02:26 UTC
I filed a bug.
Comment 22 Davide Pesavento (RETIRED) gentoo-dev 2014-03-07 06:38:29 UTC
(In reply to Michael Palimaka (kensington) from comment #21)
> I filed a bug.

err... link? :)
Comment 23 Michael Palimaka (kensington) gentoo-dev 2014-03-10 15:32:32 UTC
https://bugreports.qt-project.org/browse/QTBUG-37297
Comment 24 Elias Probst 2014-03-11 18:40:50 UTC
Fixed the issue for me (I couldn't build kde-frameworks/kguiaddons-9999) by this change to the qt5-build.eclass:

> diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
> index 264e158..d331bfb 100644
> --- a/eclass/qt5-build.eclass
> +++ b/eclass/qt5-build.eclass
> @@ -102,7 +102,7 @@ EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_
>  # @ECLASS-VARIABLE: QT5_BUILD_DIR
>  # @DESCRIPTION:
>  # Build directory for out-of-source builds.
> -: ${QT5_BUILD_DIR:=${S}_build}
> +: ${QT5_BUILD_DIR:=${S}}
>  
>  # @ECLASS-VARIABLE: QT5_VERBOSE_BUILD
>  # @DESCRIPTION:

Next, I rebuilt dev-qt/qtgui-5.2.1 and now I was able to successfully build kde-frameworks/kguiaddons-9999.

So until this is fixed upstream the dev-qt/qt*-5.2* ebuild should probably set QT5_BUILD_DIR=${S} which should then be pushed to the overlay/tree as a new revision to ensure all affected packages are rebuilt.
Comment 25 Davide Pesavento (RETIRED) gentoo-dev 2014-03-13 06:28:03 UTC
*** Bug 504450 has been marked as a duplicate of this bug. ***
Comment 26 Mantas 2014-03-18 09:27:23 UTC
Had the same error with Qt 5.3.0 alpha, however fin in Comment 24 solves the problem.
Comment 27 Davide Pesavento (RETIRED) gentoo-dev 2014-05-09 20:40:04 UTC
Is this reproducible with 5.3.0_rc? (I guess so)
Comment 28 Michael Palimaka (kensington) gentoo-dev 2014-05-10 14:50:48 UTC
(In reply to Davide Pesavento from comment #27)
> Is this reproducible with 5.3.0_rc? (I guess so)

It looks like the changes will be in 5.3.1
Comment 29 Davide Pesavento (RETIRED) gentoo-dev 2014-05-10 17:00:38 UTC
(In reply to Michael Palimaka (kensington) from comment #28)
> (In reply to Davide Pesavento from comment #27)
> > Is this reproducible with 5.3.0_rc? (I guess so)
> 
> It looks like the changes will be in 5.3.1

What changes are you talking about? I don't know of any patches fixing this, but if there are, we can backport them to 5.3.0
Comment 30 Michael Palimaka (kensington) gentoo-dev 2014-05-10 17:01:21 UTC
Sorry I was on the wrong bug.
Comment 31 Davide Pesavento (RETIRED) gentoo-dev 2014-05-12 00:23:18 UTC
*** Bug 510100 has been marked as a duplicate of this bug. ***
Comment 32 Uwe L. Korn 2014-05-12 12:57:03 UTC
Can confirm that this is fixed in 5.3.1 / 5.3.9999

% grep -A 3 'set(Qt5Gui_PRIVATE_INCLUDE_DIRS'  /usr/lib64/cmake/Qt5Gui/Qt5GuiConfig.cmake
    set(Qt5Gui_PRIVATE_INCLUDE_DIRS
        "${_qt5Gui_install_prefix}/include/qt5/QtGui/5.3.1"
        "${_qt5Gui_install_prefix}/include/qt5/QtGui/5.3.1/QtGui"
    )
Comment 33 Davide Pesavento (RETIRED) gentoo-dev 2014-05-12 13:19:00 UTC
(In reply to Uwe L. Korn from comment #32)
> Can confirm that this is fixed in 5.3.1 / 5.3.9999
> 

Cool! Any chances you can identify the patch(es) that fixed it so that we can backport to 5.3.0?
Comment 34 Uwe L. Korn 2014-05-16 19:59:31 UTC
We should be able to get *PRIVATE_INCLUDE_DIRS populated in a release build by removing lines 17-19 in mkspecs/features/qt_module_pris.prf.
Comment 35 Davide Pesavento (RETIRED) gentoo-dev 2014-05-17 00:03:50 UTC
I don't understand... you said this is fixed in 5.3.9999, but I don't see any changes around those lines of qt_module_pris.prf in the stable branch...
Comment 36 Uwe L. Korn 2014-05-17 00:10:51 UTC
5.3.9999 has the *PRIVATE_INCLUDE_DIRS because it is a build from git, this changes behaviour which first got me thinking that there was a fix in 5.3.9999 which is obviously wrong. The mentioned lines are related to the code that deactivates the generation of the *PRIVATE_INCLUDE_DIRS contents. But just disabling these lines will break the build itself as then include paths during the build itself are wrong.
Comment 37 Michael Palimaka (kensington) gentoo-dev 2014-05-19 13:33:24 UTC
*** Bug 510746 has been marked as a duplicate of this bug. ***
Comment 38 Davide Pesavento (RETIRED) gentoo-dev 2014-05-19 18:04:04 UTC
I added a workaround to the eclass
https://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commitdiff;h=8d7f7f9428e4ccddf0defc051c7067d509fefcdb
Comment 39 Malte E. 2014-05-21 11:09:24 UTC
Qt 5.3 is out - may that have changed anything?
Comment 40 Davide Pesavento (RETIRED) gentoo-dev 2014-05-21 11:44:57 UTC
(In reply to Malte E. from comment #39)
> Qt 5.3 is out - may that have changed anything?

No.
Comment 41 Davide Pesavento (RETIRED) gentoo-dev 2016-06-21 00:29:41 UTC
FWIW, Fedora ran into the same problem and had to revert back to in-source builds.

http://pkgs.fedoraproject.org/cgit/rpms/qt5-qtbase.git/commit/?id=4a85b930ef978834794f4e11364865fe98bf441c
Comment 42 Larry the Git Cow gentoo-dev 2020-04-09 19:45:48 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/qt.git/commit/?id=548df2493d9801b2503f412ec8c424418cb7721b

commit 548df2493d9801b2503f412ec8c424418cb7721b
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2020-03-31 12:21:16 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2020-04-09 18:32:31 +0000

    qt5-build.eclass: Drop obsolete in-source build workaround for >=5.14.2
    
    Fixed upstream in 5.11.1.
    
    See also: https://bugreports.qt.io/browse/QTBUG-37417
    Upstream commit 67aa365d41ebfe082b4efcfd725e4d5f08be678c
    
    qtbase forwarding header was introduced to fix bug 599636 in commit:
    d82f92ed064996dfb187ef668d74ed5b05546b2d
    
    Bug: https://bugs.gentoo.org/497312
    Bug: https://bugs.gentoo.org/676948
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 eclass/qt5-build.eclass | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)