Merge pull request #267861 from thiagokokada/graalvm-fixes

buildGraalvmNativeImage: fix Unicode issue by setting encoding explicitly
This commit is contained in:
Thiago Kenji Okada 2023-11-16 13:48:13 +00:00 committed by GitHub
commit d0e729bc26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,6 @@
, glibcLocales
# The GraalVM derivation to use
, graalvmDrv
, name ? "${args.pname}-${args.version}"
, executable ? args.pname
# JAR used as input for GraalVM derivation, defaults to src
, jar ? args.src
@ -15,13 +14,13 @@
"-H:Name=${executable}"
"-march=compatibility"
"--verbose"
"-J-Dsun.stdout.encoding=UTF-8"
"-J-Dsun.stderr.encoding=UTF-8"
]
# Extra arguments to be passed to the native-image
, extraNativeImageBuildArgs ? [ ]
# XMX size of GraalVM during build
, graalvmXmx ? "-J-Xmx6g"
# Locale to be used by GraalVM compiler
, LC_ALL ? "en_US.UTF-8"
, meta ? { }
, ...
} @ args:
@ -41,7 +40,7 @@ let
];
in
stdenv.mkDerivation ({
inherit dontUnpack LC_ALL jar;
inherit dontUnpack jar;
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ graalvmDrv glibcLocales ];

View File

@ -33,9 +33,10 @@ let
doInstallCheck = true;
installCheckPhase = ''
$out/bin/bb --version | grep '${version}'
$out/bin/bb '(+ 1 2)' | grep '3'
$out/bin/bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]' | grep '[1 2]'
$out/bin/bb --version | fgrep '${version}'
$out/bin/bb '(+ 1 2)' | fgrep '3'
$out/bin/bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]' | fgrep '[1 2]'
$out/bin/bb '(prn "bépo àê")' | fgrep 'bépo àê'
'';
# As of v1.2.174, this will remove references to ${graalvmDrv}/conf/chronology,