Unverified Commit d0e729bc authored by Thiago Kenji Okada's avatar Thiago Kenji Okada Committed by GitHub
Browse files

Merge pull request #267861 from thiagokokada/graalvm-fixes

buildGraalvmNativeImage: fix Unicode issue by setting encoding explicitly
parents b28c9ac0 acd0e255
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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 ];

+4 −3
Original line number Diff line number Diff line
@@ -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,