RESOLVED FIXED294669
[WPE] Error building WPE
https://bugs.webkit.org/show_bug.cgi?id=294669
Summary [WPE] Error building WPE
Miguel Gomez
Reported 2025-06-18 04:03:58 PDT
I was only able to reproduce this while building with libwebrtc enabled, but I think it can happen with other features as well, as I think it's an unified build error. The error is like this: In file included from /host/home/magomez/webkit/WebKit/Source/WebCore/dom/ActiveDOMObject.h:29, from /host/home/magomez/webkit/WebKit/Source/WebCore/Modules/mediastream/RTCDataChannel.h:30, from /host/home/magomez/webkit/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:32, from /host/home/magomez/webkit/WebKit/WebKitBuild/WPE/Release/WebCore/DerivedSources/unified-sources/UnifiedSource-f8afad56-36.cpp:8: /host/home/magomez/webkit/WebKit/Source/WebCore/dom/ContextDestructionObserver.h:40:36: error: inline function ‘WebCore::ScriptExecutionContext* WebCore::ContextDestructionObserver::scriptExecutionContext() const’ used but never defined [-Werror] 40 | inline ScriptExecutionContext* scriptExecutionContext() const; // Defined in ContextDestructionObserverInlines.h. | ^~~~~~~~~~~~~~~~~~~~~~ The problem seems to be that ContextDestructionObserver::scriptExecutionContext() is declared in ContextDestructionObserver.h but the definition is in ContextDestructionObserverInlines.h, which may or may not have been included in the build then ContextDestructionObserver.h is processed. When enabling libwebrtc, there are a couple of source files that end up including ActiveDOMCallback.h and ActiveDOMObject.h, which include ContextDestructionObserver.h, but no one seems to have included the inlines, so the funcion definition is missing. Changing ActiveDOMCallback.h and ActiveDOMObject.h to include ContextDestructionObserverInlines.h (which includes ContextDestructionObserver.h) fixes the problem, but I have doubts about whether that's the proper fix.
Attachments
Michael Catanzaro
Comment 1 2025-06-18 05:31:06 PDT
(In reply to Miguel Gomez from comment #0) > Changing ActiveDOMCallback.h and ActiveDOMObject.h to include > ContextDestructionObserverInlines.h (which includes > ContextDestructionObserver.h) fixes the problem, but I have doubts about > whether that's the proper fix. Style checker will complain. The Inlines.h headers are only allowed to be included in .cpp files, not in other .h files. You'll just have to keep adding it to .cpp files until the build eventually succeeds. It's frustrating, but the goal is to cut down on build time.
Michael Catanzaro
Comment 2 2025-06-18 05:35:16 PDT
(In this case, it needs to be added to LibWebRTCDataChannelHandler.cpp.)
Michael Catanzaro
Comment 3 2025-06-18 05:36:04 PDT
And occasionally you might need to move usages from header files into source files to make this work. 295631@main contains an example for this same function.
Miguel Gomez
Comment 4 2025-06-18 05:37:57 PDT
> Style checker will complain. The Inlines.h headers are only allowed to be > included in .cpp files, not in other .h files. You'll just have to keep > adding it to .cpp files until the build eventually succeeds. It's > frustrating, but the goal is to cut down on build time. Yeah, just found about it while trying a different patch. Fortunately adding the include to a couple of cpp files is enough. I'll upload a patch in a moment.
Miguel Gomez
Comment 5 2025-06-18 05:41:05 PDT
Miguel Gomez
Comment 6 2025-06-18 05:42:54 PDT
(In reply to Michael Catanzaro from comment #3) > And occasionally you might need to move usages from header files into source > files to make this work. 295631@main contains an example for this same > function. Thanks for the hint Michael! :)
EWS
Comment 7 2025-06-18 06:53:24 PDT
Committed 296372@main (07ac28984f00): <https://commits.webkit.org/296372@main> Reviewed commits have been landed. Closing PR #46901 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.