Merge pull request #299203 from thiagokokada/fix-graalvm-x86_64-darwin
buildGraalvm: fix build in x86_64-darwin
This commit is contained in:
commit
282bea96a8
|
@ -107,7 +107,7 @@ let
|
|||
++ lib.optional stdenv.isLinux autoPatchelfHook;
|
||||
|
||||
propagatedBuildInputs = [ setJavaClassPath zlib ]
|
||||
++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Foundation;
|
||||
++ lib.optional stdenv.isDarwin darwin.apple_sdk_11_0.frameworks.Foundation;
|
||||
|
||||
buildInputs = lib.optionals stdenv.isLinux [
|
||||
alsa-lib # libasound.so wanted by lib/libjsound.so
|
||||
|
@ -165,33 +165,27 @@ 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";
|
||||
extraNativeImageArgs="$(export -p | sed -n 's/^declare -x \([^=]\+\)=.*$/ -E\1/p' | tr -d \\n)"
|
||||
|
||||
echo "Ahead-Of-Time compilation"
|
||||
$out/bin/native-image -H:+UnlockExperimentalVMOptions -H:-CheckToolchain -H:+ReportExceptionStackTraces HelloWorld
|
||||
$out/bin/native-image -H:+UnlockExperimentalVMOptions -H:-CheckToolchain -H:+ReportExceptionStackTraces -march=compatibility $extraNativeImageArgs HelloWorld
|
||||
./helloworld | fgrep 'Hello World'
|
||||
|
||||
${# --static is only available in Linux
|
||||
lib.optionalString (stdenv.isLinux && !useMusl) ''
|
||||
echo "Ahead-Of-Time compilation with -H:+StaticExecutableWithDynamicLibC"
|
||||
$out/bin/native-image -H:+UnlockExperimentalVMOptions -H:+StaticExecutableWithDynamicLibC HelloWorld
|
||||
$out/bin/native-image -H:+UnlockExperimentalVMOptions -H:+StaticExecutableWithDynamicLibC -march=compatibility $extraNativeImageArgs HelloWorld
|
||||
./helloworld | fgrep 'Hello World'
|
||||
|
||||
echo "Ahead-Of-Time compilation with --static"
|
||||
$out/bin/native-image --static HelloWorld
|
||||
$out/bin/native-image $extraNativeImageArgs -march=compatibility --static HelloWorld
|
||||
./helloworld | fgrep 'Hello World'
|
||||
''}
|
||||
|
||||
${# --static is only available in Linux
|
||||
lib.optionalString (stdenv.isLinux && useMusl) ''
|
||||
echo "Ahead-Of-Time compilation with --static and --libc=musl"
|
||||
$out/bin/native-image --static HelloWorld --libc=musl
|
||||
$out/bin/native-image $extraNativeImageArgs -march=compatibility --libc=musl --static HelloWorld
|
||||
./helloworld | fgrep 'Hello World'
|
||||
''}
|
||||
|
||||
|
|
|
@ -1,23 +1,28 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, callPackage
|
||||
, fetchurl
|
||||
, pkgs
|
||||
}:
|
||||
|
||||
lib.makeScope pkgs.newScope (self:
|
||||
{
|
||||
buildGraalvm = callPackage ./buildGraalvm.nix;
|
||||
stdenv =
|
||||
if pkgs.stdenv.isDarwin then
|
||||
pkgs.darwin.apple_sdk_11_0.stdenv
|
||||
else
|
||||
pkgs.stdenv;
|
||||
|
||||
buildGraalvmProduct = callPackage ./buildGraalvmProduct.nix;
|
||||
buildGraalvm = self.callPackage ./buildGraalvm.nix;
|
||||
|
||||
graalvm-ce = callPackage ./graalvm-ce { };
|
||||
buildGraalvmProduct = self.callPackage ./buildGraalvmProduct.nix;
|
||||
|
||||
graalvm-ce-musl = callPackage ./graalvm-ce { useMusl = true; };
|
||||
graalvm-ce = self.callPackage ./graalvm-ce { };
|
||||
|
||||
graaljs = callPackage ./graaljs { };
|
||||
graalvm-ce-musl = self.callPackage ./graalvm-ce { useMusl = true; };
|
||||
|
||||
graalnodejs = callPackage ./graalnodejs { };
|
||||
graaljs = self.callPackage ./graaljs { };
|
||||
|
||||
graalpy = callPackage ./graalpy { };
|
||||
graalnodejs = self.callPackage ./graalnodejs { };
|
||||
|
||||
truffleruby = callPackage ./truffleruby { };
|
||||
}
|
||||
graalpy = self.callPackage ./graalpy { };
|
||||
|
||||
truffleruby = self.callPackage ./truffleruby { };
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue