Bug 219629 (cmake-ninja)

Summary: [exp-run] Make ninja opt out in cmake.mk
Product: Ports & Packages Reporter: Tobias C. Berner <tcberner>
Component: Individual Port(s)Assignee: Tobias C. Berner <tcberner>
Status: Closed FIXED    
Severity: Affects Only Me CC: kde, portmgr
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://reviews.freebsd.org/D10748
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213331
Attachments:
Description Flags
make ninja default
none
patch v2
none
patch v 2.5
none
v3
none
v4
none
v5
none
v6
none
v7
none
v8 none

Description Tobias C. Berner freebsd_committer 2017-05-29 09:11:57 UTC
Created attachment 183029 [details]
make ninja default

kde@ would like to ask for an exp-run to cmakes default generator.


This makes ninja the default generator for ports having USES=cmake .
Ports can opt-out with the new cmake argument 'noninja'.

The patch is attached, and can also be found here:
http://people.freebsd.org/~tcberner/patches/cmake_ninja.v1.diff
Comment 2 Tobias C. Berner freebsd_committer 2017-05-30 16:40:31 UTC
Created attachment 183075 [details]
patch v2

http://people.freebsd.org/~tcberner/patches/cmake_ninja.v2.diff

fix all from comment 1, but devel/flang, which does not exist for me.
Comment 3 Tobias C. Berner freebsd_committer 2017-05-30 16:42:10 UTC
(In reply to Tobias C. Berner from comment #2)
I'm an idiot. Give me a minute.
Comment 4 Tobias C. Berner freebsd_committer 2017-05-30 16:44:32 UTC
Created attachment 183076 [details]
patch v 2.5

+ devel/flang
Comment 6 Tobias C. Berner freebsd_committer 2017-06-01 16:48:15 UTC
Created attachment 183134 [details]
v3

New diff
http://people.freebsd.org/~tcberner/patches/cmake_ninja.v3.diff


fixes x11-themes/kde4-style-bespin - the other two I think are related to the sqlite3 update.
Comment 7 Antoine Brodin freebsd_committer 2017-06-04 06:08:07 UTC
There seems to be new failures specific to i386 (or to non-amd64):

http://package18.nyi.freebsd.org/data/110i386-default-PR219629/2017-06-03_21h07m19s/logs/errors/stp-1436_4.log
http://package18.nyi.freebsd.org/data/110i386-default-PR219629/2017-06-03_21h07m19s/logs/errors/doxygen-1.8.13,2.log

Around 450 ports were not tested due to those failures.
Comment 8 Antoine Brodin freebsd_committer 2017-06-04 18:31:13 UTC
On 10.3 amd64 there is 1 new failure:  graphics/osg-devel  (it changes USES depending on OSVERSION)

http://package18.nyi.freebsd.org/data/103amd64-default-PR219629/2017-06-04_06h09m22s/logs/errors/osg-devel-3.5.1_1.log
Comment 9 Tobias C. Berner freebsd_committer 2017-06-04 20:25:01 UTC
Created attachment 183219 [details]
v4

http://people.freebsd.org/~tcberner/patches/cmake_ninja.v4.diff

* marks devel/doxygen and math/stp noninja, as I could not consistently reproduce the issue. 
* remove the USES=gmake for 10.x from graphics/osg-devel
* mark ports ignored that want to "USES=cmake gmake"
Comment 11 Tobias C. Berner freebsd_committer 2017-06-10 18:23:15 UTC
Created attachment 183389 [details]
v5

Remove some superflous noninja's spotted by rakuco@.
Comment 12 Tobias C. Berner freebsd_committer 2017-06-10 18:23:56 UTC
(In reply to Tobias C. Berner from comment #11)
Patch can also be found here:
http://people.freebsd.org/~tcberner/patches/cmake_ninja.v5.diff
Comment 13 Tobias C. Berner freebsd_committer 2017-06-10 19:28:18 UTC
Created attachment 183390 [details]
v6

Sorry, the previous patch had issues in the newly (not) fixed ones. Here's a new one:
http://people.freebsd.org/~tcberner/patches/cmake_ninja.v6.diff
Comment 15 Tobias C. Berner freebsd_committer 2017-06-12 15:00:11 UTC
Created attachment 183434 [details]
v7

New patch can be found here:
http://people.freebsd.org/~tcberner/patches/cmake_ninja.v7.diff

* Does not use ninja for ports that set BUILD_- or INSTALL_WRKSRC to differ from CONFIGURE_WRKSRC.
* Apply complete fix to devel/bullet
Comment 17 Tobias C. Berner freebsd_committer 2017-06-16 05:35:53 UTC
Created attachment 183515 [details]
v8

Readd noninja to databases/mariadb100-server:
http://people.freebsd.org/~tcberner/patches/cmake_ninja.v8.diff
Comment 18 Antoine Brodin freebsd_committer 2017-06-18 20:38:33 UTC
Exp-run looks fine.

There is a leftover CMAKE_NINJA=yes in graphics/rawtherapee,  CMAKE_NINJA should probably be added to SANITY_DEPRECATED
Comment 19 Tobias C. Berner freebsd_committer 2017-06-18 21:09:07 UTC
(In reply to Antoine Brodin from comment #18)
I appended CMAKE_NINJA to SANITY_DEPRECATED in bsd.sanity.mk in the latest revision, and removed it from rawtherapee.

Thanks for the many exp-runs.
Comment 20 commit-hook freebsd_committer 2017-06-25 21:08:35 UTC
A commit references this bug:

Author: tcberner
Date: Sun Jun 25 21:08:06 UTC 2017
New revision: 444324
URL: https://svnweb.freebsd.org/changeset/ports/444324

Log:
  Make ninja opt-out in cmake.mk

  Using ninja instead of make (1) can lead to significant speed ups while building.
  Therefore switch from having the ninja generator opt-in to having it opt-out.

  Previously cmake-ports that wanted to use ninja could set
      CMAKE_NINJA=yes
  now, ports that do not work with ninja can set
      cmake:<existing args>,noninja
  Note, that needing this should be an exception and most often points to a broken
  cmake of the port.

  The ports using cmake were modified
  * removed USES=gmake, if ninja is used
  * removed MAKE_ARGS, if ninja is used
  * added the cmake-argument noninja if necessary

  PR:		219629
  PR:		213331
  Exp-run by:	antoine
  Reviewed by:	rakuco
  Differential Revision:	https://reviews.freebsd.org/D10748

Changes:
  head/CHANGES
  head/Mk/Uses/cmake.mk
  head/Mk/bsd.sanity.mk
  head/astro/marble/Makefile
  head/audio/csound6/Makefile
  head/audio/fluidsynth/Makefile
  head/audio/libgme/Makefile
  head/cad/kicad/Makefile
  head/cad/opencascade/Makefile
  head/cad/openvsp/Makefile
  head/chinese/fcitx/Makefile
  head/chinese/ibus-chewing/Makefile
  head/comms/uhd/Makefile
  head/comms/usrp/Makefile
  head/databases/cppdb/Makefile
  head/databases/evolution-data-server/Makefile
  head/databases/mariadb100-server/Makefile
  head/databases/mariadb55-server/Makefile
  head/databases/mysql55-server/Makefile
  head/databases/mysql56-server/Makefile
  head/databases/mysql57-server/Makefile
  head/databases/mysql80-server/Makefile
  head/databases/mysqlwsrep56-server/Makefile
  head/databases/percona55-server/Makefile
  head/databases/percona56-server/Makefile
  head/databases/percona57-server/Makefile
  head/databases/tarantool/Makefile
  head/databases/xtrabackup/Makefile
  head/deskutils/kdeconnect/Makefile
  head/deskutils/kdepim4/Makefile
  head/deskutils/owncloudclient/Makefile
  head/devel/bullet/Makefile
  head/devel/compiler-rt/Makefile
  head/devel/doxygen/Makefile
  head/devel/flang/Makefile
  head/devel/flang-clang/Makefile
  head/devel/kapptemplate/Makefile
  head/devel/kdevelop-kde4/Makefile
  head/devel/kdevelop-php/Makefile
  head/devel/libzrtpcpp/Makefile
  head/devel/llvm-cheri/Makefile
  head/devel/llvm-devel/Makefile
  head/devel/llvm38/Makefile
  head/devel/llvm39/Makefile
  head/devel/llvm40/Makefile
  head/devel/mongo-c-driver/Makefile
  head/devel/rapidjson/Makefile
  head/devel/tesla/Makefile
  head/devel/xxhash/files/
  head/devel/xxhash/files/patch-git_5ab73ee
  head/editors/codelite/Makefile
  head/editors/jucipp/Makefile
  head/editors/kate-plugin-pate/Makefile
  head/editors/neovim/Makefile
  head/games/hedgewars/Makefile
  head/games/openclonk/Makefile
  head/games/openmw/Makefile
  head/games/palomino/Makefile
  head/games/solarus/Makefile
  head/games/vavoom/Makefile
  head/graphics/aseprite/Makefile
  head/graphics/darktable/Makefile
  head/graphics/digikam-kde4/Makefile.common
  head/graphics/ilmbase/files/patch-git_8eed7012
  head/graphics/inkscape/Makefile
  head/graphics/luxrender/Makefile
  head/graphics/mitsuba/Makefile
  head/graphics/opensubdiv/Makefile
  head/graphics/osg-devel/Makefile
  head/graphics/osgearth/Makefile
  head/graphics/rawtherapee/Makefile
  head/graphics/tulip/Makefile
  head/graphics/waffle/Makefile
  head/graphics/xcftools/Makefile
  head/irc/weechat/Makefile
  head/lang/beignet/Makefile
  head/lang/io/Makefile
  head/lang/sagittarius-scheme/Makefile
  head/mail/evolution/Makefile
  head/mail/evolution-ews/Makefile
  head/mail/libcmime/Makefile
  head/mail/libvmime/Makefile
  head/mail/spmfilter/Makefile
  head/mail/spmfilter-clamav/Makefile
  head/math/metis/Makefile
  head/math/parmetis/Makefile
  head/math/stp/Makefile
  head/multimedia/avidemux/Makefile.common
  head/multimedia/gstreamer-qt4/Makefile
  head/multimedia/plexhometheater/Makefile
  head/multimedia/zoneminder/Makefile
  head/multimedia/zoneminder-h264/Makefile
  head/net/ceph-devel/Makefile
  head/net/tigervnc/Makefile
  head/net-im/licq/Makefile
  head/net-im/ring-gnome/Makefile
  head/net-im/ring-libclient/Makefile
  head/science/paraview/Makefile
  head/security/kwalletmanager/Makefile
  head/security/libzrtpcppcore/Makefile
  head/sysutils/baloo/Makefile
  head/sysutils/conky/Makefile
  head/sysutils/fluent-bit/Makefile
  head/sysutils/kcm-polkit-kde/Makefile
  head/sysutils/osquery/Makefile
  head/textproc/clucene/Makefile
  head/textproc/zxing-cpp/Makefile
  head/www/h2o/Makefile
  head/www/webkit2-gtk3/Makefile
  head/x11/kde4-runtime/Makefile
  head/x11/kde4-workspace/Makefile
  head/x11/virtualgl/Makefile
  head/x11-themes/kde4-style-bespin/Makefile
  head/x11-themes/kde4-windeco-crystal/Makefile
  head/x11-wm/pawm/Makefile
Comment 21 Tobias C. Berner freebsd_committer 2017-06-25 21:09:56 UTC
Thanks again.