I got webkit newest code with svn, then try to build it follow instructions on this page: http://trac.webkit.org/wiki/BuildingGtk When I run Tools/Scripts/build-webkit --gtk, There is an error: ../../Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp:43:22: fatal error: cairo-gl.h: No such file or directory and I found these two file named cairo-gl.h under webkit directory: ./WebKitBuild/Dependencies/Source/cairo-1.12.8/src/cairo-gl.h ./WebKitBuild/Dependencies/Root/include/cairo/cairo-gl.h I add "WebKitBuild/Dependencies/Root/include/cairo" to Source/WebCore/PlatformGTK.cmake, then build continue.
I'm seeing the same problem.
(In reply to comment #0) > ../../Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp:43:22: fatal error: cairo-gl.h: No such file or directory > I add "WebKitBuild/Dependencies/Root/include/cairo" to Source/WebCore/PlatformGTK.cmake, then build continue. This should not be necessary because that should be already in CAIRO_INCLUDE_DIRS. Can you see what's the value of CAIRO_INCLUDE_DIRS in WebKitBuild/Release/CMakeCache.txt ? Thanks!
Same here. CAIRO_INCLUDE_DIRS:PATH=/usr/include/cairo
(In reply to comment #3) > Same here. > > CAIRO_INCLUDE_DIRS:PATH=/usr/include/cairo And do you have /usr/include/cairo/cairo-gl.h installed?
Seeing the same CAIRO_INCLUDE_DIRS. No cairo-gl.h in /usr/include/cairo
(In reply to comment #5) > Seeing the same CAIRO_INCLUDE_DIRS. No cairo-gl.h in /usr/include/cairo Ok, there's a couple of things here. 1) You don't seem to have cairo-gl installed in your system. What distro are you using? This is not so important. 2) WebKit does not seem to find the version of cairo-gl installed under WebKitBuild/Dependencies/. Can you try this? $ Tools/jhbuild/jhbuild-wrapper --gtk run pkg-config --cflags cairo-gl
I'm using Ubuntu 14.04, and can't really find a cairo-gl package... I'm trying what you suggested. Will report back.
The pkg-config did not help
Ubuntu 14.04 as well. I'm running it on a VM. I compiled Cairo from source with --enable-gl --enable-flags --prefix=/usr and webkit compiles now. Shouldn't the configuration detect if the GL backend is there or not though?
The build should be using WebKitBuild/Dependencies/Root/include/cairo when including cairo-gl.h. That is the issue here. I'm not sure why that directory wasn't on the include path.
Perhaps you have a pre-existing CMakeCache.txt file when you built the JHBuild dependencies?
(In reply to comment #11) > Perhaps you have a pre-existing CMakeCache.txt file when you built > the JHBuild dependencies? That was my first thought too, but I think we tried this on IRC the other day and didn't help ... Yoav, what do you mean with "the pkg-config did not help"? That command is not going to fix anything by itself, but it should print the full path of the cairo headers in WebKitBuild/Dependencies/ if they are detected. If pkg-config shows WebKitBuild/Dependencies/Root/include/cairo, then remove WebKitBuild/Release and run "build-webkit --gtk" again. If after that CAIRO_INCLUDE_DIRS is still pointing to /usr/include/cairo then it would be a bug, because the version of Cairo inside WebKitBuild/Dependencies should be used before the one installed in /usr.
(In reply to comment #9) > Ubuntu 14.04 as well. I'm running it on a VM. I compiled Cairo > from source with --enable-gl --enable-flags --prefix=/usr and webkit > compiles now. Shouldn't the configuration detect if the GL backend > is there or not though? So if you don't have a GL-enabled Cairo, build-webkit doesn't complain during the configuration time but in the middle of the compilation, right? Is it what happened to you? If that's the case then yes, it seems like a bug.
Yeah I'm not sure what happened but I trashed the source and got a fresh copy and it compiled without a hitch. Go figure?? Thanks though.
(In reply to comment #14) > Yeah I'm not sure what happened but I trashed the source and got a fresh copy and it compiled without a hitch. Go figure?? > Thanks though. Yes, that is the case.
Getting a new copy worked for me as well (after disabling SUBTLE_CRYPTO because of https://bugs.webkit.org/show_bug.cgi?id=136158).
(In reply to comment #13) > So if you don't have a GL-enabled Cairo, build-webkit doesn't > complain during the configuration time but in the middle of the > compilation, right? Ok, I don't have much cmake-fu but I'm not sure if this code is really working: if (CAIRO_GL_FOUND) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS ON) else () WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS OFF) endif ()
So the plugin process is built with features enabled for the jhbuild deps apart from the gtk2 dep which isn't in jhbuild, that pulls in system-wide deps such as cairo. One workaround is to disable Accelerated 2d canvas for that part of the build. Like most features I don't think it's actually needed by the plugin process, are they?
(In reply to comment #18) > So the plugin process is built with features enabled for the jhbuild deps > apart from the gtk2 dep which isn't in jhbuild, that pulls in system-wide > deps such as cairo. > > One workaround is to disable Accelerated 2d canvas for that part of the > build. Like most features I don't think it's actually needed by the plugin > process, are they? I do not believe the plugin process needs accelerated 2D canvas.
We should fix this, webkit currently does not build in Debian (without the jhbuild) because of this, cairo is now built without gl support.
Ok, so the problem here doesn't seem to have anything to do with the plugin process, but with what I said in comment #17: We have this code to detect cairo-gl: if (CAIRO_GL_FOUND) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS ON) else () WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS OFF) endif () If cairo-gl is found then ENABLE_ACCELERATED_2D_CANVAS is ON and everything builds fine. If cairo-gl is not found then ENABLE_ACCELERATED_2D_CANVAS is OFF and everything builds fine as well. However, the build-webkit script sets ENABLE_ACCELERATED_2D_CANVAS to ON unconditionally in the GTK port (see FeatureList.pm), and the cmake code above does not override that setting if cairo-gl is not found. Hence, WebKit expects to find cairo-gl, which is not present, and the build fails. Debian does not ship cairo-gl lately (I don't know about other distros), that's why this error has popped up recently in my system. The workaround here is to invoke cmake directly or to pass --cmakeargs=-DENABLE_ACCELERATED_2D_CANVAS=OFF to build-webkit.
> Debian does not ship cairo-gl lately (I don't know about other > distros), that's why this error has popped up recently in my system. For sake of completeness: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765684#10
(In reply to comment #21) > However, the build-webkit script sets ENABLE_ACCELERATED_2D_CANVAS to > ON unconditionally in the GTK port (see FeatureList.pm), and the cmake > code above does not override that setting if cairo-gl is not found. Is Debian using build-webkit to build? That's really only meant for upstream development.
(In reply to comment #23) > Is Debian using build-webkit to build? That's really only meant for > upstream development. Right, this problem only appears if you use build-webkit, the Debian packaging is not affected by it, but people doing upstream development without using jhbuild will find this problem. I think one solution would be to make build-webkit fail immediately before compilation if ENABLE_ACCELERATED_2D_CANVAS is enabled but cairo-gl is not found. That way the user would be able to see what's going on.
Created attachment 242529 [details] Patch Something like this.
Created attachment 242530 [details] Patch This one is a bit better.
Committed r176787: <http://trac.webkit.org/changeset/176787>
(In reply to comment #0) > I got webkit newest code with svn, then try to build it follow instructions > on this page: > > http://trac.webkit.org/wiki/BuildingGtk > > When I run Tools/Scripts/build-webkit --gtk, > There is an error: > ../../Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp:43:22: fatal > error: cairo-gl.h: No such file or directory > > and I found these two file named cairo-gl.h under webkit directory: > ./WebKitBuild/Dependencies/Source/cairo-1.12.8/src/cairo-gl.h > ./WebKitBuild/Dependencies/Root/include/cairo/cairo-gl.h > I hit a similar problem to this today, although perhaps not exactly the same issue: When I tried to build the latest release of WebKitGTK+ (2.9.5) right from the tarball in a 32-bit Linux system withOUT cairo-gl available, ACCELERATED_2D_CANVAS was enabled by default, making the build fail later on with a similar error to the one above, due to "missing cairo-gl.h". I have no idea why it enabled 2D_ACCELERATED_CANVAS by default, I've just noticed it when I saw the build failing, because of this line in CMakeCache.txt: //Toggle accelerated 2D canvas support ENABLE_ACCELERATED_2D_CANVAS:BOOL=ON Will try to provide more info later on, but for now just to mention that I was not using the build-webkit script at all, as I was building straight from the tarball.
This seems to be the problem: Even though cairo-gl is not found, CMake ends up concluding that it is found for some reason, and that enables ACCELERATED_2D_CANVAS: -- checking for module 'cairo-gl' -- package 'cairo-gl' not found -- checking for module 'cairo-glx' -- package 'cairo-glx' not found -- checking for module 'cairo-egl' -- package 'cairo-egl' not found -- Found CairoGL: CAIRO_GLX_INCLUDE_DIRS;CAIRO_EGL_INCLUDE_DIRS (Required is at least version "1.10.2") [...] -- Enabled features: -- ENABLE_ACCELERATED_2D_CANVAS ............ ON -- ENABLE_CREDENTIAL_STORAGE ON [...] Seems like a different bug to me, while file it once I confirm whether this is an issue in the 2.9.5 release or also in the latest master from trunk.
I ran into this when building WebKitGTK from source on one of my old VMs. The solution was to delete the CMakeCache.txt file and re-run CMake so that it uses the correct path to the jhbuild-installed <cairo/cairo_gl.h> header. It had been looking in /usr/include, but it was not installed system-wide.