Merge pull request #283973 from thiagokokada/fix-babashka-bug

buildGraalvmNativeImage: fix UTF-8 encoding issue for JVM dependencies
This commit is contained in:
Thiago Kenji Okada 2024-01-26 15:36:43 +00:00 committed by GitHub
commit 0ce9684bc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -16,14 +16,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"
, meta ? { }
, LC_ALL ? "en_US.UTF-8"
, ...
} @ args:
@ -45,6 +44,8 @@ in
stdenv.mkDerivation ({
inherit dontUnpack jar;
env = { inherit LC_ALL; };
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ graalvmDrv glibcLocales removeReferencesTo ];
nativeImageBuildArgs = nativeImageBuildArgs ++ extraNativeImageBuildArgs ++ [ graalvmXmx ];

View File

@ -36,6 +36,7 @@ let
$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 àê'
$out/bin/bb '(:out (babashka.process/sh "echo" "ä"))' | fgrep 'ä'
'';
postInstall = ''