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

console-tetris doesn't work with GraalVM #3

Open
borkdude opened this issue Oct 14, 2020 · 6 comments
Open

console-tetris doesn't work with GraalVM #3

borkdude opened this issue Oct 14, 2020 · 6 comments

Comments

@borkdude
Copy link

borkdude commented Oct 14, 2020

This project https://github.com/borkdude/console-tetris has a master branch which can be compiled with GraalVM (using script/compile). The master branch is still based on the original clojure-lanterna.

It is ported to our version of clojure-lanterna based on Lanterna 3 in the pod-babashka-lanterna branch.
It works on the JVM:

lein run -m tetris.core

and also as a babashka pod (using https://github.com/babashka/pod-babashka-lanterna and bb master):

$ cp ~.../pod-babashka-lanterna/pod-babashka-lanterna .
$ bb -cp src -m tetris.core

however the GraalVM-compiled version doesn't work which is something to look into.

@borkdude borkdude changed the title console-tetris doesn't work with console-tetris doesn't work with GraalVM Oct 14, 2020
@st3fan
Copy link

st3fan commented Nov 21, 2020

I gave this a try with GraalVM 20.3.0 which was released a few days ago, but unfortunately running script/compile ends with a fatal exception that I have not yet been able to track down:

Fatal error:java.lang.NoSuchFieldError: SplittingMaxNumberOfSplitNodes
	at org.graalvm.compiler.truffle.compiler.SharedTruffleCompilerOptions.<clinit>(SharedTruffleCompilerOptions.java:191)
	at org.graalvm.compiler.truffle.compiler.SharedTruffleCompilerOptions_OptionDescriptors.get(SharedTruffleCompilerOptions_OptionDescriptors.java:17)
	at org.graalvm.compiler.truffle.compiler.SharedTruffleCompilerOptions_OptionDescriptors$1.next(SharedTruffleCompilerOptions_OptionDescriptors.java:552)
	at org.graalvm.compiler.truffle.compiler.SharedTruffleCompilerOptions_OptionDescriptors$1.next(SharedTruffleCompilerOptions_OptionDescriptors.java:543)
	at com.oracle.svm.hosted.option.HostedOptionParser.collectOptions(HostedOptionParser.java:78)
	at com.oracle.svm.hosted.option.HostedOptionParser.<init>(HostedOptionParser.java:62)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:238)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:509)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:115)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:541)
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
	at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1647)
	at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1397)
	at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1358)
	at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1317)
	at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1829)

This is on macOS 10.15.7 with the following Java version:

openjdk version "11.0.4" 2019-07-16 LTS
OpenJDK Runtime Environment Corretto-11.0.4.11.1 (build 11.0.4+11-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.4.11.1 (build 11.0.4+11-LTS, mixed mode)

@borkdude
Copy link
Author

borkdude commented Nov 21, 2020

@st3fan Could you try 20.2.0?

@st3fan
Copy link

st3fan commented Nov 21, 2020

I tried 20.2.0 and that seems to work correctly. I end up with:

-rwxr-xr-x  1 stefan  staff  27466344 Nov 21 09:10 tetris*

And I can run and play that version.

You did not mention the platform in this issue - do you want me to give it a try on Linux too?

@borkdude
Copy link
Author

@st3fan Which branch of https://github.com/borkdude/console-tetris have you compiled?

@st3fan
Copy link

st3fan commented Nov 23, 2020

On the pod-babashka-lanterna branch, the project compiles and runs - the game runs, bricks are falling down. However, it doesn't handle terminal interactions well:

  • It is printing raw color escape codes to the terminal
  • It is not responding to key input

Is that the behaviour you saw too?

@borkdude
Copy link
Author

@st3fan That's what I'm seeing too. Sorry for the late reply. I just updated the pod-babashka-lanterna branch to GraalVM 20.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants