This error happens if you try to build WebKitGTK with make -j1 (I'm using plain cmake, without ninja): make -f Source/WebKit/CMakeFiles/WebKit2WebExtension-4-gir.dir/build.make Source/WebKit/CMakeFiles/WebKit2WebExtension-4-gir.dir/build make[3]: Entering directory '/tmp/webkit2gtk-2.22.7/obj-x86_64-linux-gnu' make[3]: *** No rule to make target 'JavaScriptCore-4.0.gir', needed by 'WebKit2-4.0.gir'. Stop. make[3]: Leaving directory '/tmp/webkit2gtk-2.22.7/obj-x86_64-linux-gnu' make[2]: *** [CMakeFiles/Makefile2:1605: Source/WebKit/CMakeFiles/WebKit2WebExtension-4-gir.dir/all] Error 2 make[2]: Leaving directory '/tmp/webkit2gtk-2.22.7/obj-x86_64-linux-gnu' make[1]: *** [CMakeFiles/Makefile2:203: Source/CMakeFiles/gir.dir/rule] Error 2 make[1]: Leaving directory '/tmp/webkit2gtk-2.22.7/obj-x86_64-linux-gnu' make: *** [Makefile:215: gir] Error 2 There's indeed to no rule to generate JavaScriptCore-4.0.gir directly, but you can do 'make JavaScriptCore-4-gir', so I guess there's a wrong/missing rule on the CMake files?
Created attachment 363436 [details] Patch
Comment on attachment 363436 [details] Patch Sorry for the noise, this patch doesn't fix the build
This is maybe pure chance, but this reportedly doesn't happen when using cmake with ninja (although the failure with make was reproduced with 2.22.7 and the success with ninja with 2.23.92, so it can also be due to changes in the cmake files themselves).
The workaround is to go in $(top_builddir)/Source/JavaScriptCore and type `make`. Then go back to $(top_builddir) and type there `make` to complete the build. This was a problem also with 2.24.1. I use cmake 3.13.2. Ninja might get it rigth, if the total order is by chance different. It looks to me that JavaScriptCore-4.0.gir is a side-product of building something different, e.g. JavaScriptCore, but it cannot be build on its own as target. I do not understand cmake to help with patches. Note, that JavaScriptCore-4.0 JavaScriptCore-4.0 and WebKit2WebExtension-4.0 gir and typelib are in $(top_builddir) and not in subdirectories.
(In reply to Дилян Палаузов from comment #4) > It looks to me that JavaScriptCore-4.0.gir is a side-product of > building something different That is correct, and that's why everything works most of the time. > e.g. JavaScriptCore, but it cannot be build on its own as target. There is the JavaScriptCore-4-gir target which creates that file, but I think there's a dependency missing (or with the wrong name) somewhere. With the patch on comment #1 I tried a quick fix by giving the target the same name as the file, but that did not fix the build. I haven't investigated it properly in order to find the exact solution and my knowledge of CMake is very basic.
There's no spelling error. Source/JavaScriptCore/PlatformGTK.cmake creates ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir and Source/WebKit/PlatformGTK.cmake depends on ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir, which is identical. LGTM.
Afrer `rm $(top_builddir)/JavaScriptCore-4.0.gir`, `make -C $(top_builddir)/JavaScriptCore-4.0.gir` fails with “make: *** No rule to make target 'JavaScriptCore-4.0.gir'. Stop.”
`make JavaScriptCore-4-gir` does generate JavaScriptCore-4.0.gir.
Happening here with last WebKitGTK release in a LXC container.