Possible marking-state.h Chromium bug when compiling QtWebEngine from source
-
Hi everyone, hope that you have a nice day!
I'm trying to compile QtWebEngine from source using MSVC 2022 SDK 26100, Python 3, these are my steps:
I tried to configure the whole qt project with QtWebEngine enabled, then build it, but after a while, I got this error, and turned out it from Chromium 3rdparty code:
../../../../../src/3rdparty/chromium/v8\src/heap/cppgc/marking-state.h(361): error C2352: 'cppgc::internal::MarkingStateBase::MarkNoPush': a call of a non-static member function requires an object ../../../../../src/3rdparty/chromium/v8\src/heap/cppgc/marking-state.h(87): note: see declaration of 'cppgc::internal::MarkingStateBase::MarkNoPush'
And the build process stops.
Another approach that I tried is to configure the standalone QtWebEngine module only using this command:
cd qtwebengine mkdir build cd build cmake .. -G "Ninja" -DCMAKE_PREFIX_PATH="D:\QtBuild\qt-6.9.0-dynamic-msvc2022-x86_64" -DCMAKE_INSTALL_PREFIX="D:\QtBuild\qt-6.9.0-dynamic-msvc2022-x86_64" ninja
And after a while I also encountered the same error, I tried to inspect the that line on the
marking-state.h
file of Chromium source, and I changed from:inline bool MarkNoPush(HeapObjectHeader& header) { return MutatorMarkingState::BasicMarkingState::MarkNoPush(header); }
to
inline bool MarkNoPush(HeapObjectHeader& header) { return BasicMarkingState::MarkNoPush(header); }
Reason:
We called
BasicMarkingState::MarkNoPush(...)
as if it were a static method, butMarkNoPush
is non-static, so we must call it on an object. SinceMutatorMarkingState
inheritsBasicMarkingState
, so we just need to remove the class declaration call.And then I tried to compile again, and it compiled perfectly, but i'm not sure if the output works without any problems.
I hope that this is my skill issue by not able to solve such a small compile environment error than it's an actual bug or something like that, please someone make sure that I'm getting a paranoid :) my C++ skill is not good so maybe the approach above is a silly move.
-
This issue is reported here: https://bugreports.qt.io/browse/QTBUG-136953. And there's a fix to qtwebengine-chromium: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/646656