Bug 195251 - [GTK] No rule to make target 'JavaScriptCore-4.0.gir'
Summary: [GTK] No rule to make target 'JavaScriptCore-4.0.gir'
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-02 15:54 PST by Alberto Garcia
Modified: 2020-02-15 07:15 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.45 KB, patch)
2019-03-02 16:28 PST, Alberto Garcia
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Garcia 2019-03-02 15:54:55 PST
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?
Comment 1 Alberto Garcia 2019-03-02 16:28:18 PST
Created attachment 363436 [details]
Patch
Comment 2 Alberto Garcia 2019-03-02 16:33:07 PST
Comment on attachment 363436 [details]
Patch

Sorry for the noise, this patch doesn't fix the build
Comment 3 Alberto Garcia 2019-03-08 03:04:28 PST
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).
Comment 4 Дилян Палаузов 2019-06-06 02:50:02 PDT
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.
Comment 5 Alberto Garcia 2019-06-06 03:01:04 PDT
(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.
Comment 6 Michael Catanzaro 2019-06-06 07:32:01 PDT
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.
Comment 7 Дилян Палаузов 2019-06-06 07:43:20 PDT
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.”
Comment 8 Дилян Палаузов 2019-06-06 12:03:42 PDT
`make JavaScriptCore-4-gir` does generate JavaScriptCore-4.0.gir.
Comment 9 Cédric Bellegarde 2020-02-15 07:15:51 PST
Happening here with last WebKitGTK release in a LXC container.