Skip to content
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

Functional Test fail on Windows Only (Unicode on Java with Gradle is a Mess) #8

Closed
tricktron opened this issue Nov 28, 2021 · 0 comments · Fixed by #13
Closed

Functional Test fail on Windows Only (Unicode on Java with Gradle is a Mess) #8

tricktron opened this issue Nov 28, 2021 · 0 comments · Fixed by #13

Comments

@tricktron
Copy link
Owner

tricktron commented Nov 28, 2021

Unicode on Java with Gradle is a mess but let's start from the beginning:

Problem

The functionalTest task times out on windows only:

...
> Task :functionalTest
JVMDUMP039I Processing dump event "user", detail "" at 2021/11/24 15:39:01 - please wait.
37
JVMDUMP032I JVM requested Java dump using 'D:\a\frege-gradle-plugin\frege-gradle-pluin\javacore.20211124.153901.4372.0001.txt' in response to an event
38
JVMDUMP010I Java dump written to D:\a\frege-gradle-plugin\frege-gradle-plugin\javacore.20211124.153901.4372.0001.txt
39
JVMDUMP013I Processed dump event "user", detail "".

I have started to debug this on a

new branch: #7:

It seems that the new replFrege task introduced the bug because running its single test:

https://github.com/tricktron/frege-gradle-plugin/blob/8fed7811e535d3f8892ea16f7587e461ef1ee98e/src/functionalTest/java/ch/fhnw/thga/gradleplugins/FregePluginFunctionalTest.java#L366-L375

already fails.

For the changed files see: https://github.com/tricktron/frege-gradle-plugin/pull/6/files

Windows Endless Loop With Gradle, Unicode works

After I got my hands on a windows machine, I found out that the Frege Repl is stuck in an endless loop if started with gradle:

win10-gradle

No Endless Loop without Gradle but Unicode Problems

However, if you start it directly with java, the Frege Repl works but unicode does not (e.g. German umlaute like �äöü are displayed as question marks):

win10-java

First Hypothesis: Unicode Problem leads to Endless Loop

See gradle/gradle#19235.

Short summary:
On macOS and Linux the default Charset is UTF-8 and Java will choose the default charset depending on the locale. On Windows however, the default charset is windows-1252 and Java will choose the default charset dependent on the active codepage.

This leads to the wrong encoding of äöü as ? on windows. Unfortunately this was not the root cause for the endless loop.

Second Hypothesis and Lesson Learned: Always Search First if Issue Already Exists

See jline/jline2#245

Short summary:
The terminal started with replFrege --console plain is not correctly recognised by jline2.

Setting the jline.terminal property to none should work as a workaround. See https://github.com/jline/jline2/wiki/Terminal-Factory-Configuration.

@tricktron tricktron changed the title Functional Test fail on Windows Only Functional Test fail on Windows Only (Unicode on Java is a Mess) Dec 4, 2021
@tricktron tricktron changed the title Functional Test fail on Windows Only (Unicode on Java is a Mess) Functional Test fail on Windows Only (Unicode on Java with Gradle is a Mess) Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant