After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791476 - Under Ubuntu, CMake without Ninja failed to generate
Under Ubuntu, CMake without Ninja failed to generate
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2017-12-11 13:10 UTC by BrunoP
Modified: 2017-12-11 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to move ensure_ninja_binary() calls before the test of self.use_ninja (2.02 KB, patch)
2017-12-11 13:10 UTC, BrunoP
none Details | Review
Autodetect ninja location and use it if succeeded (2.32 KB, patch)
2017-12-11 14:07 UTC, BrunoP
needs-work Details | Review
Make ninja a virtual sysdep (901 bytes, patch)
2017-12-11 16:11 UTC, Michael Catanzaro
committed Details | Review

Description BrunoP 2017-12-11 13:10:31 UTC
Created attachment 365359 [details] [review]
Patch to move ensure_ninja_binary() calls before the test of self.use_ninja

My platform: 4.13.0-17-generic #20-Ubuntu SMP Mon Nov 6 10:04:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Ninja package not installed
JHBuild package installed : srcdir = "/build/jhbuild-480Apv/jhbuild-3.15.92+20171014~ed1297d"

Error when building:
cmake -DCMAKE_INSTALL_PREFIX=/home/bruno/blacknut/third-parts/windows.static.player.x86_64-w64-mingw32/root -DCMAKE_INSTALL_LIBDIR=lib -G Ninja -DCMAKE_CXX_FLAGS='-std=c++11 -s' -DCMAKE_TOOLCHAIN_FILE=../../../cmake/toolchain.windows.x86_64-w64-mingw32.cmake -DCMAKE_COMMON_COMPILER_FLAGS= -DWIN32=true -DBUILD_SHARED_LIBS=false /home/bruno/blacknut/third-parts/windows.static.player.x86_64-w64-mingw32/src/live666-releases-1.14.0
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

In fact, the ensure_ninja_binary() is called after the test and not before.
I add in the following patch a test in do_configure and move the one to before the test.
Comment 1 BrunoP 2017-12-11 14:07:15 UTC
Created attachment 365366 [details] [review]
Autodetect ninja location and use it if succeeded

I change the behavior of self.ensure_ninja_binary() to check ninja is installed on the system.
If not, self.ensure_ninja_binary() do not raise an error and just change the status of use_ninja

Move the calls to self.ensure_ninja_binary() before testing self.use_ninja to switch automatically between Make or Ninja build system according to the self_use_ninja value
Comment 2 Michael Catanzaro 2017-12-11 16:09:52 UTC
Review of attachment 365366 [details] [review]:

Thanks for this bug report.

I think we should always try to use ninja unless it is explicitly turned off in jhbuildrc. It's not really possible to use jhbuild without ninja anymore, because it's required by meson.

The right thing to do here is to add a virtual sysdep for ninja, to make sure it gets installed by 'jhbuild sysdeps --install'. We were never able to do this in the past because Fedora renamed it to /usr/bin/ninja-build and /usr/bin/ninja was something else, but nowadays that is no longer the case. I believe it is safe to add a virtual sysdep now.

This is really easy, so I'll push a quick patch.
Comment 3 Michael Catanzaro 2017-12-11 16:11:38 UTC
The following fix has been pushed:
1044d28 Make ninja a virtual sysdep
Comment 4 Michael Catanzaro 2017-12-11 16:11:41 UTC
Created attachment 365377 [details] [review]
Make ninja a virtual sysdep

This ensures it will be installed by 'jhbuild sysdeps --install' so that
users get a sane error message if it's not installed, before trying to
build modules. We were never able to do this in the past because
/usr/bin/ninja was some IRC client on Fedora, but that's not the case
anymore.