Commit 9e38b7b0 authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

pkgsi686Linux.samba: don't configure `waf` in parallel on 32-bit systems

Without the change `waf configure` hung on `i686Linux.samba` on systems
with large amount of host CPUs (for me it's 16).

This happens because one of the worker processes gets `-ENOMEM` and does
not recover from it:

    2084476 mmap2(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = -1 ENOMEM (Cannot allocate memory)
    2084476 munmap(0xf2b5c000, 16384)       = 0
    2084476 rt_sigprocmask(SIG_BLOCK, ~[RT_1], NULL, 8) = 0
    2084476 madvise(0x1ff000, 8372224, MADV_DONTNEED) = 0
    2084476 exit(0)                         = ?
    2084476 +++ exited with 0 +++

THe change extends 32-bit arm workaround to limit to one thread to all
32-bit systems.
parent 571716eb
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -165,8 +165,14 @@ stdenv.mkDerivation rec {
    ++ optional (!enablePam) "--without-pam"
    ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
    "--bundled-libraries=!asn1_compile,!compile_et"
  ] ++ optionals stdenv.isAarch32 [
  ] ++ optionals stdenv.buildPlatform.is32bit [
    # By default `waf configure` spawns as many as available CPUs. On
    # 32-bit systems with many CPUs (like `i686` chroot on `x86_64`
    # kernel) it can easily exhaust 32-bit address space and hang up:
    #   https://github.com/NixOS/nixpkgs/issues/287339#issuecomment-1949462057
    #   https://bugs.gentoo.org/683148
    # Limit the job count down to the minimal on system with limited address
    # space.
    "--jobs 1"
  ];