Support for Samurai (C99 Ninja alternative)

Feature requests go here.
mjo
Posts: 3
Joined: 13 Nov 2023, 23:01

Support for Samurai (C99 Ninja alternative)

Postby mjo » 02 Dec 2023, 14:02

Hi, Samurai (https://github.com/michaelforney/samurai) is a drop-in C99 replacement for the "ninja" command. If it's not too much trouble, could you allow ./configure to proceed if "samu" is installed instead of "ninja"? Or perhaps skip the check if $NINJA is set in the environment?

Polymake is already halfway to supporting Samurai, because the top-level Makefile calls $NINJA instead of "ninja", so people can run e.g. NINJA=samu make to override the command. The only roadblock is that ./configure won't let them get that far.

We have automatic support for Samurai in Gentoo and this would let our users use it without having to install a superfluous copy of ninja to fake out the configure script. If you're wondering why anyone would want to reimplement ninja in C, it's partially for speed and partially to avoid chicken-and-egg problems in the build. (The latter can be especially annoying on a distro where everything is built from source.)

User avatar
gawrilow
Main Author
Posts: 425
Joined: 25 Dec 2010, 17:40

Re: Support for Samurai (C99 Ninja alternative)

Postby gawrilow » 03 Dec 2023, 00:40

Hi, Samurai (https://github.com/michaelforney/samurai) is a drop-in C99 replacement for the "ninja" command. If it's not too much trouble, could you allow ./configure to proceed if "samu" is installed instead of "ninja"? Or perhaps skip the check if $NINJA is set in the environment?

Polymake is already halfway to supporting Samurai, because the top-level Makefile calls $NINJA instead of "ninja", so people can run e.g. NINJA=samu make to override the command. The only roadblock is that ./configure won't let them get that far.
Surely we can do this (using the env. var.) provided that both tools are really interchangeable. In the meanwhile you could simply unblock the builds by creating a symlink ninja->samu, e.g. via /etc/alternatives.

You've said that samurai is faster than ninja. To be honest, I never perceived ninja as slow, even on rather big projects with several 10k binary targets. Now I'm just curious: can rewriting a C++ program in C99 still make it faster, or have there also been made some algorithmic improvements?


Return to “Feature Requests”