Bug 174940

Summary: [GTK] Building with ENABLE_VIDEO=OFF fails
Product: WebKit Reporter: Adrian Perez <aperez>
Component: WebKitGTKAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, aestes, bburg, beidson, bugs-noreply, cgarcia, commit-queue
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Linux   
Attachments:
Description Flags
Patch none

Description Adrian Perez 2017-07-28 09:39:32 PDT
This issue was reported in the Buildroot mailing list, it happens with
the latest releases (at least 2.16.5 and 2.16.6), and also with “trunk”.
The error is:

  /home/peko/buildroot/output/build/webkitgtk-2.16.5/DerivedSources/WebCore/JSWebGLRenderingContextBase.cpp:3100:207:   required from here
  /home/peko/buildroot/output/build/webkitgtk-2.16.5/Source/WTF/wtf/PassRefPtr.h:40:13: error: invalid use of incomplete type ‘class WebCore::HTMLVideoElement’
               ptr->deref();
               ^
  In file included from /home/peko/buildroot/output/build/webkitgtk-2.16.5/Source/WebCore/html/canvas/WebGLRenderingContextBase.h:32:0,
                   from /home/peko/buildroot/output/build/webkitgtk-2.16.5/DerivedSources/WebCore/JSWebGLRenderingContextBase.h:26,
                   from /home/peko/buildroot/output/build/webkitgtk-2.16.5/DerivedSources/WebCore/JSWebGLRenderingContextBase.cpp:25:
  /home/peko/buildroot/output/build/webkitgtk-2.16.5/Source/WebCore/html/canvas/CanvasRenderingContext.h:40:7: note: forward declaration of ‘class WebCore::HTMLVideoElement’
   class HTMLVideoElement;
         ^

Original report: http://lists.busybox.net/pipermail/buildroot/2017-July/198467.html
Comment 1 Adrian Perez 2017-07-28 09:41:20 PDT
I looked a bit into this, and it's caused because MEDIA_STREAM is
enabled anyway, and it tries to use the definition of HTMLVideoElement,
which is guarded by ENABLE(VIDEO).

This is due to a missing feature dependency in the CMake build files.
We need to add:

  WEBKIT_OPTION_DEPEND(ENABLE_MEDIA_STREAM ENABLE_VIDEO)

I'll be submitting a patch.
Comment 2 Adrian Perez 2017-07-28 09:46:29 PDT
A test build with of “trunk” with “-DENABLE_MEDIA_STREAM=OFF” failed with:

  ../../Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:25:10: fatal error: gst/gst.h: No such file or directory
   #include <gst/gst.h>
            ^~~~~~~~~~~

If all of “-DENABLE_VIDEO=OFF”, “-DENABLE_WEB_AUDIO=OFF” and
“-DENABLE_MEDIA_STREAM=OFF” is passed, then GStreamer is not needed,
and no GStreamer flags are queried using “pkg-config”. Which results in
the header not found. I think in this case we would want to guard the
use of GStreamer in the tests as well, so I'll add that to the patch.
Comment 3 Adrian Perez 2017-07-28 09:55:02 PDT
Created attachment 316646 [details]
Patch
Comment 4 WebKit Commit Bot 2017-07-28 11:07:03 PDT
Comment on attachment 316646 [details]
Patch

Clearing flags on attachment: 316646

Committed r220007: <http://trac.webkit.org/changeset/220007>
Comment 5 WebKit Commit Bot 2017-07-28 11:07:05 PDT
All reviewed patches have been landed.  Closing bug.