Bug 292531 - graphics/qt5-wayland: build failure from "parse error"
Summary: graphics/qt5-wayland: build failure from "parse error"
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks: 292067
  Show dependency treegraph
 
Reported: 2026-01-17 03:31 UTC by Kenneth Raplee
Modified: 2026-01-21 06:18 UTC (History)
5 users (show)

See Also:
jhale: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Raplee 2026-01-17 03:31:31 UTC
--- .moc/moc_qwltexturesharingextension_p.cpp ---
extensions/qwltexturesharingextension_p.h:88: Warning: Property declaration imageSearchPath has no READ accessor function or associated MEMBER variable. The property will be invalid.
extensions/qwltexturesharingextension_p.h:145: Parse error at "DESIGNABLE"
*** [.moc/moc_qwltexturesharingextension_p.cpp] Error code 1

make[2]: stopped making "all" in /wrkdirs/usr/ports/graphics/qt5-wayland/work/kde-qtwayland-5.15.18p55/src/compositor
Comment 1 Jason E. Hale freebsd_committer freebsd_triage 2026-01-18 08:57:54 UTC
We have received a similar fallout log for CURRENT-160008-amd64 [1] and I can confirm this doing a ground-up build trying to rule out mismatched devel/qt5-qmake and devel/qt5-buildtools.

The usual suspect would be llvm, but llvm21 hasn't landed yet, so this is pretty bizarre. Something else changed in base to make moc barf on the Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS() macro [2], but I'm not yet sure of what.

[1] https://pkg-status.freebsd.org/beefy24/data/main-amd64-default/p4e2183ec0d23_s75556c7e99/logs/qt5-wayland-5.15.18p55.log
[2] https://code.qt.io/cgit/qt/qtwayland.git/tree/src/compositor/global/qwaylandquickextension.h?h=5.15
Comment 2 Kenneth Raplee 2026-01-20 03:32:15 UTC
(In reply to Jason E. Hale from comment #1)
The moc build problem seems to first occur at this src tree commit.

https://cgit.freebsd.org/src/commit/?id=f441a225c4eb56deff1edc2402fe85a0ae263ebd

It's likely another case of C23 leaking into C++20 or later, much like what happened here with char8_t: https://cgit.freebsd.org/src/commit/?id=66129def7bdaf8a0447aba55e736d27687204555
Comment 3 Jason E. Hale freebsd_committer freebsd_triage 2026-01-20 08:04:22 UTC
(In reply to Kenneth Raplee from comment #2)
You're right about [1] being the culprit! It seems this is evaluating to true in this case.

I changed L35 to the following and graphics/qt5-wayland builds again:
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ < 202311L)) && !defined(__cplusplus)

[1] https://cgit.freebsd.org/src/tree/include/stdbool.h?id=f441a225c4eb56deff1edc2402fe85a0ae263ebd#n35
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2026-01-20 10:13:22 UTC
(In reply to Jason E. Hale from comment #3)

> #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ < 202311L)) && !defined(__cplusplus)

What causes conditions in which __STDC_VERSION__ is not defined, we are not building for C++, and yet <stdbool.h> is being included?  Seems very weird.
Comment 5 Jason E. Hale freebsd_committer freebsd_triage 2026-01-20 10:17:13 UTC
(In reply to Robert Clausecker from comment #4)

FWIW, this also works and would probably be better since it would still support C89/C90:

#if !defined(__cplusplus) && (__STDC_VERSION__ < 202311L)

It is strange.
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2026-01-20 10:28:51 UTC
(In reply to Jason E. Hale from comment #5)

That's the condition we have right now (just flipped).  I don't see how flipping the condition makes a difference.
Comment 7 Jason E. Hale freebsd_committer freebsd_triage 2026-01-20 10:38:53 UTC
(In reply to Robert Clausecker from comment #6)

It's probably a bug in Qt5's moc, but I think it would be easier to fix this header than to try and fix an unsupported version of moc.
Comment 8 Robert Clausecker freebsd_committer freebsd_triage 2026-01-20 10:45:22 UTC
(In reply to Jason E. Hale from comment #7)

If flipping the order of conditionals is all that is needed, I would be for it.  Please go ahead and file a DR.

We should not go with this change:

#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ < 202311L)) && !defined(__cplusplus)

as <stdbool.h> should define true/false when not building C or C++ code.
Comment 9 Jason E. Hale freebsd_committer freebsd_triage 2026-01-20 12:48:40 UTC
(In reply to Robert Clausecker from comment #8)

I tracked down the moc bug and once I understood the real problem, it turned out to be easier to fix than I thought, so no changes to base will be necessary. Just a rebuild of devel/qt5-buildtools.

The problem was that moc didn't know what to do with the 'L' integer suffix. This explains why the order of the conditions made a difference.
Comment 10 Robert Clausecker freebsd_committer freebsd_triage 2026-01-20 12:51:22 UTC
(In reply to Jason E. Hale from comment #9)

Cool!
Comment 11 commit-hook freebsd_committer freebsd_triage 2026-01-20 13:02:53 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=69d2fe9445a4fd125814f361facf325c23f9e8ed

commit 69d2fe9445a4fd125814f361facf325c23f9e8ed
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2026-01-20 12:49:37 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2026-01-20 13:01:54 +0000

    devel/qt5-buildtools: Hello 'L'-o

    Add support for the 'L' integer suffix to moc.

    This fixes a parsing bug that appeared in graphics/qt5-wayland after [1].
    extensions/qwltexturesharingextension_p.h:145: Parse error at "DESIGNABLE"

    Many thanks to kenrap and fuz for their help!

    [1] https://cgit.freebsd.org/src/commit/?id=f441a225c4eb56deff1edc2402fe85a0ae263ebd

    PR:             292531
    Reported by:    Kenneth Raplee <kenrap@kennethraplee.com>
    MFH:            2026Q1

 devel/qt5-buildtools/Makefile                      |  1 +
 .../patch-src_tools_moc_preprocessor.cpp (new)     | 40 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)
Comment 12 commit-hook freebsd_committer freebsd_triage 2026-01-20 13:03:55 UTC
A commit in branch 2026Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a3424a036570e7aae8c404676b3b4372eb3c934d

commit a3424a036570e7aae8c404676b3b4372eb3c934d
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2026-01-20 12:49:37 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2026-01-20 13:02:47 +0000

    devel/qt5-buildtools: Hello 'L'-o

    Add support for the 'L' integer suffix to moc.

    This fixes a parsing bug that appeared in graphics/qt5-wayland after [1].
    extensions/qwltexturesharingextension_p.h:145: Parse error at "DESIGNABLE"

    Many thanks to kenrap and fuz for their help!

    [1] https://cgit.freebsd.org/src/commit/?id=f441a225c4eb56deff1edc2402fe85a0ae263ebd

    PR:             292531
    Reported by:    Kenneth Raplee <kenrap@kennethraplee.com>
    MFH:            2026Q1

    (cherry picked from commit 69d2fe9445a4fd125814f361facf325c23f9e8ed)

 devel/qt5-buildtools/Makefile                      |  1 +
 .../patch-src_tools_moc_preprocessor.cpp (new)     | 40 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)