Bug 241483

Summary: [CMake] Fix GStreamer include path when cross compiling
Product: WebKit Reporter: Pablo Saavedra <psaavedra>
Component: CMakeAssignee: Pablo Saavedra <psaavedra>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, pnormand
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

Description Pablo Saavedra 2022-06-09 13:24:17 PDT
Set the full path of the gstreamer components using find_path().
Comment 1 Pablo Saavedra 2022-06-09 13:27:36 PDT
The cmake rule for set the include dir for the gstreamer components assumes a non cross toolchain environment. That results in poison system directories when WebKit is built using such kind of toolchains: 

... -isystem /usr/include/gstreamer-1.0 -isystem /tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/recipe-sysroot/usr/include/gstreamer-1.0 


e.g:

cc1plus: warning: include location "/usr/include/gstreamer-1.0" is unsafe for cross-compilation [-Wpoison-system-directories]


cc1plus: error: include location "/usr/include/gstreamer-1.0" is unsafe for cross-compilation [-Werror=poison-system-directories]


"MOC_INCLUDES" :
[
    "/tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/recipe-sysroot/usr/lib/glib-2.0/include",
    "/tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/recipe-sysroot/usr/include/libsoup-2.4",
    "/usr/include/gstreamer-1.0",
    "/tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/recipe-sysroot/usr/include/gstreamer-1.0",
    "/tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/recipe-sysroot/usr/include/orc-0.4",
    "/tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/wpewebkit-2.36.3",
    "/tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/recipe-sysroot/usr/include/cairo",
    "/tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/recipe-sysroot/usr/include/freetype2",
    "/tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/recipe-sysroot/usr/include/harfbuzz",
    "/tmp/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit/2.36.3-r0/recipe-sysroot/usr/include/wpe-1.0",
]
Comment 2 Pablo Saavedra 2022-06-09 13:33:30 PDT
Pull request: https://github.com/WebKit/WebKit/pull/1428
Comment 3 Philippe Normand 2022-06-10 00:15:13 PDT
We've been cross-compiling this for years in Yocto. Did they change something recently?
Comment 4 Pablo Saavedra 2022-06-14 01:44:17 PDT
(In reply to Philippe Normand from comment #3)
> We've been cross-compiling this for years in Yocto. Did they change
> something recently?

I haven't identified the specific change but this started to fail in kirkstone Yocto release. For example, the build still works. The reason why this is happening now is because the command line for cc to build the QT plugin uses -Werror=poison-system-directories.
Comment 5 Pablo Saavedra 2022-06-14 05:06:35 PDT
(In reply to Pablo Saavedra from comment #4)
> (In reply to Philippe Normand from comment #3)
> > We've been cross-compiling this for years in Yocto. Did they change
> > something recently?
> 
> I haven't identified the specific change but this started to fail in
> kirkstone Yocto release. For example, the build still works. The reason why
> this is happening now is because the command line for cc to build the QT
> plugin uses -Werror=poison-system-directories.


That `-Werror=poison-system-directories` option was already there for a while (2020) in Yocto. What  changed is the includes  (-I) are being resolved. In honister they are being resolved fine. Now I have doubts if this change in the behavior is consequence of a update in cmake ,  in binutils  or similar.
Comment 6 EWS 2022-06-27 16:57:11 PDT
Committed 251895@main (25efd1478b48): <https://commits.webkit.org/251895@main>

Reviewed commits have been landed. Closing PR #1428 and removing active labels.