buildGraalvmNativeImage: fix Unicode issue by setting encoding explicitly

Remove the old workaround where we set it by LC_ALL, that does not seem
to be working anymore.

Fixes #260161.
This commit is contained in:
Thiago Kenji Okada 2023-11-15 21:23:58 +00:00
parent 372ce96efc
commit ca662df7bf

View file

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