Bug 294669
| Summary: | [WPE] Error building WPE | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Miguel Gomez <magomez> |
| Component: | WPE WebKit | Assignee: | Miguel Gomez <magomez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bugs-noreply, mcatanzaro |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Miguel Gomez
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Michael Catanzaro
(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
(In this case, it needs to be added to LibWebRTCDataChannelHandler.cpp.)
Michael Catanzaro
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
> 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
Pull request: https://github.com/WebKit/WebKit/pull/46901
Miguel Gomez
(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
Committed 296372@main (07ac28984f00): <https://commits.webkit.org/296372@main>
Reviewed commits have been landed. Closing PR #46901 and removing active labels.