Bug 291449 - www/qt6-webengine: Fails to build on recent main
Summary: www/qt6-webengine: Fails to build on recent main
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: https://reviews.freebsd.org/D54124
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-07 03:18 UTC by Tomoaki AOKI
Modified: 2026-01-01 22:22 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (kde)


Attachments
sys/_types.h: recognise char8_t as a builtin type in C++20 (823 bytes, patch)
2025-12-08 12:36 UTC, Robert Clausecker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomoaki AOKI 2025-12-07 03:18:02 UTC
Formerly, the build exhibited the same error as Bug291296.
But even after offending commit was reverted at base fc88be257e30c3e3c01f25ec3a3a6e7933b40c54, still broken with different failure mode like below.

In file included from ../../../../../qtwebengine-everywhere-src-6.9.3/src/3rdparty/chromium/pdf/pdf_view_web_plugin.cc:5:
In file included from ../../../../../qtwebengine-everywhere-src-6.9.3/src/3rdparty/chromium/pdf/pdf_view_web_plugin.h:32:
In file included from ../../../../../qtwebengine-everywhere-src-6.9.3/src/3rdparty/chromium/pdf/pdfium/pdfium_engine_client.h:9:
In file included from /usr/include/c++/v1/uchar.h:48:
/usr/include/uchar.h:36:23: error: cannot combine with previous 'char' declaration specifier
typedef unsigned char char8_t


Maybe the root cause is in base (or compiler version dependent), but as I cannot determine it yet, filing this from the aspect of failure mode.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2025-12-07 12:40:46 UTC
This is like related to the recent addition of char8_t, though I was unable to understand what the exact relationship is.
Comment 2 Dima Panov freebsd_committer freebsd_triage 2025-12-07 21:48:08 UTC
(In reply to Robert Clausecker from comment #1)
Same story as with unreachable() -- non-guarded leaks of C23 defs to _cplusplus scope
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2025-12-07 22:02:49 UTC
(In reply to Dima Panov from comment #2)

It's unclear to me how this happens, if I compile a file with just

    #include <uchar.h>

in C++ mode, it builds fine.  It took my computer a day to build qt6-webengine far enough to reproduce the issue and I can now finally investigate.
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2025-12-07 23:45:49 UTC
I think I get it.  char8_t is a keyword in C++20, so I must not declare this type in C++ mode.
Comment 5 Tomoaki AOKI 2025-12-08 10:04:57 UTC
(In reply to Robert Clausecker from comment #4)
So typedef part of the commit base f0e541118c374869a8226eaa1320bb6eda248a20 need to be reverted, keeping others intact? If the type is included in language spec itself, there should be no need to typedef it.

Or the whole commit to be reverted?

Another option could be to typedef for older spec only, but not sure there are some actual needs exist or not.

I've searched about char8_t type and found it's for assuring (part of) UTF-8 character(s) to be stored (UTF-8 is a multibytes character encoding, not wide character [wchar_t] in definition).

There should be clear needs, but using language spec supporting it is the most straightforward way, thus, not sure support on older specs is needed or not.
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2025-12-08 12:36:03 UTC
Created attachment 265984 [details]
sys/_types.h: recognise char8_t as a builtin type in C++20

Proposed patch.

sys/_types.h: recognise char8_t as a builtin type in C++20

Unlike in C23 where it's a typedef, char8_t is a built in type in
C++20.  Recognise it as such.
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2025-12-08 12:37:01 UTC
(In reply to Tomoaki AOKI from comment #5)

The attached patch makes it so that we don't define our own char8_t in C++20 or newer mode.  Please check if this fixes your problem.  Will upload a DR shortly.
Comment 8 commit-hook freebsd_committer freebsd_triage 2025-12-09 13:17:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=66129def7bdaf8a0447aba55e736d27687204555

commit 66129def7bdaf8a0447aba55e736d27687204555
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-12-07 23:49:05 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-12-09 13:16:31 +0000

    sys/_types.h: recognise char8_t as a builtin type in C++20

    Unlike in C23 where it's a typedef, char8_t is a built in type in
    C++20.  Recognise it as such.

    PR:             291449
    Reported by:    Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
    Approved by:    markj (mentor)
    Reviewed by:    imp
    Fixes:          f0e541118c374869a8226eaa1320bb6eda248a20
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D54124

 sys/sys/_types.h | 4 ++++
 1 file changed, 4 insertions(+)
Comment 9 Robert Clausecker freebsd_committer freebsd_triage 2025-12-09 13:37:39 UTC
Thank you for your report!
Comment 10 Tomoaki AOKI 2025-12-09 18:51:20 UTC
(In reply to Robert Clausecker from comment #9)
Thanks for fixing!

A datapoint.

Switched to main branch environment again, backed out previous patch to stddef.h, apply your diff and started building www/qt6-webengine on bare metal before the commit, and finished successfully just now.

Note that the patch is applied directly to installed environment (not to /usr/src) at /usr/include with -p2 option to patch.
Comment 11 commit-hook freebsd_committer freebsd_triage 2026-01-01 22:22:19 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2ff4e6ac0d9f3f4ef477d15c40da04a87f5b7578

commit 2ff4e6ac0d9f3f4ef477d15c40da04a87f5b7578
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-12-07 23:49:05 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-01-01 20:51:52 +0000

    sys/_types.h: recognise char8_t as a builtin type in C++20

    Unlike in C23 where it's a typedef, char8_t is a built in type in
    C++20.  Recognise it as such.

    PR:             291449
    Reported by:    Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
    Approved by:    markj (mentor)
    Reviewed by:    imp
    Fixes:          f0e541118c374869a8226eaa1320bb6eda248a20
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D54124

    (cherry picked from commit 66129def7bdaf8a0447aba55e736d27687204555)

 sys/sys/_types.h | 4 ++++
 1 file changed, 4 insertions(+)