Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 401025 - x11-libs/qt-core installs pkgconfig file with {moc,uic,rcc}_location pointing to build dir
Summary: x11-libs/qt-core installs pkgconfig file with {moc,uic,rcc}_location pointing...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Low normal (vote)
Assignee: Qt Bug Alias
URL: https://codereview.qt-project.org/43634
Whiteboard:
Keywords: PATCH, UPSTREAM
: 450076 453906 454042 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-27 13:36 UTC by theodor
Modified: 2013-03-09 21:21 UTC (History)
4 users (show)

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


Attachments
compressed bold log of a different fail (qt-core-debug_build.log.tar.bz2,27.34 KB, application/x-gtar)
2012-03-03 11:56 UTC, Ian Delaney (RETIRED)
Details
build log of x11-libs/qt-core-4.7.4-r1 (build.log.bz2,31.64 KB, application/x-bzip2)
2012-03-10 12:03 UTC, theodor
Details
QtCore.pc as requested. (QtCore.pc,1.59 KB, text/plain)
2012-03-11 15:56 UTC, theodor
Details
Patch against Qt 4.8.0 (untested) (qmake-no-prefix-in-extra-pkgconfig-vars.patch,669 bytes, patch)
2012-03-12 01:19 UTC, Davide Pesavento
Details | Diff
Upstream patch (0001-set-pkg-config-_location-directly-to-install-dir.patch,1.98 KB, patch)
2013-01-08 18:57 UTC, Davide Pesavento
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description theodor 2012-01-27 13:36:27 UTC
A different package didn't compile because it gets the path to moc, uic via pkg-config, something like: pkg-config --variable moc_location QtCore
Sadly, the returned path is the temporary build directory where portage build qt-core (../x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-4.7.4/bin/moc) which of course fails.

Reproducible: Didn't try

Steps to Reproduce:
1. pkg-config --variable moc_location QtCore
Actual Results:  
[..]/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-4.7.4/bin/moc

Expected Results:  
/usr/bin/moc
Comment 1 Rafał Mużyło 2012-01-27 16:28:23 UTC
More info required.
Here, qt-core 4.7.4-r1 emerged on 22.12.2012 returns correct value.
Comment 2 Davide Pesavento gentoo-dev 2012-01-27 16:48:07 UTC
Please attach your emerge --info and the full build.log of x11-libs/qt-core
Comment 3 theodor 2012-01-27 16:52:30 UTC
It is on x86 but I don't have the build log any more (at least I don't know where it would be).

qt-core-4.7.4-r1: USE="exceptions glib iconv jit qt3support ssl (-aqua) -debug
-optimized-qmake -pch -private-headers"

CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.1.4-r3
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.8.2
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.6.2
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r2
sys-apps/portage:         2.1.10.41
Comment 4 Davide Pesavento gentoo-dev 2012-02-13 01:44:12 UTC
(In reply to comment #3)
> It is on x86 but I don't have the build log any more (at least I don't know
> where it would be).
> 

Well, re-emerge x11-libs/qt-core with FEATURES="keeptemp" and you'll find the build log in /var/tmp/portage/x11-libs/qt-core-*/temp
Comment 5 Davide Pesavento gentoo-dev 2012-02-13 02:04:35 UTC
Even better than the build log, check if QT_BUILD_TREE is defined in the environment please.
Comment 6 Ian Delaney (RETIRED) gentoo-dev 2012-03-03 11:56:38 UTC
Created attachment 304107 [details]
compressed bold log of a different fail
Comment 7 Ian Delaney (RETIRED) gentoo-dev 2012-03-03 14:21:28 UTC
after sorting a separate non issue;

archtester qt-core # eix qt-core

     Installed versions:  4.7.4-r1(4)(22:08:07 03/03/12)(exceptions glib iconv jit qt3support ssl -aqua -debug -optimized-qmake -pch -private-headers)

archtester qt-core # qlist qt-core | grep "\.pc"
/usr/lib64/pkgconfig/QtCore.pc
/usr/lib64/pkgconfig/QtNetwork.pc
/usr/lib64/pkgconfig/QtXml.pc

archtester qt-core # pkg-config --variable moc_location QtCore
/usr/bin/moc


Also could not replicate
Comment 8 Davide Pesavento gentoo-dev 2012-03-03 14:27:05 UTC
Reopen when you have provided the info I asked for in comments #4 and #5.
Comment 9 theodor 2012-03-10 12:01:38 UTC
(In reply to comment #5)
> Even better than the build log, check if QT_BUILD_TREE is defined in the
> environment please.

I am not absolutely sure which environment you mean but use grep QT_BUILD_TREE on the environment file returns:

    find config.tests/unix -name '*.test' -type f -print0 | xargs -0 sed -i -e "/bin\/qmake/ s: \"QT_BUILD_TREE=:                       'QMAKE_CC=$(tc-getCC)'    'QMAKE_CXX=$(tc-getCXX)'      'QMAKE_LINK=$(tc-getCXX)' 'QMAKE_CFLAGS+=${CFLAGS}' 'QMAKE_CXXFLAGS+=${CXXFLAGS}' 'QMAKE_LFLAGS+=${LDFLAGS}'&:" || die "sed config.tests failed";


For completeness sake, the new emerge of qt-core was because the pch and private-headers USE flags are set now but this bug still appears.
Comment 10 theodor 2012-03-10 12:03:55 UTC
Created attachment 304823 [details]
build log  of x11-libs/qt-core-4.7.4-r1
Comment 11 Davide Pesavento gentoo-dev 2012-03-10 13:12:28 UTC
Please grep your environment file for "QMAKE_MOC" too.
Comment 12 Davide Pesavento gentoo-dev 2012-03-10 13:18:43 UTC
Also post the output of:
  env | grep "^Q"
Comment 13 theodor 2012-03-10 16:34:34 UTC
grep QMAKE_MOC x11-libs/qt-core-4.7.4-r1/temp/environment returns nothing.
`env | grep "^Q"` returns QT_PLUGIN_PATH=/usr/lib/kde4/plugins
Comment 14 Davide Pesavento gentoo-dev 2012-03-11 12:02:06 UTC
(In reply to comment #13)
> grep QMAKE_MOC x11-libs/qt-core-4.7.4-r1/temp/environment returns nothing.
> `env | grep "^Q"` returns QT_PLUGIN_PATH=/usr/lib/kde4/plugins

Ok, your environment is good. That means we have to dig deeper to find the root cause...

Please perform the following command:
  ebuild /usr/portage/x11-libs/qt-core/qt-core-4.7.4-r1.ebuild clean configure

When it will have finished attach the file /var/tmp/portage/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-4.7.4/lib/pkgconfig/QtCore.pc

and post the output of:
  grep "QtCore\.pc" /var/tmp/portage/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-4.7.4/src/corelib/Makefile
Comment 15 theodor 2012-03-11 15:55:39 UTC
> Please perform the following command:
>   ebuild /usr/portage/x11-libs/qt-core/qt-core-4.7.4-r1.ebuild clean
> configure

Okay.
 
> When it will have finished attach the file
> /var/tmp/portage/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-
> 4.7.4/lib/pkgconfig/QtCore.pc

I think you mean /usr/portage/distfiles/portage/portage/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-4.7.4/lib/pkgconfig/QtCore.pc because PORTAGE_TMPDIR="/usr/portage/distfiles/portage". I attached that file.

> and post the output of:
>   grep "QtCore\.pc"
> /var/tmp/portage/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-
> 4.7.4/src/corelib/Makefile

Changed the path again:
$ grep "QtCore\.pc" /usr/portage/distfiles/portage/portage/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-4.7.4/src/corelib/Makefile
all: Makefile ../../lib/libQtCore.prl ../../lib/libQtCore.la ../../lib/pkgconfig/QtCore.pc  ../../lib/$(TARGET)
../../lib/libQtCore.la\ ../../lib/pkgconfig/QtCore.pc: 
        -$(SED) -e "s,/usr/portage/distfiles/portage/portage/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-4.7.4/include,/usr/include/qt4,g" -e "s,/usr/portage/distfiles/portage/portage/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-4.7.4/lib,/usr/lib/qt4,g" -e "s,/usr/portage/distfiles/portage/portage/x11-libs/qt-core-4.7.4-r1/work/qt-everywhere-opensource-src-4.7.4,/usr,g" "../../lib/pkgconfig/QtCore.pc" >"$(INSTALL_ROOT)/usr/lib/qt4/pkgconfig/QtCore.pc"
         -$(DEL_FILE) "$(INSTALL_ROOT)/usr/lib/qt4/pkgconfig/QtCore.pc"
Comment 16 theodor 2012-03-11 15:56:43 UTC
Created attachment 304913 [details]
QtCore.pc as requested.
Comment 17 Davide Pesavento gentoo-dev 2012-03-12 00:50:03 UTC
Ok, found the bug. Your non-standard PORTAGE_TMPDIR setting has a major role here.
A patch for 4.8 is coming soon. As a workaround, you can set PORTAGE_TMPDIR to anything that does not start with '/usr'.
Comment 18 Davide Pesavento gentoo-dev 2012-03-12 01:19:45 UTC
Created attachment 304961 [details, diff]
Patch against Qt 4.8.0 (untested)
Comment 19 theodor 2012-03-12 21:40:36 UTC
Thanks and sorry for not mentioning PORTAGE_TMPDIR earlier. It didn't cross my mind that the "/usr" beginning could be treated differently..
Btw, does the patch work for 4.7.4 as well?
Comment 20 Davide Pesavento gentoo-dev 2012-03-12 22:06:21 UTC
(In reply to comment #19)
> Btw, does the patch work for 4.7.4 as well?

It should, but it doesn't apply as-is because that code was moved. Anyway I'm not going to apply it to 4.7.4 in portage, only to 4.8.x.
Comment 21 theodor 2012-10-02 13:58:35 UTC
Happens again in qt-core-4.8.3-r1. Haven't tried the old patch yet.
Comment 22 theodor 2012-10-02 16:26:34 UTC
The old patch seems to fix the issue.
Comment 23 theodor 2012-12-17 02:37:10 UTC
And it happened again... can please fix this finally?
Comment 24 Davide Pesavento gentoo-dev 2012-12-17 05:56:20 UTC
(In reply to comment #23)
> And it happened again... can please fix this finally?

Can you use a more standard PORTAGE_TMPDIR please?

This is an upstream issue and must be fixed there. You are welcome to open a bug with them, I don't have the time to do it now.
Comment 25 theodor 2012-12-20 11:30:43 UTC
Changing PORTAGE_TMPDIR is major work for me and you said you will apply it to 4.8.x which has not happened yet. So at least don't give false hope that it will be fixed in gentoo that would have saved me the time at least running into it again and again. But I fail to see why it is such a problem to add an oneliner-patch.
Comment 26 Markos Chandras (RETIRED) gentoo-dev 2012-12-20 11:32:34 UTC
(In reply to comment #25)
> Changing PORTAGE_TMPDIR is major work for me and you said you will apply it
> to 4.8.x which has not happened yet. So at least don't give false hope that
> it will be fixed in gentoo that would have saved me the time at least
> running into it again and again. But I fail to see why it is such a problem
> to add an oneliner-patch.

this is an upstream problem. Did you open an upstream bug report like we suggested?
Comment 27 Davide Pesavento gentoo-dev 2012-12-20 20:05:44 UTC
(In reply to comment #25)
> But I fail to see why it is such a problem
> to add an oneliner-patch.

Because I'm not sure that patch is the right way to fix it. And that's also why I want upstream to know about the bug.
Comment 28 Jack 2012-12-22 18:53:28 UTC
I get the same problem with 4.8.2 (stable on amd64) and yes, my PORTAGE_TMPDIR does begin with /usr.  (My failure was doing make xconfig for a new kernel.)  The patch in comment 18 works for me.  I've filed upstream bug:  https://bugreports.qt-project.org/browse/QTBUG-28807.
Comment 29 Davide Pesavento gentoo-dev 2012-12-25 21:54:43 UTC
https://codereview.qt-project.org/43634
Comment 30 Davide Pesavento gentoo-dev 2013-01-08 18:57:56 UTC
Created attachment 334842 [details, diff]
Upstream patch

Please test this one.
Comment 31 Davide Pesavento gentoo-dev 2013-01-18 21:47:12 UTC
(In reply to comment #30)
> Created attachment 334842 [details, diff] [details, diff]
> Upstream patch
> 
> Please test this one.

ping
Comment 32 Jack 2013-01-18 22:50:47 UTC
Hmmm...  I've since gone to 4.8.4 and see 4.8.2 is gone from portage, and make xconfig on gentoo-sources 3.6.11 now works without a problem.  I don't know if this means that something changed in the source, or if I need to make a clean install of the kernel source.  I suppose for me to test would require 
1) either starting with a clean kernel source or going back to my saved 4.8.2 without the patch from comment 18 to confirm it is still broken
2) then apply this patch, reinstall qt-core, and then re-try the make xconfig.

I won't have time to try this for a few days - so please let me know if I seem to be going in the wrong direction.
Comment 33 Davide Pesavento gentoo-dev 2013-01-18 23:25:21 UTC
Just re-emerge qt-core-4.8.4 with the patch in comment #30, then attach /usr/lib/pkgconfig/QtCore.pc here please.
Comment 34 Ulrich Müller gentoo-dev 2013-01-25 16:55:14 UTC
*** Bug 453906 has been marked as a duplicate of this bug. ***
Comment 35 Angelo Arrifano (RETIRED) gentoo-dev 2013-01-25 17:15:10 UTC
(In reply to comment #33)
> Just re-emerge qt-core-4.8.4 with the patch in comment #30, then attach
> /usr/lib/pkgconfig/QtCore.pc here please.

I just hit the same bug, I confirm that the proposed patch works:

$ grep _location /usr/lib/pkgconfig/QtCore.pc 
moc_location=${prefix}/bin/moc
uic_location=${prefix}/bin/uic
rcc_location=${prefix}/bin/rcc
lupdate_location=${prefix}/bin/lupdate
lrelease_location=${prefix}/bin/lrelease
Comment 36 Rafał Mużyło 2013-01-26 01:24:21 UTC
*** Bug 454042 has been marked as a duplicate of this bug. ***
Comment 37 Jack 2013-01-26 03:21:17 UTC
Well, almost, I think but not quite.

/usr/lib/pkgconfig/QtCore.pc from the portage 4.8.4:
-------------------
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib64/qt4
includedir=${prefix}/include/qt4/QtCore
qt_config=lex yacc warn_on debug uic resources qt warn_on incremental link_prl gdb_dwarf_index def_files_disabled exceptions no_mocdepend debug stl qt_no_framework debug shar
ed dll largefile stl mmx 3dnow sse sse2 sse3 ssse3 sse4_1 sse4_2 avx dylib create_prl link_prl depend_includepath QTDIR_build nostrip qt_install_headers qt warn_on depend_inc
ludepath qmake_cache target_qt hide_symbols bsymbolic_functions create_pc create_libtool explicitlib moc thread shared dll
moc_location=${prefix}/portage/tmpdir/portage/x11-libs/qt-core-4.8.4/work/qt-everywhere-opensource-src-4.8.4/bin/moc
uic_location=${prefix}/portage/tmpdir/portage/x11-libs/qt-core-4.8.4/work/qt-everywhere-opensource-src-4.8.4/bin/uic
rcc_location=${prefix}/portage/tmpdir/portage/x11-libs/qt-core-4.8.4/work/qt-everywhere-opensource-src-4.8.4/bin/rcc
lupdate_location=${prefix}/portage/tmpdir/portage/x11-libs/qt-core-4.8.4/work/qt-everywhere-opensource-src-4.8.4/bin/lupdate
lrelease_location=${prefix}/portage/tmpdir/portage/x11-libs/qt-core-4.8.4/work/qt-everywhere-opensource-src-4.8.4/bin/lrelease

Name: Qtcore
Description: Qtcore Library
Version: 4.8.4
Libs: -L${libdir} -lQtCore 
Libs.private: -L/usr/lib64 -L/usr/lib64/qt4  -lgthread-2.0 -lrt -lglib-2.0 -L/usr/lib64/qt4 -lpthread -lz -lm -ldl -pthread -lgthread-2.0 -lrt -lglib-2.0  
Cflags: -DQT_SHARED -I/usr/include/qt4 -I${includedir}
-------------------

and from the patched version (copied from the work directory, not actually installed, although I hope that doesn't matter:

-------------------
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib64/qt4
includedir=${prefix}/include/qt4/QtCore
qt_config=lex yacc warn_on debug uic resources qt warn_on incremental link_prl gdb_dwarf_index def_files_disabled exceptions no_mocdepend debug stl qt_no_framework debug shar
ed dll largefile stl mmx 3dnow sse sse2 sse3 ssse3 sse4_1 sse4_2 avx dylib create_prl link_prl depend_includepath QTDIR_build nostrip qt_install_headers qt warn_on depend_inc
ludepath qmake_cache target_qt hide_symbols bsymbolic_functions create_pc create_libtool explicitlib moc thread shared dll
moc_location=${prefix}/bin/moc
uic_location=${prefix}/bin/uic
rcc_location=${prefix}/bin/rcc
lupdate_location=${prefix}/bin/lupdate
lrelease_location=${prefix}/bin/lrelease

Name: Qtcore
Description: Qtcore Library
Version: 4.8.4                                                                                                                                                                
Libs: -L${libdir} -lQtCore 
Libs.private: -L/usr/lib64 -L/usr/portage/tmpdir/portage/x11-libs/qt-core-4.8.4-r99/work/qt-everywhere-opensource-src-4.8.4/lib  -lgthread-2.0 -lrt -lglib-2.0 -L/usr/lib64/qt
4 -lpthread -lz -lm -ldl -pthread -lgthread-2.0 -lrt -lglib-2.0  
Cflags: -DQT_SHARED -I/usr/include/qt4 -I${includedir}
-------------------
all the ..._location lines are good, but Libs.private was OK with the portage version, but in the patched version now refers to the work location.
Comment 38 Davide Pesavento gentoo-dev 2013-01-26 03:37:48 UTC
(In reply to comment #37)
> all the ..._location lines are good, but Libs.private was OK with the
> portage version, but in the patched version now refers to the work location.

This is before make install right? If so, it's expected, because the sed that fixes those paths hasn't been run yet.
Comment 39 Davide Pesavento gentoo-dev 2013-01-26 09:01:02 UTC
Upstream patch applied to qt-core-4.8.4-r1, thanks a lot to everyone involved!
Comment 40 Jack 2013-01-26 14:18:12 UTC
(In reply to comment #38)
> This is before make install right? If so, it's expected, because the sed
> that fixes those paths hasn't been run yet.

Correct.   I thought about that after I posted.  I suppose I could have done "ebuild install" first.
Comment 41 Andreas K. Hüttel archtester gentoo-dev 2013-03-09 21:21:07 UTC
*** Bug 450076 has been marked as a duplicate of this bug. ***