Bug 274740 - www/qt5-webengine: fix build with libc++ 17
Summary: www/qt5-webengine: fix build with libc++ 17
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: 273753
  Show dependency treegraph
 
Reported: 2023-10-26 16:30 UTC by Dimitry Andric
Modified: 2023-11-22 00:54 UTC (History)
0 users

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


Attachments
www/qt5-webengine: fix build with libc++ 17 (5.85 KB, patch)
2023-10-26 16:31 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 2023-10-26 16:30:09 UTC
Building www/qt5-webengine with libc++ 17 results in the following
compile errors:

  In file included from ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/trace_sorter.cc:17:
  In file included from /usr/include/c++/v1/algorithm:1803:
  In file included from /usr/include/c++/v1/__algorithm/nth_element.h:15:
  /usr/include/c++/v1/__algorithm/sort.h:577:14: error: no viable overloaded '='
    577 |     *__begin = _Ops::__iter_move(__pivot_pos);
        |     ~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/c++/v1/__algorithm/sort.h:802:20: note: in instantiation of function template specialization 'std::__bitset_partition<std::_ClassicAlgPolicy, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void> &>' requested here
    802 |             ? std::__bitset_partition<_AlgPolicy, _RandomAccessIterator, _Compare>(__first, __last, __comp)
        |                    ^
  /usr/include/c++/v1/__algorithm/sort.h:878:8: note: in instantiation of function template specialization 'std::__introsort<std::_ClassicAlgPolicy, std::__less<void, void> &, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, false>' requested here
    878 |   std::__introsort<_AlgPolicy,
        |        ^
  /usr/include/c++/v1/__algorithm/sort.h:946:10: note: in instantiation of function template specialization 'std::__sort_dispatch<std::_ClassicAlgPolicy, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void>>' requested here
    946 |     std::__sort_dispatch<_AlgPolicy>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __comp);
        |          ^
  /usr/include/c++/v1/__algorithm/sort.h:954:8: note: in instantiation of function template specialization 'std::__sort_impl<std::_ClassicAlgPolicy, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void>>' requested here
    954 |   std::__sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
        |        ^
  /usr/include/c++/v1/__algorithm/sort.h:960:8: note: in instantiation of function template specialization 'std::sort<perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void>>' requested here
    960 |   std::sort(__first, __last, __less<>());
        |        ^
  ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/trace_sorter.cc:51:8: note: in instantiation of function template specialization 'std::sort<perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator>' requested here
     51 |   std::sort(sort_begin, events_.end());
        |        ^
  ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h:191:26: note: candidate function not viable: 'this' argument has type 'const perfetto::trace_processor::TimestampedTracePiece', but method is not marked const
    191 |   TimestampedTracePiece& operator=(TimestampedTracePiece&& ttp) {
        |                          ^
  ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h:202:26: note: candidate function not viable: 'this' argument has type 'const perfetto::trace_processor::TimestampedTracePiece', but method is not marked const
    202 |   TimestampedTracePiece& operator=(const TimestampedTracePiece&) = delete;
        |                          ^

This is because perfetto's CircularQueue template is only half
const-correct. Upstream fixed this in:

https://github.com/google/perfetto/commit/b82a213bcf71dd8e68b53941375936c7905c0ff2

so apply that fix to qt5-webengine's older copy of perfetto.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-10-26 16:31:29 UTC
Created attachment 245895 [details]
www/qt5-webengine: fix build with libc++ 17
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-11-04 16:27:38 UTC
A commit in branch main references this bug:

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

commit bfcd2a9b6f168c590da52dfefa0aacf1b021d30f
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-10-26 10:45:00 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-11-04 16:26:51 +0000

    www/qt5-webengine: fix build with libc++ 17

    Building www/qt5-webengine with libc++ 17 results in the following
    compile errors:

      In file included from ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/trace_sorter.cc:17:
      In file included from /usr/include/c++/v1/algorithm:1803:
      In file included from /usr/include/c++/v1/__algorithm/nth_element.h:15:
      /usr/include/c++/v1/__algorithm/sort.h:577:14: error: no viable overloaded '='
        577 |     *__begin = _Ops::__iter_move(__pivot_pos);
            |     ~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/include/c++/v1/__algorithm/sort.h:802:20: note: in instantiation of function template specialization 'std::__bitset_partition<std::_ClassicAlgPolicy, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void> &>' requested here
        802 |             ? std::__bitset_partition<_AlgPolicy, _RandomAccessIterator, _Compare>(__first, __last, __comp)
            |                    ^
      /usr/include/c++/v1/__algorithm/sort.h:878:8: note: in instantiation of function template specialization 'std::__introsort<std::_ClassicAlgPolicy, std::__less<void, void> &, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, false>' requested here
        878 |   std::__introsort<_AlgPolicy,
            |        ^
      /usr/include/c++/v1/__algorithm/sort.h:946:10: note: in instantiation of function template specialization 'std::__sort_dispatch<std::_ClassicAlgPolicy, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void>>' requested here
        946 |     std::__sort_dispatch<_AlgPolicy>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __comp);
            |          ^
      /usr/include/c++/v1/__algorithm/sort.h:954:8: note: in instantiation of function template specialization 'std::__sort_impl<std::_ClassicAlgPolicy, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void>>' requested here
        954 |   std::__sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
            |        ^
      /usr/include/c++/v1/__algorithm/sort.h:960:8: note: in instantiation of function template specialization 'std::sort<perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void>>' requested here
        960 |   std::sort(__first, __last, __less<>());
            |        ^
      ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/trace_sorter.cc:51:8: note: in instantiation of function template specialization 'std::sort<perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator>' requested here
         51 |   std::sort(sort_begin, events_.end());
            |        ^
      ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h:191:26: note: candidate function not viable: 'this' argument has type 'const perfetto::trace_processor::TimestampedTracePiece', but method is not marked const
        191 |   TimestampedTracePiece& operator=(TimestampedTracePiece&& ttp) {
            |                          ^
      ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h:202:26: note: candidate function not viable: 'this' argument has type 'const perfetto::trace_processor::TimestampedTracePiece', but method is not marked const
        202 |   TimestampedTracePiece& operator=(const TimestampedTracePiece&) = delete;
            |                          ^

    This is because perfetto's CircularQueue template is only half
    const-correct. Upstream fixed this in:

    https://github.com/google/perfetto/commit/b82a213bcf71dd8e68b53941375936c7905c0ff2

    so apply that fix to qt5-webengine's older copy of perfetto.

    PR:             274740, 273753
    MFH:            2023Q4

 ...clude_perfetto_ext_base_circular__queue.h (new) | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-11-22 00:54:06 UTC
A commit in branch 2023Q4 references this bug:

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

commit 000f07df113165b4126a0108b51e4e2956d1fbfb
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-10-26 10:45:00 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2023-11-22 00:46:51 +0000

    www/qt5-webengine: fix build with libc++ 17

    Building www/qt5-webengine with libc++ 17 results in the following
    compile errors:

      In file included from ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/trace_sorter.cc:17:
      In file included from /usr/include/c++/v1/algorithm:1803:
      In file included from /usr/include/c++/v1/__algorithm/nth_element.h:15:
      /usr/include/c++/v1/__algorithm/sort.h:577:14: error: no viable overloaded '='
        577 |     *__begin = _Ops::__iter_move(__pivot_pos);
            |     ~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/include/c++/v1/__algorithm/sort.h:802:20: note: in instantiation of function template specialization 'std::__bitset_partition<std::_ClassicAlgPolicy, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void> &>' requested here
        802 |             ? std::__bitset_partition<_AlgPolicy, _RandomAccessIterator, _Compare>(__first, __last, __comp)
            |                    ^
      /usr/include/c++/v1/__algorithm/sort.h:878:8: note: in instantiation of function template specialization 'std::__introsort<std::_ClassicAlgPolicy, std::__less<void, void> &, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, false>' requested here
        878 |   std::__introsort<_AlgPolicy,
            |        ^
      /usr/include/c++/v1/__algorithm/sort.h:946:10: note: in instantiation of function template specialization 'std::__sort_dispatch<std::_ClassicAlgPolicy, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void>>' requested here
        946 |     std::__sort_dispatch<_AlgPolicy>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __comp);
            |          ^
      /usr/include/c++/v1/__algorithm/sort.h:954:8: note: in instantiation of function template specialization 'std::__sort_impl<std::_ClassicAlgPolicy, perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void>>' requested here
        954 |   std::__sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
            |        ^
      /usr/include/c++/v1/__algorithm/sort.h:960:8: note: in instantiation of function template specialization 'std::sort<perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator, std::__less<void, void>>' requested here
        960 |   std::sort(__first, __last, __less<>());
            |        ^
      ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/trace_sorter.cc:51:8: note: in instantiation of function template specialization 'std::sort<perfetto::base::CircularQueue<perfetto::trace_processor::TimestampedTracePiece>::Iterator>' requested here
         51 |   std::sort(sort_begin, events_.end());
            |        ^
      ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h:191:26: note: candidate function not viable: 'this' argument has type 'const perfetto::trace_processor::TimestampedTracePiece', but method is not marked const
        191 |   TimestampedTracePiece& operator=(TimestampedTracePiece&& ttp) {
            |                          ^
      ../../../../kde-qtwebengine-5.15.15p0/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h:202:26: note: candidate function not viable: 'this' argument has type 'const perfetto::trace_processor::TimestampedTracePiece', but method is not marked const
        202 |   TimestampedTracePiece& operator=(const TimestampedTracePiece&) = delete;
            |                          ^

    This is because perfetto's CircularQueue template is only half
    const-correct. Upstream fixed this in:

    https://github.com/google/perfetto/commit/b82a213bcf71dd8e68b53941375936c7905c0ff2

    so apply that fix to qt5-webengine's older copy of perfetto.

    PR:             274740, 273753
    MFH:            2023Q4
    (cherry picked from commit bfcd2a9b6f168c590da52dfefa0aacf1b021d30f)

 ...clude_perfetto_ext_base_circular__queue.h (new) | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)