-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
babashka (GraalVM) have broken UTF-8 support #260161
Comments
Pretty sure this is related to this bug in GraalVM upstream: oracle/graal#7502 I am curious if this is affecting projects using GraalVM 21.0.0 vanilla or if not, how is it working and why it is broken in |
It does seem that even setting up CC @heyarne to see if they have more context on what the possibly issue is. |
I also hit this today. I tested the same version(v1.3.186) from upstream binary release, which does not have this issue. https://github.com/babashka/babashka/releases/download/v1.3.186/babashka-1.3.186-linux-amd64-static.tar.gz Shall we always sync the same version of graavm as upstream build ci? babashka/babashka#1640 |
I don't think this is the issue and even if it was, it is not like babashka is the only GraalVM package we have. |
I know that folks can't reproduce this issue with // HelloWorld.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
System.out.println("bépo àê");
}
} $ javac HelloWorld.java
$ native-image -H:+UnlockExperimentalVMOptions -H:-CheckToolchain -H:+ReportExceptionStackTraces HelloWorld --verbose -march=compatibility
$ ./helloworld | fgrep 'Hello World'
$ ./helloworld | fgrep 'bépo àê' # works fine A patch if anyone wants to test to be applied to diff --git a/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix b/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix
index d7396d5f2d5c..a2e5aa427322 100644
--- a/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix
+++ b/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix
@@ -171,6 +171,7 @@ let
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
+ System.out.println("bépo àê");
}
}
''} > HelloWorld.java
@@ -183,16 +184,19 @@ let
echo "Ahead-Of-Time compilation"
$out/bin/native-image -H:+UnlockExperimentalVMOptions -H:-CheckToolchain -H:+ReportExceptionStackTraces HelloWorld
./helloworld | fgrep 'Hello World'
+ ./helloworld | fgrep 'bépo àê'
${# --static is only available in Linux
lib.optionalString (stdenv.isLinux && !useMusl) ''
echo "Ahead-Of-Time compilation with -H:+StaticExecutableWithDynamicLibC"
$out/bin/native-image -H:+UnlockExperimentalVMOptions -H:+StaticExecutableWithDynamicLibC HelloWorld
./helloworld | fgrep 'Hello World'
+ ./helloworld | fgrep 'bépo àê'
echo "Ahead-Of-Time compilation with --static"
$out/bin/native-image --static HelloWorld
./helloworld | fgrep 'Hello World'
+ ./helloworld | fgrep 'bépo àê'
''}
${# --static is only available in Linux
@@ -200,6 +204,7 @@ let
echo "Ahead-Of-Time compilation with --static and --libc=musl"
$out/bin/native-image --static HelloWorld --libc=musl
./helloworld | fgrep 'Hello World'
+ ./helloworld | fgrep 'bépo àê'
''}
runHook postInstallCheck So, can anyone reproduce this issue with GraalVM Native Image itself? If not, the only thing I can think is that the issue here is the |
So I got this warning:
But this was after |
To explain in more details why I think this is an upstream issue: I don't get the same So what I assume
Not sure why it works in GraalVM itself though yet. This is all really strange. |
While I'm not familiar with graalvm, I do find a hack for this issue, maybe @thiagokokada can weigh in to test whether this hack is valid: Some inspiration from a random reddit post and those issues: And I do find https://github.com/oracle/graal/blob/master/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SystemInOutErrSupport.java it's using
After I built bb with above args,
|
BTW, I cannot reproduce with GraalVM Native Image on helloworld java as well. Helloworld produced by GraalVM Native Image has correct unicode output. |
Thanks @sg-qwt for investigating this issue. Opened #267861 so we can have this fixed. |
Describe the bug
After #257292 babashka can't display Unicode characters
I have a babashka script that outputs the following JSON:
The text is a Nerd Font Symbol code point.
After 88c5afe the output is:
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Additional context
This has been fixed in the past by #153457
I did not test other packages that could be affected by the PR.
Notify maintainers
@thiagokokada
Metadata
The text was updated successfully, but these errors were encountered: