Commit 849e4dc5 authored by Artturin's avatar Artturin
Browse files

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: default avatarFabian Möller <fabianm88@gmail.com>
parent 153d89ed
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,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"
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,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"
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,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"
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,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"
+1 −0
Original line number Diff line number Diff line
@@ -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"
Loading