Bug 271111 - www/qt6-webengine: fails to build, no member named 'kPpapi' in 'sandbox::mojom::Sandbox'
Summary: www/qt6-webengine: fails to build, no member named 'kPpapi' in 'sandbox::mojo...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-28 05:02 UTC by echoxxzz
Modified: 2024-05-02 02:53 UTC (History)
5 users (show)

See Also:
jhale: maintainer-feedback+


Attachments
poudriere build log (148.22 KB, application/x-bzip)
2023-06-10 08:53 UTC, Benjamin Takacs
no flags Details
qt6-webengine-fix-build-with-CUPS-unset-v1.patch (19.44 KB, patch)
2023-06-26 06:32 UTC, Kai Knoblich
kai: maintainer-approval+
Details | Diff
build log of py-qt6-webengine (11.09 KB, application/x-bzip)
2023-06-27 12:41 UTC, Benjamin Takacs
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description echoxxzz 2023-04-28 05:02:42 UTC
Using all default config settings for ports and cannot get qt6-webengine to build. This is the error I'm getting:

../../../../../qtwebengine-everywhere-src-6.4.2/src/3rdparty/chromium/base/token.h:32:57: warning: suggest braces around initialization of subobject [-Wmissing-braces]
  constexpr Token(uint64_t high, uint64_t low) : words_{high, low} {}
                                                        ^~~~~~~~~
                                                        {        }
../../../../../qtwebengine-everywhere-src-6.4.2/src/3rdparty/chromium/sandbox/policy/freebsd/sandbox_freebsd.cc:231:35: error: no member named 'kPpapi' in 'sandbox::mojom::Sandbox'
    case sandbox::mojom::Sandbox::kPpapi:
         ~~~~~~~~~~~~~~~~~~~~~~~~~^
1 warning and 1 error generated.
Comment 1 Benjamin Takacs 2023-05-07 10:50:30 UTC
I have the same problem (with nondefault options), for some reason 'enable_ppapi' is false in the build, leading to sandbox.mojom not generating that enum constant[0]. So either our patch using that constant[1] should also be conditionalled there or it should be investigated why that flag is false for some builds, as the official builders don't have that problem.

I can share poudriere buildlogs if wanted.

[0]: https://github.com/qt/qtwebengine-chromium/blob/22fec96c83014753f8d4d709dad25902cafa1a75/chromium/sandbox/policy/mojom/sandbox.mojom#L66
[1]: https://cgit.freebsd.org/ports/tree/www/qt6-webengine/files/patch-src_3rdparty_chromium_sandbox_policy_freebsd_sandbox__freebsd.cc#n234
Comment 2 echoxxzz 2023-05-09 20:32:18 UTC
(In reply to Benjamin Takacs from comment #1)

Can you share a patch file(s) that I can use to fix this problem?
Comment 3 Kai Knoblich freebsd_committer freebsd_triage 2023-06-07 16:31:14 UTC
(In reply to echoxxzz from comment #0)
(In reply to Benjamin Takacs from comment #1)

Hi,

thank you for the report and your findings so far. I ran poudriere builds of www/qt6-webengine 6.4.2_6 on 12.4-RELEASE amd64 (with either ALSA/PULSEAUDIO/SNDIO set) without any errors.

So the issue seems to occur only under certain circumstances.  To have a more detailed look: Can you please attach your build logs in a compressed format?
Comment 4 Benjamin Takacs 2023-06-10 08:53:00 UTC
Created attachment 242709 [details]
poudriere build log

As I exclusivly use *-make.conf to set options, thoses are all dumped in that log by poudriere too in case options of a dependency are a reason for that diffrence.
Comment 5 echoxxzz 2023-06-13 12:44:06 UTC
Using release 6 didn't help but I did eventually figure out the problem. I had the CUPS option disabled in devel/qt6-base as I don't own a printer. Once I re-enabled CUPS qt6-webengine builds without error.
Comment 6 Kai Knoblich freebsd_committer freebsd_triage 2023-06-26 06:32:11 UTC
Created attachment 243002 [details]
qt6-webengine-fix-build-with-CUPS-unset-v1.patch

(In reply to Benjamin Takacs from comment #4)
(In reply to echoxxzz from comment #5)

Thanks for the attached log which helped a lot to track down the root cause.  At the same time, when finding the actual cause, comment #5 also confirmed this, thank you very much for that as well.

I was able to reproduce issue as reported in comment #0 for qt6-webengine (with either ALSA/PULSEAUDIO/SNDIO set) and OPTIONS_UNSET+= CUPS in the make.conf:

However, the above settings would have to have worked for a good while until CUPS was made optional for devel/qt6-base in ports 12c193069e33.  That would fit at least in terms of the time period (= date of commit vs. date of this bug report).

If CUPS is re-enabled for devel/qt6-base by adding an additional line, the issue doesn't occur (as it comment #5 also confirms):

> devel_qt6-base_OPTIONS_SET_FORCE= CUPS


Can you please try the attached patch, if it works for you at runtime (with focus on PDF related stuff), if the CUPS option is unset? (I've left out the PORTREVISION bump for now to avoid rebases.)



Some more technical details:

If Cups is not present some GN arguments are set to false during the configuration stage:

> -- extend_gn_list(gnArgArg enable_basic_printing;enable_print_preview;enable_pdf CONDITION QT_FEATURE_webengine_printing_and_pdf ...): Evaluated to false
> -- extend_gn_list(gnArgArg use_cups CONDITION QT_FEATURE_webengine_printing_and_pdf;AND;NOT;WIN32 ...): Evaluated to false
> -- extend_gn_list(gnArgArg enable_plugins CONDITION QT_FEATURE_webengine_pepper_plugins ...): Evaluated to false


Adding "QT_FEATURE_webengine_pepper_plugins" to CMAKE_ON to explicitly enable the "enable_ppapi" option leads to an assertion error:

> CMake Error at /wrkdirs/usr/ports/www/qt6-webengine/work-sndio/qtwebengine-everywhere-src-6.4.2/cmake/Gn.cmake:72 (message):
> 
>  -- GN FAILED
> 
>  ERROR at //content/browser/BUILD.gn:2784:5: Assertion failed.
> 
>      assert(enable_basic_printing)
>      ^-----
> 
>  See //content/public/browser/BUILD.gn:490:5: which caused the file to be
>  included.
> 
>      "//content/browser",  # Must not be public_deps!
>      ^------------------

So it seems that the "enable_ppapi" option depends on the actual setting of "QT_FEATURE_webengine_printing_and_pdf". However adding "-DQT_FEATURE_webengine_print_and_pdf:BOOL=OFF" along with a patch that makes "sandbox::mojom::Sandbox::kPpapi" conditional didn't work as the build failed in a late stage when compiling the "QtPdf" module with the error reporting in comment #0.

Adding the additional parameter "-DQT_FEATURE_qtpdf_build:BOOL=OFF" to disable the build of the QtPdf module seems to the fix the whole build issue:

>  Build QtPdf Modules:
>    Build QtPdfWidgets ................... no
>    Build QtPdfQuick ..................... no

poudriere -> OK (13.2-RELEASE, with either ALSA/PULSEAUDIO/SNDIO and CUPS set) 
poudriere -> OK (13.2-RELEASE, with either ALSA/PULSEAUDIO/SNDIO and CUPS unset)
Comment 7 Benjamin Takacs 2023-06-27 12:41:16 UTC
Created attachment 243036 [details]
build log of py-qt6-webengine

Thanks, with this patch qt6-webengine builds now for me.

But that only helps me a little bit as my goal is to build and use deskutils/calibre and games/anki and the next build failure there is py-qt6-webengine which can't find qprinter.h so I guess the root cause is disabling CUPS in qt6-base too. Should I make a new problem report for that?

Is there some program I could use to runtime test qt6-webengine with CUPS disabled?
Comment 8 Kai Knoblich freebsd_committer freebsd_triage 2023-06-29 05:39:05 UTC
(In reply to Benjamin Takacs from comment #7)

Regarding a program, I had thought of www/dooble (QT6 flavor), which, by the way, I often use as a first start to test www/qt6-webengine.

Thanks also for sharing the info regarding www/py-qt6-webengine.  I haven't tried that far myself and will try to have a look at it in the next few days.
Comment 9 Benjamin Takacs 2023-07-01 14:22:34 UTC
(In reply to Kai Knoblich from comment #8)

Thanks again, I now did a bit of runtime testing with www/dooble.
It runs mostly fine, it lets me open a print dialog, there it only offers to print to a pdf (expected limitation without CUPS), but the file never appreres without any indication that something failed.

While that should be fixed I don't consider it a blocker for this patch.

If not even printing to pdf should work without CUPS, then the printing dialog shouldn't be offered.
If printing to pdf should work the user should get some indication that if failed and why, when it fails, but maybe that would be a www/dooble problem.

Another problem I noticed is, that dooble can ony open file: urls directly in the address bar, if I follow a link to a file: url, like on a directory listing, I get a "Access to the file was denied" page, as the url then is in the address bar, I can select it and press enter.

No idea about that problem.
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-12-01 18:18:35 UTC
A commit in branch main references this bug:

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

commit 8adbabc798f51c5d8bc6433d30b7c6c5c5c96eba
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2023-12-01 00:18:14 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2023-12-01 18:16:47 +0000

    Qt6: Update to 6.6.1

    As a patch release, Qt 6.6.1 does not introduce any new features but
    contains more than 400 bug fixes, security updates, and other
    improvements to the top of the Qt 6.6.0 release. See more information
    about the most important changes and bug fixes from the Qt 6.6.1 release
    note.

    To allow building www/qt6-webengine without CUPS, a CUPS option has been
    added and the Pdf module has been split out to a new port: print/qt6-pdf.
    This also allows building devel/py-qt6-pyqt without pulling in the unused
    WebEngine module. Fixes [1].

    Remove a lot of unused dependencies. Fixes [2]. Also remove inconsistent
    WWW lines from the individual Makefiles as WWW is alreay defined in
    Mk/Uses/qt-dist.mk. [3]

    Announcement: https://www.qt.io/blog/qt-6.6.1-released
    Rel note: https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/6.6.1/release-note.md

    PR:             271111 [1], 268692 [2]
    Reported by:    echoxxzz <echoxxzz@gmail.com> [1],
                    Matthieu Volat <mazhe@alkumuna.eu> [2],
                    lwhsu (via #freebsd-desktop IRC) [3]
    MFH:            2023Q4
    Security:       6d9c6aae-5eb1-11ee-8290-a8a1599412c6,
                    07ee8c14-68f1-11ee-8290-a8a1599412c6,
                    a1e27775-7a61-11ee-8290-a8a1599412c6,
                    0da4db89-84bf-11ee-8290-a8a1599412c6

 Mk/Uses/qt.mk                                      |   7 +-
 accessibility/qt6-speech/Makefile                  |   2 +-
 accessibility/qt6-speech/distinfo                  |   6 +-
 comms/qt6-connectivity/distinfo                    |   6 +-
 comms/qt6-sensors/Makefile                         |   1 -
 comms/qt6-sensors/distinfo                         |   6 +-
 comms/qt6-serialbus/Makefile                       |   1 -
 comms/qt6-serialbus/distinfo                       |   6 +-
 comms/qt6-serialport/Makefile                      |   1 -
 comms/qt6-serialport/distinfo                      |   6 +-
 databases/qt6-base_sqldriver/Makefile              |   1 -
 databases/qt6-base_sqldriver/distinfo              |   6 +-
 devel/py-qt6-pyqt/Makefile                         |  15 +--
 devel/py-qt6-pyqt/pkg-plist                        |  34 ++---
 devel/pyside6/Makefile                             |   3 +-
 devel/pyside6/pkg-plist                            |  16 +--
 devel/qt6-5compat/Makefile                         |  12 +-
 devel/qt6-5compat/distinfo                         |   6 +-
 devel/qt6-base/Makefile                            |  20 +--
 devel/qt6-base/distinfo                            |   6 +-
 .../files/patch-cmake_QtFlagHandlingHelpers.cmake  |   4 +-
 ...tch-src_gui_platform_unix_qxkbcommon.cpp (gone) |  13 --
 ...ns_tls_openssl_qsslsocket__openssl__symbols.cpp |  34 +++--
 ...atch-src_plugins_tls_openssl_qx509__openssl.cpp |   2 +-
 devel/qt6-base/pkg-plist                           |  11 +-
 devel/qt6-languageserver/Makefile                  |   1 -
 devel/qt6-languageserver/distinfo                  |   6 +-
 devel/qt6-location/Makefile                        |   3 +-
 devel/qt6-location/distinfo                        |   6 +-
 devel/qt6-positioning/Makefile                     |   5 +-
 devel/qt6-positioning/distinfo                     |   6 +-
 devel/qt6-remoteobjects/Makefile                   |   3 +-
 devel/qt6-remoteobjects/distinfo                   |   6 +-
 devel/qt6-scxml/Makefile                           |   3 +-
 devel/qt6-scxml/distinfo                           |   6 +-
 devel/qt6-tools/Makefile                           |  18 +--
 devel/qt6-tools/distinfo                           |   6 +-
 devel/qt6-tools/pkg-plist                          |   5 +
 devel/qt6-translations/Makefile                    |   1 -
 devel/qt6-translations/distinfo                    |   6 +-
 graphics/qt6-3d/Makefile                           |  20 +--
 graphics/qt6-3d/distinfo                           |   6 +-
 graphics/qt6-imageformats/Makefile                 |  24 +---
 graphics/qt6-imageformats/distinfo                 |   6 +-
 graphics/qt6-lottie/Makefile                       |   7 +-
 graphics/qt6-lottie/distinfo                       |   6 +-
 graphics/qt6-quickeffectmaker/Makefile             |   3 +-
 graphics/qt6-quickeffectmaker/distinfo             |   6 +-
 graphics/qt6-svg/Makefile                          |  21 +---
 graphics/qt6-svg/distinfo                          |   6 +-
 .../files/patch-src_svg_qsvghandler.cpp (gone)     |  11 --
 graphics/qt6-wayland/Makefile                      |  26 +---
 graphics/qt6-wayland/distinfo                      |   6 +-
 graphics/qt6-wayland/pkg-plist                     |   1 +
 misc/qt6-doc/Makefile                              |   4 +-
 misc/qt6-doc/distinfo                              |   6 +-
 misc/qt6-examples/Makefile                         |   1 +
 misc/qt6-examples/distinfo                         |   6 +-
 misc/qt6-examples/pkg-plist                        | 112 +++++------------
 multimedia/qt6-multimedia/Makefile                 |   3 +-
 multimedia/qt6-multimedia/distinfo                 |   6 +-
 multimedia/qt6-multimedia/pkg-plist                |   2 +
 net/qt6-coap/distinfo                              |   6 +-
 net/qt6-networkauth/Makefile                       |   9 +-
 net/qt6-networkauth/distinfo                       |   6 +-
 print/Makefile                                     |   1 +
 print/qt6-pdf/Makefile (new)                       |  13 ++
 print/qt6-pdf/pkg-descr (new)                      |   2 +
 print/qt6-pdf/pkg-plist (new)                      | 137 +++++++++++++++++++++
 science/qt6-quick3dphysics/Makefile                |   1 -
 science/qt6-quick3dphysics/distinfo                |   6 +-
 www/py-qt6-webengine/Makefile                      |   5 +-
 .../files/patch-pyproject.toml (new)               |  15 +++
 www/qt6-httpserver/Makefile                        |   1 -
 www/qt6-httpserver/distinfo                        |   6 +-
 www/qt6-webchannel/Makefile                        |   6 +-
 www/qt6-webchannel/distinfo                        |   6 +-
 www/qt6-webengine/Makefile                         |  94 +++++++++-----
 www/qt6-webengine/distinfo                         |   6 +-
 .../files/patch-cmake_Functions.cmake              |  22 ++--
 www/qt6-webengine/files/patch-configure.cmake      |  12 +-
 .../files/patch-security-rollup (new)              | 103 ++++++++++++++++
 ...y_chromium_base_containers_checked__iterators.h |  12 +-
 ...rty_chromium_build_toolchain_gcc__toolchain.gni |   4 +-
 ...owser_zygote__host_zygote__host__impl__linux.cc |  20 +--
 ...mium_sandbox_policy_freebsd_sandbox__freebsd.cc |  74 ++++++-----
 .../files/patch-src_core_api_configure.cmake       |  12 +-
 www/qt6-webengine/pkg-plist                        | 130 -------------------
 www/qt6-websockets/Makefile                        |   1 -
 www/qt6-websockets/distinfo                        |   6 +-
 www/qt6-webview/Makefile                           |   2 +-
 www/qt6-webview/distinfo                           |   6 +-
 x11-toolkits/qt6-charts/Makefile                   |   3 +-
 x11-toolkits/qt6-charts/distinfo                   |   6 +-
 x11-toolkits/qt6-datavis3d/Makefile                |   3 +-
 x11-toolkits/qt6-datavis3d/distinfo                |   6 +-
 x11-toolkits/qt6-declarative/Makefile              |  23 +---
 x11-toolkits/qt6-declarative/distinfo              |   8 +-
 x11-toolkits/qt6-declarative/pkg-plist             |   1 +
 x11-toolkits/qt6-graphs/Makefile                   |   3 +-
 x11-toolkits/qt6-graphs/distinfo                   |   6 +-
 x11-toolkits/qt6-graphs/pkg-plist                  |   2 +
 x11-toolkits/qt6-quick3d/Makefile                  |  20 +--
 x11-toolkits/qt6-quick3d/distinfo                  |   6 +-
 x11-toolkits/qt6-quicktimeline/Makefile            |  20 +--
 x11-toolkits/qt6-quicktimeline/distinfo            |   6 +-
 x11-toolkits/qt6-shadertools/Makefile              |  18 +--
 x11-toolkits/qt6-shadertools/distinfo              |   6 +-
 x11-toolkits/qt6-virtualkeyboard/Makefile          |   6 +-
 x11-toolkits/qt6-virtualkeyboard/distinfo          |   6 +-
 110 files changed, 697 insertions(+), 771 deletions(-)
Comment 11 Jason E. Hale freebsd_committer freebsd_triage 2023-12-01 18:31:51 UTC
I've split out the Pdf module into a separate port: print/qt6-pdf. It is now possible to build www/qt6-webengine without CUPS. The Pdf module does need CUPS, however, and is a hard dependency. I've also fixed the build error in www/py-qt6-webengine.

I'll keep this open for now if there are any runtime issues that need addressed.
Comment 12 Jason E. Hale freebsd_committer freebsd_triage 2024-05-02 02:53:45 UTC
Closing this as there hasn't been any feedback for 6 months after the print/qt6-pdf split from www/qt6-webengine.