Commit Graph

56 Commits

Author SHA1 Message Date
Vladimír Čunát
9434136df3
ninja: patch issues on 32-bit platforms
Fixes #68241
> Value too large for defined data type
https://hydra.nixos.org/build/213266252
2023-03-21 09:56:51 +01:00
Sergei Trofimovich
69cf5181c3 stdenv/generic/setup.sh: enable parallel installs by default
The primary motivating example is openssl:

Before the change full package build took 1m54s minutes.
After the change full package build takes 59s.

About a 2x speedup.

The difference is visible because openssl builds hundreds of manpages
spawning a perl process per manual in `install` phase. Such a workload
is very easy to parallelize.

Another example would be `autotools`+`libtool` based build system where
install step requires relinking. The more binaries there are to relink
the more gain it will be to do it in parallel.

The change enables parallel installs by default only for buiilds that
already have parallel builds enabled. There is a high chance those build
systems already handle parallelism well but some packages will fail.

Consistently propagated the enableParallelBuilding to:
- cmake (enabled by default, similar to builds)
- ninja (set parallelism explicitly, don't rely on default)
- bmake (enable when requested)
- scons (enable when requested)
- meson (set parallelism explicitly, don't rely on default)
- waf (set parallelism explicitly, don't rely on default)
- qmake-4/5/6 (enable by default, similar to builds)
- xorg (always enable, similar to builds)
2023-02-26 22:02:09 +00:00
Nick Cao
70599398d8
ninja: fix cross compilation 2023-02-04 08:03:58 +08:00
Anderson Torres
a5a1d526d0
Merge pull request #189773 from AndersonTorres/ninja
Ninja: reformat expression
2022-09-24 21:50:21 -03:00
Graham Christensen
c2b898da76 treewide: drop -l$NIX_BUILD_CORES
Passing `-l$NIX_BUILD_CORES` improperly limits the overall system load.

For a build machine which is configured to run `$B` builds where each
build gets `total cores / B` cores (`$C`), passing `-l $C` to make will
improperly limit the load to `$C` instead of `$B * $C`.

This effect becomes quite pronounced on machines with 80 cores, with
40 simultaneous builds and a cores limit of 2. On a machine with this
configuration, Nix will run 40 builds and make will limit the overall
system load to approximately 2. A build machine with this many cores
can happily run with a load approaching 80.

A non-solution is to oversubscribe the machine, by picking a larger
`$C`. However, there is no way to divide the number of cores in a way
which fairly subdivides the available cores when `$B` is greater than
1.

There has been exploration of passing a jobserver in to the sandbox,
or sharing a jobserver between all the builds. This is one option, but
relatively complicated and only supports make. Lots of other software
uses its own implementation of `-j` and doesn't support either `-l` or
the Make jobserver.

For the case of an interactive user machine, the user should limit
overall system load using `$B`, `$C`, and optionally systemd's
cpu/network/io limiting features.

Making this change should significantly improve the utilization of our
build farm, and improve the throughput of Hydra.
2022-09-22 16:01:23 -04:00
AndersonTorres
dee33e8fe3 ninja: revert to the old rec format 2022-09-16 00:39:18 -03:00
AndersonTorres
35227b3105 ninja: use installShellCompletion 2022-09-16 00:39:17 -03:00
AndersonTorres
cc0f29fedd ninja: add runHook's 2022-09-16 00:39:17 -03:00
AndersonTorres
476d97b9bf ninja: format expression
Because I believe it is nicer this way.
2022-09-16 00:39:17 -03:00
AndersonTorres
e0aa46d57b ninja: reorder setup-hook.sh
It is considerably more readable to put the functions-hooks before the code
activating them.
2022-09-16 00:39:10 -03:00
R. Ryantm
f1927d014e ninja: 1.11.0 -> 1.11.1 2022-08-31 19:26:59 +00:00
R. Ryantm
8d276aceaf ninja: 1.10.2 -> 1.11.0 2022-07-29 02:20:25 +00:00
milahu
20f3160f41 ninja: disable line-clearing with TERM=dumb 2022-06-25 17:08:53 +02:00
pennae
2f2fa58e4d ninja: pipe ninja output through cat in hooks
ninja build progress output is not line-base, it overwrites the same
line over and over again with its progress reporting. nix is line-based
though, so ninja-based builds have their progress hidden. pipe ninja
output through cat to avoid this.
2021-12-09 09:43:36 +01:00
Ben Siraphob
c522fec274 pkgs/development/tools: stdenv.lib -> lib 2021-01-23 20:30:03 +07:00
R. RyanTM
f51da8c643 ninja: 1.10.1 -> 1.10.2 2020-12-01 14:40:18 +01:00
R. RyanTM
3d695776ae ninja: 1.10.0 -> 1.10.1 2020-08-24 11:58:01 +02:00
Michael Reilly
84cf00f980
treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
Tobias Mayer
3a39ea06d2 ninja: 1.9.0 -> 1.10.0 2020-02-09 16:57:56 -06:00
Daiderd Jordan
587c66c877
ninja: python2 -> python3 2020-01-13 11:13:06 +01:00
John Ericson
b7f4bda282 treewide: *Phase(s)? variables are optional
If these aren't defined, the stdenv defaults are used in the `*Phase`
case, or no extra phases are done, in the `*Phases` case.
2019-11-01 14:44:44 -04:00
John Ericson
1290e532ea treewide: Make more dont* variables OK to be undefined in setup hooks 2019-11-01 14:44:44 -04:00
volth
46420bbaa3 treewide: name -> pname (easy cases) (#66585)
treewide replacement of

stdenv.mkDerivation rec {
  name = "*-${version}";
  version = "*";

to pname
2019-08-15 13:41:18 +01:00
Will Dietz
0f14c9cd8f ninja: patch to fix w/musl, see upstream issue 2019-02-11 22:41:45 -06:00
worldofpeace
3abe344987
ninja: Add comment explaining the consistent ID patch
Co-Authored-By: grahamc <graham@grahamc.com>
2019-02-07 18:26:51 -05:00
Graham Christensen
21cdf28a83
ninja: make reproducible
See https://github.com/ninja-build/ninja/pull/1529
2019-02-07 18:04:59 -05:00
Will Dietz
d4cd52e503 ninja: 1.8.2 -> 1.9.0
https://groups.google.com/forum/#!topic/ninja-build/nY5Kb7zUvcg
2019-01-31 12:25:13 -06:00
volth
a4faf59aa1 ninja: re2c is not for building docs
ninja sources include re2c's output files, so unless we change the sources by applying a patch, re2c is not even launched
anyway, it is not relevant to building docs
2019-01-13 13:42:06 +01:00
Matthew Bauer
285eb9a894 cmake: set CTEST_OUTPUT_ON_FAILURE globally
We should always use this.
2018-11-19 16:16:16 -06:00
Matthew Bauer
b75d5adb33 ninja: restore old -l flag value
This can be set unconditionally to $NIX_BUILD_CORES according to
@orivej.
2018-11-18 19:31:03 -06:00
Matthew Bauer
a16c04c9d3 ninja: don’t use build/install/check flags in setup-hook
These don’t have much use in ninja, so easiest to leave them out.
2018-11-18 19:31:02 -06:00
Matthew Bauer
4ebab3de1e ninja: use -t query to find test target 2018-11-18 19:31:02 -06:00
Matthew Bauer
9433a3882b ninja: fix mistake in setup-hook 2018-11-18 19:31:01 -06:00
Matthew Bauer
69d1151bfa ninja: make setup-hook.sh closer to setup.sh
Things changed in the Ninja setup-hook:
- Respect installFlags
- Automatically add checkPhase (can be disabled with dontUseNinjaCheck
  in the same way as dontUseNinjaBuild and dontUseNinjaInstall). Tests
  are only run when "ninja test" exists.
- Error in build phase when build.ninja is missing. We don’t have a
  way to fall back to other build methods, so it’s best to be very
  clear when we aren’t able to build with ninja
- Set -l flag to 1 when enableParallelBuilding is disabled
2018-11-18 19:31:01 -06:00
Orivej Desh
06c63123cc Fix comment location after #46704 2018-09-15 22:36:21 +00:00
Dan Peebles
4efd4053ed stdenv/darwin: integrate a new CoreFoundation
This also updates the bootstrap tool builder to LLVM 5, but not the ones
we actually use for bootstrap. I'll make that change in a subsequent commit
so as to provide traceable provenance of the bootstrap tools.
2018-09-15 16:05:46 -04:00
Orivej Desh
33ed2af2a7 ninja: support cross compilation 2018-06-03 22:44:15 +00:00
Orivej Desh
41c8b92d4f
ninja: build manual with docbook (#41433)
It is not meant to be built with asciidoc alone: it lacks the table of contents
and styles. See  https://github.com/ninja-build/ninja/blob/v1.8.2/doc/README.md
2018-06-03 22:34:27 +00:00
Orivej Desh
2c7cd2455e ninja: support disabling parallel building
but keep it enabled by default
2017-12-07 08:52:42 +00:00
Roberto Di Remigio
9792c039ee ninja: 1.7.2 -> 1.8.2 2017-11-18 19:03:44 +00:00
Lukas Werling
f0a1ab78b4 meson/ninja: add setup hooks (#28444)
* Add setupHook for meson/ninja build

* libhttpseverywhere: Use meson/ninja setupHooks

* jamomacore: Remove superfluous ninja buildInput

* Remove obsolete ninja buildPhases

These are all handled by ninja's setup hook.

* lean2, xcbuild: fix build with ninja setup hook

Ninja is a runtime dependency here. However, cmake can generate Ninja
build files as well to satisfy the setup hook.

* qtwebengine: fix build with ninja setup hook
2017-08-27 19:42:21 +02:00
Herwig Hochleitner
6509ba66a8 ninja: 1.7.1 -> 1.7.2 2017-05-20 16:02:50 +02:00
Bjørn Forsman
25960389da ninja: 1.6.0 -> 1.7.1
Release notes:
https://groups.google.com/forum/#!topic/ninja-build/bkDE7auQwiI/discussion

The current github src URL redirects to the "ninja-build" github user,
so use that directly.
2016-05-26 09:51:10 +02:00
Austin Seipp
f07d5a244f nixpkgs: ninja 1.5.3 -> 1.6.0
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2015-07-20 13:52:34 -05:00
Austin Seipp
70528e9f8e nixpkgs: ninja 1.5.1 -> 1.5.3
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2015-03-17 20:29:46 -05:00
Austin Seipp
528a1c0f56 ninja: 1.4.0 -> 1.5.1
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-08-20 01:13:33 -05:00
John Wiegley
010132e302 Change several package constraints from linux to unix
They all build on Darwin.
2014-04-12 16:01:16 -05:00
Bjørn Forsman
4d6605e882 Whitespace fixes in package expressions I maintain 2014-01-02 17:58:08 +01:00
aszlig
9170351e69
ninja: Update to new upstream version 1.4.0.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2013-09-27 15:23:30 +02:00
aszlig
1709571b3f
ninja: Update to v1.3.4 and drop unzip dependency.
Version 1.2.0 is way too old in order to build the latest chromium (29) version,
so let's get it up to date (especially because no other package is referencing
ninja, so it should be non-critical).

The dependency on unzip is not needed here, because GitHub also provides
archives in tar.gz format.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2013-06-21 12:17:55 +02:00