Bug 217128 - [GTK] Build broken with ENABLE_MEDIA_STREAM enabled and ENABLE_WEB_RTC_DISABLED
Summary: [GTK] Build broken with ENABLE_MEDIA_STREAM enabled and ENABLE_WEB_RTC_DISABLED
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-30 09:12 PDT by Joe
Modified: 2020-10-03 14:32 PDT (History)
16 users (show)

See Also:


Attachments
Patch (3.07 KB, patch)
2020-10-02 06:37 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff
Patch for landing (3.12 KB, patch)
2020-10-02 07:55 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff
Patch (20.87 KB, patch)
2020-10-02 15:28 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff
Patch for landing (20.92 KB, patch)
2020-10-03 13:18 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe 2020-09-30 09:12:51 PDT
Hi guys,
I have a problem with compilation of the WebkitGTK.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:        19.10
Codename:       eoan

wget https://webkitgtk.org/releases/webkitgtk-2.30.1.tar.xz

because ThirdParty folder is missing libwebrtc lib I downloaded current git version : https://github.com/WebKit/webkit
and copy from there libwebrtc to ThirdParty folder.

next

cmake .. -DPORT="GTK" -DCMAKE_CXX_COMPILER=clang++-9 -DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_FLAGS="-fsanitize=address" -DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_BUILD_TYPE=Release -DUSE_WPE_RENDERER=OFF -DENABLE_MINIBROWSER=ON -DENABLE_BUBBLEWRAP_SANDBOX=OFF -DENABLE_MEDIA_SOURCE=OFF -DCMAKE_SKIP_RPATH=ON -DUSE_OPENJPEG=OFF -DENABLE_GTKDOC=OFF -DCMAKE_INSTALL_PREFIX=. -DLIB_INSTALL_DIR=./lib -DENABLE_MEDIA_STREAM=ON -DENABLE_WEB_AUDIO=ON

make -j 1


------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[ 52%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp.o
In file included from /home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:26:
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:50:50: error: expected class name
class LibWebRTCDataChannelHandler final : public RTCDataChannelHandler, private webrtc::DataChannelObserver {
                                                 ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:57:12: error: no template named 'Ref'
    static Ref<RTCDataChannelEvent> channelEvent(Document&, rtc::scoped_refptr<webrtc::DataChannelInterface>&&);
           ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:61:50: error: only virtual member functions can be marked 'final'
    void setClient(RTCDataChannelHandlerClient&) final;
                                                 ^~~~~
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:63:31: error: unknown type name 'CString'
    bool sendStringData(const CString&) final;
                              ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:64:43: error: only virtual member functions can be marked 'final'
    bool sendRawData(const char*, size_t) final;
                                          ^~~~~
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:65:18: error: only virtual member functions can be marked 'final'
    void close() final;
                 ^~~~~
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:40:16: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
    if (options.ordered)
               ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:41:32: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
        init.ordered = *options.ordered;
                               ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:42:16: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
    if (options.maxPacketLifeTime)
               ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:43:42: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
        init.maxRetransmitTime = *options.maxPacketLifeTime;
                                         ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:44:16: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
    if (options.maxRetransmits)
               ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:45:39: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
        init.maxRetransmits = *options.maxRetransmits;
                                      ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:46:28: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
    init.protocol = options.protocol.utf8().data();
                           ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:47:16: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
    if (options.negotiated)
               ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:48:35: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
        init.negotiated = *options.negotiated;
                                  ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:49:16: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
    if (options.id)
               ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:50:27: error: member access into incomplete type 'const WebCore::RTCDataChannelInit'
        init.id = *options.id;
                          ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:64:24: error: variable has incomplete type 'WebCore::RTCDataChannelInit'
    RTCDataChannelInit init;
                       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: forward declaration of 'WebCore::RTCDataChannelInit'
struct RTCDataChannelInit;
       ^
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:73:20: error: use of undeclared identifier 'RTCDataChannel'; did you mean 'RTCDataChannelInit'?
    auto channel = RTCDataChannel::create(document, WTFMove(handler), fromStdString(label), WTFMove(init));
                   ^~~~~~~~~~~~~~
                   RTCDataChannelInit
/home/joe/tools/fuzzing/browsers/WebKit/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:47:8: note: 'RTCDataChannelInit' declared here
struct RTCDataChannelInit;
       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [Source/WebCore/CMakeFiles/WebCore.dir/build.make:877: Source/WebCore/CMakeFiles/WebCore.dir/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1360: Source/WebCore/CMakeFiles/WebCore.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

any ideas ?

Thanks
Comment 1 Adrian Perez 2020-10-01 13:08:37 PDT
Hello Joe! We do not support building WebKitGTK with WebRTC support
enabled using tarballs—it's more complicated than copying the libwebrtc/
subdirectory. If you want to do such a build, I recommend you to make
a checkout of the 2.30.1 tag from the Subversion repository and use
that for the build:

  svn checkout \
    https://trac.webkit.org/browser/webkit/releases/WebKitGTK/webkit-2.30.1 \
    webkitgtk-2.30.1

(Be patient, this can take quite some time.)

*VERY* important: be aware that if you build WebKitGTK with WebRTC enabled
you must not link any program licensed under the GPL with that build,
because the libwebrtc license is incompatible with the GPL. This is one
of the reasons why we don't support building the WebRTC support from
tarballs, to avoid letting people accidentally end up with licensing
trouble.
Comment 2 Adrian Perez 2020-10-01 23:54:58 PDT
Closed, as this is not a bug by itself.

Joe: I hope my previous comment helps you out, feel free to ask
more questions, and remember that you can also ask in the Freenode
#webkitgtk channel :)
Comment 3 Joe 2020-10-01 23:58:22 PDT
Thanks mate ;) 
Do you guys have something less old school to contact with you ? Like Discord channel ?
Comment 4 Joe 2020-10-02 01:09:16 PDT
BTW:

svn checkout https://trac.webkit.org/browser/webkit/releases/WebKitGTK/webkit-2.30.1

svn: E170013: Unable to connect to a repository at URL 'https://trac.webkit.org/browser/webkit/releases/WebKitGTK/webkit-2.30.1'
svn: E130005: XML Parsing failed: Unexpected root element 'html'
Comment 5 Adrian Perez 2020-10-02 01:11:18 PDT
(In reply to Joe from comment #4)
> BTW:
> 
> svn checkout
> https://trac.webkit.org/browser/webkit/releases/WebKitGTK/webkit-2.30.1
> 
> svn: E170013: Unable to connect to a repository at URL
> 'https://trac.webkit.org/browser/webkit/releases/WebKitGTK/webkit-2.30.1'
> svn: E130005: XML Parsing failed: Unexpected root element 'html'

Ouch, sorry about that. I shared the Trac URL instead of the one for
the Subversion repository, it should be:

  https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.30.1
Comment 6 Adrian Perez 2020-10-02 01:15:02 PDT
(In reply to Joe from comment #3)
> Thanks mate ;) 
> Do you guys have something less old school to contact with you ? Like
> Discord channel ?

We have a... mailing list:

  https://lists.webkit.org/mailman/listinfo/webkit-gtk

There is also a Slack instance, you can find it linked from the “Getting
Started” page of the website:

  https://webkit.org/getting-started/#staying-in-touch

For questions related to WebKitGTK there is a #gtk channel there as well.
Comment 7 Joe 2020-10-02 04:38:34 PDT
Great, thank you.
Comment 8 Adrian Perez 2020-10-02 06:01:36 PDT
Chatting on Slack it is clearer that there is an issue here: we want
a build with “-DENABLE_MEDIA_STREAM=ON -DENABLE_WEB_RTC=OFF” but then
the build fails because enabling MEDIA_STREAM will try to use some
libwebrtc types.
Comment 9 Adrian Perez 2020-10-02 06:03:27 PDT
Edited the bug title to make it clearer, and added the [GTK] tag.
Probably the issue affects the WPE port as well, I'll check and
add the tag later on if that is the case.
Comment 10 Adrian Perez 2020-10-02 06:06:25 PDT
For the record, I can reproduce this in trunk, so I will make a patch
for that first and then we can backport it to the 2.30.x branch to be
included in the next stable release :)
Comment 11 Adrian Perez 2020-10-02 06:37:16 PDT
Created attachment 410319 [details]
Patch
Comment 12 Philippe Normand 2020-10-02 06:55:51 PDT
Comment on attachment 410319 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=410319&action=review

> ChangeLog:10
> +        build code that ises libwebrtc types when ENABLE_WEB_RTC is disabled but

typo: ises
Comment 13 Adrian Perez 2020-10-02 07:55:43 PDT
Created attachment 410323 [details]
Patch for landing
Comment 14 EWS 2020-10-02 08:54:53 PDT
Committed r267882: <https://trac.webkit.org/changeset/267882>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410323 [details].
Comment 15 Adrian Perez 2020-10-02 14:21:27 PDT
It's still possible to get the following:

In file included from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-44.cpp:5:
../Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp: In static member function ‘static WebCore::CaptureSourceOrError WebCore::MockRealtimeAudioSource::create(WTF::String&&, WTF::String&&, WTF::String&&, const WebCore::MediaConstraints*)’:
../Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp:57:108: error: invalid new-expression of abstract class type ‘WebCore::MockRealtimeAudioSource’
   57 |     auto source = adoptRef(*new MockRealtimeAudioSource(WTFMove(deviceID), WTFMove(name), WTFMove(hashSalt)));
      |                                                                                                            ^
In file included from ../Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp:32,
                 from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-44.cpp:5:
../Source/WebCore/platform/mock/MockRealtimeAudioSource.h:43:7: note:   because the following virtual functions are pure within ‘WebCore::MockRealtimeAudioSource’:
   43 | class MockRealtimeAudioSource : public RealtimeMediaSource {
      |       ^~~~~~~~~~~~~~~~~~~~~~~
../Source/WebCore/platform/mock/MockRealtimeAudioSource.h:53:18: note:     ‘virtual void WebCore::MockRealtimeAudioSource::render(WTF::Seconds)’
   53 |     virtual void render(Seconds) = 0;
      |                  ^~~~~~
In file included from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-44.cpp:7:
../Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp: In static member function ‘static WebCore::CaptureSourceOrError WebCore::MockRealtimeVideoSource::create(WTF::String&&, WTF::String&&, WTF::String&&, const WebCore::MediaConstraints*)’:
../Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp:62:108: error: invalid new-expression of abstract class type ‘WebCore::MockRealtimeVideoSource’
   62 |     auto source = adoptRef(*new MockRealtimeVideoSource(WTFMove(deviceID), WTFMove(name), WTFMove(hashSalt)));
      |                                                                                                            ^
In file included from ../Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h:34,
                 from ../Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp:39,
                 from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-44.cpp:5:
../Source/WebCore/platform/mock/MockRealtimeVideoSource.h:49:7: note:   because the following virtual functions are pure within ‘WebCore::MockRealtimeVideoSource’:
   49 | class MockRealtimeVideoSource : public RealtimeVideoCaptureSource, private OrientationNotifier::Observer {
      |       ^~~~~~~~~~~~~~~~~~~~~~~
../Source/WebCore/platform/mock/MockRealtimeVideoSource.h:58:18: note:     ‘virtual void WebCore::MockRealtimeVideoSource::updateSampleBuffer()’
   58 |     virtual void updateSampleBuffer() = 0;
      |                  ^~~~~~~~~~~~~~~~~~
Comment 16 Adrian Perez 2020-10-02 15:28:37 PDT
Created attachment 410380 [details]
Patch
Comment 17 Philippe Normand 2020-10-03 01:45:53 PDT
Comment on attachment 410380 [details]
Patch

../../Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:30:50: error: ‘LibWebRTCAudioFormat’ has not been declared
Comment 18 Adrian Perez 2020-10-03 13:18:02 PDT
Created attachment 410436 [details]
Patch for landing
Comment 19 EWS 2020-10-03 14:32:50 PDT
Committed r267934: <https://trac.webkit.org/changeset/267934>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410436 [details].