From ce9b3a37232d1e9b2812b11439696d13e384661d Mon Sep 17 00:00:00 2001 From: heyarne Date: Tue, 4 Jan 2022 09:56:34 +0100 Subject: [PATCH] buildGraalVmNativeImage: enable utf-8 by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tools built with buildGraalVmNativeImage have broken UTF-8 support when not properly setting the locale, e.g. $ bb -e '(prn "bépo àê")' "b??po ????" This commit sets the locale to en_US.UTF-8 by default, which fixes that. --- pkgs/build-support/build-graalvm-native-image/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/build-support/build-graalvm-native-image/default.nix b/pkgs/build-support/build-graalvm-native-image/default.nix index 09b2d9f73a2b..3aedd61ea6ce 100644 --- a/pkgs/build-support/build-graalvm-native-image/default.nix +++ b/pkgs/build-support/build-graalvm-native-image/default.nix @@ -33,6 +33,8 @@ stdenv.mkDerivation (args // { nativeImageBuildArgs = nativeImageBuildArgs ++ extraNativeImageBuildArgs ++ [ graalvmXmx ]; buildPhase = args.buildPhase or '' + export LC_ALL="en_US.UTF-8" + runHook preBuild native-image ''${nativeImageBuildArgs[@]}