Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 678022 - app-text/calibre with >=dev-qt/qtgui-5.12: fontconfig_database.cpp:769:48: error: invalid use of incomplete type ‘class QFontEngineFT’
Summary: app-text/calibre with >=dev-qt/qtgui-5.12: fontconfig_database.cpp:769:48: er...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: REGRESSION
: 679232 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-02-14 18:21 UTC by N. Andrew Walsh
Modified: 2019-03-05 11:38 UTC (History)
17 users (show)

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


Attachments
build.log (build.log,88.71 KB, text/plain)
2019-02-14 18:21 UTC, N. Andrew Walsh
Details
calibre-3.39.1-qtgui-5.12.patch (calibre-3.39.1-qtgui-5.12.patch,438 bytes, patch)
2019-03-02 10:38 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details | Diff
gentoo-qconfig.h (gentoo-qconfig.h,292 bytes, text/plain)
2019-03-02 20:59 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
gentoo-qconfig.h (gentoo-qconfig.h,295 bytes, text/plain)
2019-03-02 22:07 UTC, Dennis Schridde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description N. Andrew Walsh 2019-02-14 18:21:01 UTC
Created attachment 565406 [details]
build.log

calibre-3.36.0 appears to be suffering ABI breakage with Qt-5.12: emerge fails with the following errors:

/usr/include/qt5/QtGui/qpainter.h:482:18: note: forward declaration of ‘class QFontEngineFT’
     friend class QFontEngineFT;
                  ^~~~~~~~~~~~~
/var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:1069:11: error: invalid use of incomplete type ‘class QFontEngineFT’
     engine->antialias = antialias;
           ^~
In file included from /usr/include/qt5/QtGui/qpaintengine.h:47,
                 from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qtextengine_p.h:62,
                 from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qfontengine_p.h:59,
                 from /usr/include/qt5/QtGui/5.12.1/QtGui/qpa/qplatformfontdatabase.h:60,
                 from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.h:9,
                 from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:40:
/usr/include/qt5/QtGui/qpainter.h:482:18: note: forward declaration of ‘class QFontEngineFT’
     friend class QFontEngineFT;
                  ^~~~~~~~~~~~~
/var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:1070:11: error: invalid use of incomplete type ‘class QFontEngineFT’
     engine->defaultFormat = format;
           ^~
In file included from /usr/include/qt5/QtGui/qpaintengine.h:47,
                 from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qtextengine_p.h:62,
                 from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qfontengine_p.h:59,
                 from /usr/include/qt5/QtGui/5.12.1/QtGui/qpa/qplatformfontdatabase.h:60,
                 from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.h:9,
                 from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:40:
/usr/include/qt5/QtGui/qpainter.h:482:18: note: forward declaration of ‘class QFontEngineFT’
     friend class QFontEngineFT;
                  ^~~~~~~~~~~~~
/var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:1071:11: error: invalid use of incomplete type ‘class QFontEngineFT’
     engine->glyphFormat = format;
           ^~
In file included from /usr/include/qt5/QtGui/qpaintengine.h:47,
                 from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qtextengine_p.h:62,
                 from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qfontengine_p.h:59,
                 from /usr/include/qt5/QtGui/5.12.1/QtGui/qpa/qplatformfontdatabase.h:60,
                 from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.h:9,
                 from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:40:
/usr/include/qt5/QtGui/qpainter.h:482:18: note: forward declaration of ‘class QFontEngineFT’
     friend class QFontEngineFT;
                  ^~~~~~~~~~~~~
make: *** [Makefile:439: fontconfig_database.o] Error 1

complete build.log is attached.
Comment 1 N. Andrew Walsh 2019-02-17 18:13:32 UTC
NB: this issue also affects app-text/calibre-3.38.1 (and I'm guessing all versions). I haven't yet tried calibre-3.39.*, available on a couple overlays.
Comment 2 N. Andrew Walsh 2019-02-17 18:25:17 UTC
update: it fails on calibre-3.39.1, from the salfter overlay as well. So I'm going to have to remove calibre until upstream can fix the issue.
Comment 3 Jan-Matthias Braun 2019-02-28 10:44:11 UTC
According to https://bugs.launchpad.net/calibre/+bug/1817355, this might be
related to packaging, as the compile seems to work out of the box at least
on arch.

I checked the offending pre-processor output with gcc -E and found that,
while the correct header is included, the preprocessor doesn't insert its
contents. A patch to this is to actually
    #undef QT_NO_FREETYPE

before the include. Then the header is correctly inserted by the
pre-processor and the class will be fine. But this seems like a bogus patch.
I just tried it because the offending private header is using an ifndef here.

My remaining question is if and if why QT_NO_FREETYPE is defined in the
first place, when compiling the freetype font engine for the headless source
tree. But I don't have the time to go down this rabbit hole right now.
Comment 4 Attila Tóth 2019-03-01 19:22:14 UTC
(In reply to Jan-Matthias Braun from comment #3)
I recognize braindead header file locations for Qt-5.12.1.
For example:
qpa/qplatformfontdatabase.h
is located at:
qt5/QtGui/5.12.1/QtGui/qpa/qplatformfontdatabase.h
or
QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h
resides instead here:
qt5/QtFontDatabaseSupport/5.12.1/QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h

Although arch has the same weird header file location and this might be actually expected. This means that a given source file should hardcode the version while including a header file.

Seriously: what is this mickey mouse shit?

Exactly where I should insert that undef QT_NO_FREETYPE?

Thanks: Dw.
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-03-02 10:38:14 UTC
Created attachment 567420 [details, diff]
calibre-3.39.1-qtgui-5.12.patch

Thanks to Jan-Matthias' research I created this patch which fixes the build error for me. Although I dunno if this is the right approach and if this breaks compilation with qtgui-5.11
Comment 6 Andreas Sturmlechner gentoo-dev 2019-03-02 12:11:17 UTC
*** Bug 679232 has been marked as a duplicate of this bug. ***
Comment 7 N. Andrew Walsh 2019-03-02 14:19:38 UTC
The patch from #5 solved it for me. calibre compiled, and appears to run without error. Thanks!
Comment 8 Andrew Udvare 2019-03-02 15:09:11 UTC
Also confirming the patch works.
Comment 9 Davide Pesavento (RETIRED) gentoo-dev 2019-03-02 20:16:29 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #5)
> Created attachment 567420 [details, diff] [details, diff]
> calibre-3.39.1-qtgui-5.12.patch
> 
> Thanks to Jan-Matthias' research I created this patch which fixes the build
> error for me. Although I dunno if this is the right approach and if this
> breaks compilation with qtgui-5.11

No, that can't be right. If you end up with QT_NO_FREETYPE defined in your Qt installation then something is very wrong.

Can you or someone else attach their /usr/include/qt5/Gentoo/gentoo-qconfig.h ?
Comment 10 Davide Pesavento (RETIRED) gentoo-dev 2019-03-02 20:17:57 UTC
Reassigning to qt@ as this is most likely a qt packaging bug.
Comment 11 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-03-02 20:59:04 UTC
Created attachment 567494 [details]
gentoo-qconfig.h

Here's mine from my Gentoo dev machine...
Comment 12 Dennis Schridde 2019-03-02 22:07:21 UTC
Created attachment 567496 [details]
gentoo-qconfig.h
Comment 13 Amel Hodzic 2019-03-03 16:11:42 UTC
So, the patch seems to address the issue as described in the linked bug report to launchpad.  Also, the requested output from "/usr/include/qt5/Gentoo/gentoo-qconfig.h" shows that the patch does not create an undesirable entry "QT_NO_FREETYPE" there.

Is this correct thus far? If so, the patch might be an appropriate resolution to this issue.
Comment 14 PhobosK 2019-03-03 16:25:54 UTC
(In reply to Davide Pesavento from comment #9)
> No, that can't be right. If you end up with QT_NO_FREETYPE defined in your
> Qt installation then something is very wrong.
> 

@Davide,
the patch doesn't define QT_NO_FREETYPE ! It undefines it if the QT version is above or equal 5.9.0 !
Besides it is only for Calibre and obviously the QT doesn't have a fontconfig defined in its config :)




(In reply to Amel Hodzic from comment #13)
> ...Also, the requested output from
> "/usr/include/qt5/Gentoo/gentoo-qconfig.h" shows that the patch does not
> create an undesirable entry "QT_NO_FREETYPE" there.
@Amel,
The patch doesn't mess up with main QT config at all (the gentoo-config.h is part of dev-qt/qtcore). It just undefines the variable inside calibre thus making calibre know that QT has fonconfig in it.

To me the patch seems OK and works OK
Comment 15 Davide Pesavento (RETIRED) gentoo-dev 2019-03-03 19:00:42 UTC
(In reply to Amel Hodzic from comment #13)
> So, the patch seems to address the issue as described in the linked bug
> report to launchpad.  Also, the requested output from
> "/usr/include/qt5/Gentoo/gentoo-qconfig.h" shows that the patch does not
> create an undesirable entry "QT_NO_FREETYPE" there.
That's not why I asked to see the file.

> Is this correct thus far? If so, the patch might be an appropriate
> resolution to this issue.
It's not.
Comment 16 Davide Pesavento (RETIRED) gentoo-dev 2019-03-03 19:01:41 UTC
(In reply to PhobosK from comment #14)
> @Davide,
> the patch doesn't define QT_NO_FREETYPE ! It undefines it if the QT version
> is above or equal 5.9.0 !
I'm well aware, thank you.
Comment 17 Larry the Git Cow gentoo-dev 2019-03-03 19:52:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d487758dc1bcf53cbfaf35647f4acdae9cf442e9

commit d487758dc1bcf53cbfaf35647f4acdae9cf442e9
Author:     Davide Pesavento <pesa@gentoo.org>
AuthorDate: 2019-03-03 19:52:01 +0000
Commit:     Davide Pesavento <pesa@gentoo.org>
CommitDate: 2019-03-03 19:52:01 +0000

    dev-qt/qtgui: restore QT_FREETYPE define
    
    Closes: https://bugs.gentoo.org/678022
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Davide Pesavento <pesa@gentoo.org>

 dev-qt/qtgui/{qtgui-5.12.1.ebuild => qtgui-5.12.1-r1.ebuild} | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 18 Larry the Git Cow gentoo-dev 2019-03-03 20:01:53 UTC
The bug has been referenced in the following commit(s):

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

commit fa12b7b7bb8b139ce5ad484d554a7fa7902d4918
Author:     Davide Pesavento <pesa@gentoo.org>
AuthorDate: 2019-03-03 20:01:37 +0000
Commit:     Davide Pesavento <pesa@gentoo.org>
CommitDate: 2019-03-03 20:01:37 +0000

    dev-qt/qtgui: restore QT_FREETYPE define
    
    Bug: https://bugs.gentoo.org/678022
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Davide Pesavento <pesa@gentoo.org>

 dev-qt/qtgui/qtgui-5.12.9999.ebuild | 4 ++--
 dev-qt/qtgui/qtgui-5.13.9999.ebuild | 4 ++--
 dev-qt/qtgui/qtgui-5.9999.ebuild    | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)