Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange ZLIB errors - WebCore does not compile anymore #34

Open
quarcko opened this issue Feb 22, 2024 · 7 comments
Open

Strange ZLIB errors - WebCore does not compile anymore #34

quarcko opened this issue Feb 22, 2024 · 7 comments

Comments

@quarcko
Copy link

quarcko commented Feb 22, 2024

Strange thing happened, when i first built webkit with MINGW untill the very end, there were no such errors, i swear 😆
but while fixing JS assembly, and finally got back here to recompile WebCore, this happened:

In file included from C:/Qt/Qt6.5.3/6.5.3/mingw_64/include/QtZlib/zlib.h:34,
                 from C:/Qt/webkit/Source/WebCore/Modules/compression/CompressionStreamEncoder.h:34,
                 from C:/Qt/webkit/build-win/WebCore/DerivedSources/JSCompressionStreamEncoder.h:23,
                 from C:/Qt/webkit/build-win/WebCore/DerivedSources/JSLocalDOMWindow.cpp:125,
                 from C:\Qt\webkit\build-win\WebCore\DerivedSources\unified-sources\UnifiedSource-3a52ce78-88.cpp:7:
C:/Qt/webkit/Source/WebCore/layout/formattingContexts/inline/InlineRect.h: In member function 'void WebCore::Layout::InlineRect::z_inflate(WebCore::Layout::InlineLayoutUnit)':
C:/Qt/webkit/Source/WebCore/layout/formattingContexts/inline/InlineRect.h:326:12: error: 'using InlineLayoutRect = class WebCore::FloatRect' {aka 'class WebCore::FloatRect'} has no memb
er named 'z_inflate'; did you mean 'inflate'?
  326 |     m_rect.inflate(inflate);

AND

In file included from C:/Qt/Qt6.5.3/6.5.3/mingw_64/include/QtZlib/zlib.h:34,
                 from C:/Qt/webkit/Source/WebCore/Modules/websockets/WebSocketDeflater.cpp:38,
                 from C:\Qt\webkit\build-win\WebCore\DerivedSources\unified-sources\UnifiedSource-f8afad56-57.cpp:3:
C:/Qt/webkit/Source/WebCore/Modules/websockets/WebSocketFrame.cpp: In static member function 'static WebCore::WebSocketFrame::ParseFrameResult WebCore::WebSocketFrame::parseFrame(uint8_
t*, size_t, WebCore::WebSocketFrame&, const uint8_t*&, WTF::String&)':
C:/Qt/webkit/Source/WebCore/Modules/websockets/WebSocketFrame.cpp:114:11: error: 'struct WebCore::WebSocketFrame' has no member named 'z_compress'; did you mean 'compress'?
  114 |     frame.compress = compress;
      |           ^~~~~~~~
C:/Qt/webkit/Source/WebCore/Modules/websockets/WebSocketFrame.cpp: In constructor 'WebCore::WebSocketFrame::WebSocketFrame(WebCore::WebSocketFrame::OpCode, bool, bool, bool, const uint8
_t*, size_t)':
C:/Qt/webkit/Source/WebCore/Modules/websockets/WebSocketFrame.cpp:175:7: error: class 'WebCore::WebSocketFrame' does not have any field named 'z_compress'
  175 |     , compress(compress)

It looks like zlib.h has some #defines that override inflate and compress keywords, but why the hell
zlib is included here?
How this "derived-sources" mechanism work?

lets say this file, where the macro expands and messes up:
C:/Qt/webkit/Source/WebCore/layout/formattingContexts/inline/InlineRect.h

has no references to anything in:
C:\Qt\webkit\build-win\WebCore\DerivedSources\unified-sources\UnifiedSource-3a52ce78-88.cpp

and this unified-sources has no mention of "InlineRect.h"?

so how "InlineRect.h" is able to find "zlib.h"?

@quarcko
Copy link
Author

quarcko commented Feb 22, 2024

OK, so the actual problem was tha CMAKE for some reason included ZLIB from QT:
C:/Qt/Qt6.5.3/6.5.3/mingw_64/include/QtZlib/zlib.h

temporarily i just rename 'QtZlib' directory and compilation goes happily further. But thats not solution

HELP: How to tell CMAKE not to search for QtZlib?

@aquiles2k
Copy link

I had something loosely similar with my issue with macro WTF_MAKE_FAST_ALLOCATED which needed me to add include for wtf/FastMalloc.h I have no clue how this worked in normal WebKit without the include.

Anyway, doesn't qt config has a option for zlib handling? like -qt-zlib or -system-zlib

See https://doc.qt.io/qt-6/configure-options.html

@aquiles2k
Copy link

aquiles2k commented Feb 22, 2024

And in cmake, can't you just redefine the variables like ZLIB_INCLUDE_DIR / ZLIB_LIBRARY_RELEASE? Search the CMakeCache.txt for actual names.

@quarcko
Copy link
Author

quarcko commented Feb 22, 2024

Yes, i have these variables set, that's why compilation goes OK if i rename QtZlib dir.
The problem is that cmake from somewhere added one more variable:

Qt6ZlibPrivate_DIR C:/Qt/Qt6.5.3/6.5.3/mingw_64/lib/cmake/Qt6ZlibPrivate

and it gets priority as i understant from where #include <zlib.h> is taken..

probably my pre-compiled QT 6.5.3 is configured wit -qt-zlib
but is it possible to override this just for WebKit compilation?

@quarcko
Copy link
Author

quarcko commented Feb 22, 2024

QT6-WEBKIT-MINGW

@quarcko
Copy link
Author

quarcko commented Feb 22, 2024

Yeah, but it freezes...
If i disable JavaScript - then it loads this landing page OK, but freezes on search
tried other websites - some of them load without fonts, some of them also crash.
JavaScript mouse tester actually loaded and worked all right..

so all in all, don't know what to do next, does not feel very usable atm.

@quarcko
Copy link
Author

quarcko commented Feb 22, 2024

Hmm, it seems that it has something to do with this message right before the freeze:

warning: LauncherApplication::exec: Must be called from the main thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants