Bug 276997 - www/qt6-webengine: fix build with clang 18
Summary: www/qt6-webengine: fix build with clang 18
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks: 276104
  Show dependency treegraph
 
Reported: 2024-02-12 08:29 UTC by Dimitry Andric
Modified: 2024-02-13 18:03 UTC (History)
1 user (show)

See Also:
jhale: maintainer-feedback+


Attachments
www/qt6-webengine: fix build with clang 18 (7.65 KB, patch)
2024-02-12 08:30 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-02-12 08:29:10 UTC
Clang 18 has become more stringent about narrowing in initializer lists,
resulting in errors when building www/qt6-webengine:

  ../../../../../qtwebengine-everywhere-src-6.6.1/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:192:54: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
    192 |       {StatsReport::kStatsValueNameTotalAudioEnergy, info.total_output_energy},
        |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~
  ../../../../../qtwebengine-everywhere-src-6.6.1/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:194:8: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
    194 |        info.total_output_duration}};
        |        ^~~~~~~~~~~~~~~~~~~~~~~~~~

Cherry-pick https://webrtc.googlesource.com/src/+/267f9bdd53 into the
thirdparty directory, which fixes these errors.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-02-12 08:30:17 UTC
Created attachment 248385 [details]
www/qt6-webengine: fix build with clang 18
Comment 2 Jason E. Hale freebsd_committer freebsd_triage 2024-02-13 01:59:17 UTC
Ship it!

Qt 6.6.2 is overdue for release, but the last word from the Qt Release Team in their meeting notes from 2024-02-06 [1] is it should be out at the beginning of this week. If you don't get around to committing this before Qt 6.6.2 is released, I'll do it before I start working on the update.

[1] https://lists.qt-project.org/pipermail/releasing/2024-February/003009.html
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-02-13 18:01:53 UTC
A commit in branch main references this bug:

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

commit 0707093c0a5df15911d72c3b2e8001b3428f2e2e
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-02-12 08:17:56 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-02-13 18:00:05 +0000

    www/qt6-webengine: fix build with clang 18

    Clang 18 has become more stringent about narrowing in initializer lists,
    resulting in errors when building www/qt6-webengine:

      ../../../../../qtwebengine-everywhere-src-6.6.1/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:192:54: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
        192 |       {StatsReport::kStatsValueNameTotalAudioEnergy, info.total_output_energy},
            |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~
      ../../../../../qtwebengine-everywhere-src-6.6.1/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:194:8: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
        194 |        info.total_output_duration}};
            |        ^~~~~~~~~~~~~~~~~~~~~~~~~~

    Cherry-pick https://webrtc.googlesource.com/src/+/267f9bdd53 into the
    thirdparty directory, which fixes these errors.

    PR:             276997
    MFH:            2024Q1

 ...rty_webrtc_pc_legacy__stats__collector.cc (new) | 114 +++++++++++++++++++++
 1 file changed, 114 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-02-13 18:01:54 UTC
A commit in branch 2024Q1 references this bug:

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

commit 0569d74e5287a2933b0e19027f7524a4d247bf17
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-02-12 08:17:56 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-02-13 18:00:38 +0000

    www/qt6-webengine: fix build with clang 18

    Clang 18 has become more stringent about narrowing in initializer lists,
    resulting in errors when building www/qt6-webengine:

      ../../../../../qtwebengine-everywhere-src-6.6.1/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:192:54: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
        192 |       {StatsReport::kStatsValueNameTotalAudioEnergy, info.total_output_energy},
            |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~
      ../../../../../qtwebengine-everywhere-src-6.6.1/src/3rdparty/chromium/third_party/webrtc/pc/legacy_stats_collector.cc:194:8: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing-const-reference]
        194 |        info.total_output_duration}};
            |        ^~~~~~~~~~~~~~~~~~~~~~~~~~

    Cherry-pick https://webrtc.googlesource.com/src/+/267f9bdd53 into the
    thirdparty directory, which fixes these errors.

    PR:             276997
    MFH:            2024Q1
    (cherry picked from commit 0707093c0a5df15911d72c3b2e8001b3428f2e2e)

 ...rty_webrtc_pc_legacy__stats__collector.cc (new) | 114 +++++++++++++++++++++
 1 file changed, 114 insertions(+)
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2024-02-13 18:03:02 UTC
Thanks. Similar patches apply to other webkit instances such as chromium, I will submit separate tickets for those.