diff options
author | Thiago Kenji Okada <thiagokokada@gmail.com> | 2023-12-13 20:55:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-13 20:55:14 +0000 |
commit | 2723a8b755c6eb58328e8f9927a21d8dcd2df738 (patch) | |
tree | 9e53169582202d2e3ae30721665f259ffa962a1e /pkgs/development/compilers | |
parent | 6ad3977ec9548c3be3160c4486be2484a78d4f78 (diff) | |
parent | ed5b0bccf54ea17f66aa5836c5f7bb8680b0e2c1 (diff) |
Merge pull request #273961 from thiagokokada/workaround-graalvm-ce
graalvm-ce: use NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION instead of CC wrapper
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix b/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix index 7d62411f57401..858d7443ff626 100644 --- a/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix +++ b/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix @@ -63,22 +63,7 @@ let mkdir -p $out/bin ln -s ${lib.getDev musl}/bin/musl-gcc $out/bin/${stdenv.hostPlatform.system}-musl-gcc ''); - # GraalVM 23.0.0+ (i.e.: JDK 21.0.0+) clean-up the environment inside darwin - # So we need to re-added some env vars to make everything work correctly again - darwin-cc = (runCommandCC "darwin-cc" - { - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ darwin.apple_sdk.frameworks.Foundation zlib ]; - } '' - makeWrapper ${stdenv.cc}/bin/cc $out/bin/cc \ - --prefix NIX_CFLAGS_COMPILE_${stdenv.cc.suffixSalt} : "$NIX_CFLAGS_COMPILE" \ - --prefix NIX_LDFLAGS_${stdenv.cc.suffixSalt} : "$NIX_LDFLAGS" - ''); - binPath = lib.makeBinPath ( - lib.optionals stdenv.isDarwin [ darwin-cc ] - ++ lib.optionals useMusl [ musl-gcc ] - ++ [ stdenv.cc ] - ); + binPath = lib.makeBinPath (lib.optionals useMusl [ musl-gcc ] ++ [ stdenv.cc ]); runtimeLibraryPath = lib.makeLibraryPath ([ cups ] ++ lib.optionals gtkSupport [ cairo glib gtk3 ]); @@ -180,6 +165,14 @@ let echo "Testing GraalVM" $out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld | fgrep 'Hello World' + # Workaround GraalVM issue where the builder does not have access to the + # environment variables since 21.0.0 + # Only needed for native-image tests + # https://github.com/oracle/graal/pull/6095 + # https://github.com/oracle/graal/pull/6095 + # https://github.com/oracle/graal/issues/7502 + export NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION="true"; + echo "Ahead-Of-Time compilation" $out/bin/native-image -H:+UnlockExperimentalVMOptions -H:-CheckToolchain -H:+ReportExceptionStackTraces HelloWorld ./helloworld | fgrep 'Hello World' |