diff options
author | Artturin <Artturin@artturin.com> | 2023-10-15 04:56:01 +0300 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2023-10-15 04:56:01 +0300 |
commit | 849e4dc5ff0ae70fb7a0df19dbbf633e408c0f32 (patch) | |
tree | 1925beed89fb613f411692c0911c3871d2fab157 /pkgs/development/compilers/openjdk/openjfx/21.nix | |
parent | 153d89edda0349d57aa450fd9c249f52831b1168 (diff) | |
download | nixpkgs-849e4dc5ff0ae70fb7a0df19dbbf633e408c0f32.tar nixpkgs-849e4dc5ff0ae70fb7a0df19dbbf633e408c0f32.tar.gz nixpkgs-849e4dc5ff0ae70fb7a0df19dbbf633e408c0f32.tar.bz2 nixpkgs-849e4dc5ff0ae70fb7a0df19dbbf633e408c0f32.tar.lz nixpkgs-849e4dc5ff0ae70fb7a0df19dbbf633e408c0f32.tar.xz nixpkgs-849e4dc5ff0ae70fb7a0df19dbbf633e408c0f32.tar.zst nixpkgs-849e4dc5ff0ae70fb7a0df19dbbf633e408c0f32.zip |
openjfx: respect NIX_BUILD_CORES in nested cmake
Building `openjfx11` or `openjfx12` on a machine with many cores can consume huge amounts of RAM. With 24 cores, the memory usage exceeded `25GB` per build for me. Using `NIX_BUILD_CORES` to reduce the number of parallel tasks doesn't help, because a script invoking `cmake` does not respect `NIX_BUILD_CORES` and passes `-j <number of cores>`. Setting `NUMBER_OF_PROCESSORS` overrides the automatic core count detection in the script. https://github.com/search?q=repo%3Aopenjdk%2Fjfx%20NUMBER_OF_PROCESSORS&type=code Co-authored-by: Fabian Möller <fabianm88@gmail.com>
Diffstat (limited to 'pkgs/development/compilers/openjdk/openjfx/21.nix')
-rw-r--r-- | pkgs/development/compilers/openjdk/openjfx/21.nix | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/development/compilers/openjdk/openjfx/21.nix b/pkgs/development/compilers/openjdk/openjfx/21.nix index 4b178736854..2f0d83f9f25 100644 --- a/pkgs/development/compilers/openjdk/openjfx/21.nix +++ b/pkgs/development/compilers/openjdk/openjfx/21.nix @@ -38,6 +38,7 @@ let buildPhase = '' runHook preBuild + export NUMBER_OF_PROCESSORS=$NIX_BUILD_CORES export GRADLE_USER_HOME=$(mktemp -d) ln -s $config gradle.properties export NIX_CFLAGS_COMPILE="$(pkg-config --cflags glib-2.0) $NIX_CFLAGS_COMPILE" |