Commit Graph

11 Commits

Author SHA1 Message Date
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
Alyssa Ross
0ae87d514f treewide: add names to all setup hooks 2023-01-19 15:00:36 +00:00
Rick van Schijndel
a2f91d1831 wafHook: export PKGCONFIG if needed
This is useful for cross-compilation, where nixpkgs sets PKG_CONFIG.
waf decided to use PKGCONFIG instead, so we'll set it when necessary.
2022-04-10 17:12:10 +02:00
panicgh
27f9348ee7
wafHook: always enable parallel building (#136641)
Follow the same pattern as used in the cmake setup hook to assume
`enableParallelBuilding=1` when unset by the user. This makes wafHook
honor `NIX_BUILD_CORES`. See #136368 and #136641.
2021-11-21 16:40:48 -05:00
Janne Heß
cfc4f6347f
wafHook: Don't wrap python2 2020-12-17 19:01:28 +01:00
Matthew Bauer
46f8756aee
Merge pull request #79593 from thefloweringash/wafhook-phases
wafHook: allow overriding phases and disabling of cross flags
2020-03-22 01:59:41 -04:00
Matthew Bauer
dfbe76a681 waf: move binary to $out/bin/
Originally this was just the executable, but this breaks nix-shell
usage. Instead, just do a normal directory.

Fixes #79909
2020-03-06 07:06:01 +01:00
Andrew Childs
03ffda3d1e wafHoook: fix whitespace 2020-02-09 16:13:43 +09:00
Andrew Childs
032d5e7e83 wafHook: make crossFlags optional
The convention of `--cross-compile` and `--cross-execute` is common
enough that it seems like a reasonable default. However there are
projects like mpv which do not use these flags, and rightfully fails
to configure when passed unexpected flags.
2020-02-09 16:03:02 +09:00
Andrew Childs
c6791b2117 wafHook: allow overriding phases
This makes the wafHook a lot closer to the structure of standard hooks
like cmake and ninja.
2020-02-09 16:03:02 +09:00
xbreak
98d9a74223 wafHook: Refactored wafHook to use callPackage (#64250)
This is to enable custom wafHook with custom waf via the override
system.
2019-07-03 15:20:28 -04:00