<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>254976</bug_id>
          
          <creation_ts>2023-04-04 00:20:18 -0700</creation_ts>
          <short_desc>m_displayForCompositing used when PLATFORM(GTK) but declared only when PLATFORM(WAYLAND)</short_desc>
          <delta_ts>2023-04-15 01:26:33 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>252988</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="gabriele balducci">balducci</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1946454</commentid>
    <comment_count>0</comment_count>
    <who name="gabriele balducci">balducci</who>
    <bug_when>2023-04-04 00:20:18 -0700</bug_when>
    <thetext>hello

running on linux (specs enclosed below)

While building 2.41.1  with the configuration:

    ----8&lt;----
    -DPORT=GTK
    -DCMAKE_BUILD_TYPE=Release
    -DENABLE_CREDENTIAL_STORAGE=OFF
    -DENABLE_GEOLOCATION=OFF
    -DUSE_LIBNOTIFY=OFF
    -DUSE_LIBHYPHEN=OFF
    -DENABLE_FTL_JIT=ON
    -DUSE_WOFF2=OFF
    -DENABLE_JIT=ON
    -DUSE_OPENJPEG:BOOL=OFF
    -DUSE_WPE_RENDERER:BOOL=OFF
    -DENABLE_BUBBLEWRAP_SANDBOX=OFF
    -DUSE_SYSTEMD=OFF
    -DENABLE_GAMEPAD=OFF
    -DUSE_LD_GOLD:BOOL=OFF
    -DUSE_SOUP2=OFF
    -DENABLE_JOURNALD_LOG=OFF
    -DENABLE_WAYLAND_TARGET=OFF
    -DUSE_AVIF=OFF
    ----&gt;8----

got:

    ----8&lt;----
    FAILED: Source/WebKit/CMakeFiles/WebKit.dir/__/__/DerivedSources/WebKit/unified-sources/UnifiedSource-54928a2b-43.cpp.o 
    /usr/bin/g++  -m64 -DBUILDING_GTK__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBUILDING_WebKit -DDATADIR=\&quot;/opt/stow.d/versions/webkitgtk-2.41.1/usr/share\&quot; -DGETTEXT_PACKAGE=\&quot;WebKitGTK-4.1\&quot;
    [...huge number of includes and other g++ options...]
    -MF Source/WebKit/CMakeFiles/WebKit.dir/__/__/DerivedSources/WebKit/unified-sources/UnifiedSource-54928a2b-43.cpp.o.d -o Source/WebKit/CMakeFiles/WebKit.dir/__/__/DerivedSources/WebKit/unified-sources/UnifiedSource-54928a2b-43.cpp.o -c /home/balducci/tmp/install-us-d/webkitgtk-2.41.1.d/webkitgtk-2.41.1/.build/DerivedSources/WebKit/unified-sources/UnifiedSource-54928a2b-43.cpp
    In file included from /home/balducci/tmp/install-us-d/webkitgtk-2.41.1.d/webkitgtk-2.41.1/.build/DerivedSources/WebKit/unified-sources/UnifiedSource-54928a2b-43.cpp:5:
    /home/balducci/tmp/install-us-d/webkitgtk-2.41.1.d/webkitgtk-2.41.1/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp: In member function ‘void WebKit::WebProcess::platformInitializeWebProcess(WebKit::WebProcessCreationParameters&amp;)’:
    /home/balducci/tmp/install-us-d/webkitgtk-2.41.1.d/webkitgtk-2.41.1/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp:128:9: error: ‘m_displayForCompositing’ was not declared in this scope
      128 |         m_displayForCompositing = WebCore::PlatformDisplayHeadless::create();
          |         ^~~~~~~~~~~~~~~~~~~~~~~
    ----&gt;8----

m_displayForCompositing is declared in WebProcess.h, but only when
PLATFORM(WAYLAND):

    ----8&lt;----
    #if PLATFORM(WAYLAND)
        std::unique_ptr&lt;WebCore::PlatformDisplay&gt; m_displayForCompositing;
    #endif
    ----&gt;8----

where in WebProcessGLib.cpp I find:

    ----8&lt;----
    #if PLATFORM(GTK) &amp;&amp; USE(EGL)
        if (parameters.useDMABufSurfaceForCompositing)
            m_displayForCompositing = WebCore::PlatformDisplayHeadless::create();
    #endif
    ----&gt;8----

Trying to force declaration of m_displayForCompositing in WebProcess.h with:
    ----8&lt;----
    #if PLATFORM(WAYLAND) || PLATFORM(GTK)
        std::unique_ptr&lt;WebCore::PlatformDisplay&gt; m_displayForCompositing;
    #endif
    ----&gt;8----

passes the above _failure, but then I get other _errors
(unfortunately I did not collect them)

The only way I could fix the build was to comment the use of
m_displayForCompositing alltogether (but, of course, I don&apos;t know if
this is an acceptable workaround)

thanks for any hint/help

ciao
-gabriele


===========================================================================

tmpsh:20&gt; uname -srvmo
Linux 6.2.8 #1 SMP Thu Mar 23 07:58:54 CET 2023 x86_64 GNU/Linux

install:1023&gt; gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/stow.d/versions/gcc-12.2.0/usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/balducci/tmp/install-us-d/gcc-12.2.0.d/gcc-12.2.0/configure --prefix=/opt/stow.d/versions/gcc-12.2.0/usr --libdir=/opt/stow.d/versions/gcc-12.2.0/usr/lib64 --libexecdir=/opt/stow.d/versions/gcc-12.2.0/usr/lib64 --enable-shared --disable-bootstrap --enable-languages=c,c++,objc,fortran --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (GCC) 

install:1024&gt; cmake --version
cmake version 3.26.2


tmpsh:24&gt; ninja --version
1.11.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1948949</commentid>
    <comment_count>1</comment_count>
    <who name="gabriele balducci">balducci</who>
    <bug_when>2023-04-15 01:26:33 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 252988 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>