Summary: | [GTK] ANGLE's eglplatform.h is build broken with -DENABLE_X11_PLATFORM=OFF | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> | ||||||||
Component: | WebKitGTK | Assignee: | Adrian Perez <aperez> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | annulen, aperez, bugs-noreply, cgarcia, commit-queue, dino, don.olmstead, ews-watchlist, graouts, gyuyoung.kim, kondapallykalyan, mcatanzaro, rakuco, ryuan.choi, sergio | ||||||||
Priority: | P2 | ||||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | PC | ||||||||||
OS: | Linux | ||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=197676 | ||||||||||
Attachments: |
|
Description
Michael Catanzaro
2019-06-06 13:14:55 PDT
The update to ANGLE done in r245155 has re-imported a version of the “eglplatform.h” from the upstream sources which is missing the needed definitions for Wayland. That revision has this part in the diff: -#elif defined(WL_EGL_PLATFORM) - -typedef struct wl_display *EGLNativeDisplayType; -typedef struct wl_egl_pixmap *EGLNativePixmapType; -typedef struct wl_egl_window *EGLNativeWindowType; - -#elif defined(__unix__) - -#if defined(ANGLE_USE_X11) && !defined(MESA_EGL_NO_X11_HEADERS) +#elif defined(__unix__) || defined(USE_X11) …which is what caused the problem. I will check a bit more thoroughly the changes introduced in r245155 before making a patch to re-enable building without X11. Hm, so this works because we only use GLX and never use EGL at all in the X11 codepath? Checking the code pre-r245155, I don't see any Wayland-related changes in the changes.diff. Remember when editing ANGLE that your changes will be lost in the next update if you don't also update the changes.diff. (In reply to Michael Catanzaro from comment #3) > Checking the code pre-r245155, I don't see any Wayland-related changes in > the changes.diff. Remember when editing ANGLE that your changes will be lost > in the next update if you don't also update the changes.diff. In bug #189844 there was a fix for yet one more instance of this issue, and in that case I did update “changes.diff” — I wonder when did they get lost afterwards. Anyway, I will make a new patch for this tomorrow. Ouch, I ended up dropping the ball on this one. I'll get to it now because we need this fixed to import 2.26.x into Buildroot (where non-X11 builds are common). Created attachment 379129 [details]
Patch
Note that there are important steps to take when updating ANGLE. See http://trac.webkit.org/wiki/UpdatingANGLE (In reply to Adrian Perez from comment #6) > Created attachment 379129 [details] > Patch This approach avoids needing to do modifications in ANGLE, which makes it much less likely to re-introduce this kind of build issues whenever a new version of ANGLE is imported into the tree. Comment on attachment 379129 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379129&action=review > Source/ThirdParty/ANGLE/PlatformGTK.cmake:8 > +if (ENABLE_WAYLAND_TARGET) > + # Explicitly prefer the Wayland platform, otherwise if we are building > + # in a system without X11 ANGLE will still try to use the X11 headers. > + list(APPEND ANGLE_DEFINITIONS WL_EGL_PLATFORM) > +elseif (NOT ENABLE_X11_TARGET) what happens when we build with both x11 and wayland targets enabled? (In reply to Carlos Garcia Campos from comment #9) > Comment on attachment 379129 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=379129&action=review > > > Source/ThirdParty/ANGLE/PlatformGTK.cmake:8 > > +if (ENABLE_WAYLAND_TARGET) > > + # Explicitly prefer the Wayland platform, otherwise if we are building > > + # in a system without X11 ANGLE will still try to use the X11 headers. > > + list(APPEND ANGLE_DEFINITIONS WL_EGL_PLATFORM) > > +elseif (NOT ENABLE_X11_TARGET) > > what happens when we build with both x11 and wayland targets enabled? In that case ANGLE_USE_X11 is defined and the X11 headers are used by ANGLE's “eglplatform.h” header — that is the current behaviour already when building with support for both Wayland and X11. Comment on attachment 379129 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379129&action=review >>> Source/ThirdParty/ANGLE/PlatformGTK.cmake:8 >>> +elseif (NOT ENABLE_X11_TARGET) >> >> what happens when we build with both x11 and wayland targets enabled? > > In that case ANGLE_USE_X11 is defined and the X11 headers are used > by ANGLE's “eglplatform.h” header — that is the current behaviour > already when building with support for both Wayland and X11. Please, add a comment here explaining why x11 is not broken even if the wayland define is set unconditionally when building with both targets enabled. Created attachment 379444 [details]
Patch
As per a chat with Carlos García, updated to use WL_EGL_PLATFORM if only
Wayland is enabled (and X11 is disabled), plus a comment clarifying why
a Wayland+X11 build works even if only one version of the EGL types is
used.
Created attachment 379446 [details]
Patch for landing
Comment on attachment 379446 [details] Patch for landing Clearing flags on attachment: 379446 Committed r250298: <https://trac.webkit.org/changeset/250298> All reviewed patches have been landed. Closing bug. |