Open Futurile opened 4 years ago
I don't remember using FileSystemPreferences anywhere in the library and I can't find any reference to it in the whole source tree. So not sure why it's complaining about that. Can you try latest release/3.1 branch (compile from source) as well? The win32 implementation isn't present there.
@mabe02 The way they get pulled in is by code using java.uti.prefs.Preferences
, specifically, the userRoot()
and systemRoot()
methods of the class. Under the hood, a default implementation is provided for each platform (Linux, Windows, Darwin) - the FileSystemPreferences
one is the Linux implementation.
@Futurile We have recently added support for java.util.prefs
on the native-image side. It will probably end up in 20.3, but you can give it a shot if you can build GraalVM. Take a look at https://github.com/oracle/graal/issues/2063#issuecomment-663558679
@Futurile Have you had any success since? If so, please share.
@eureton I installed Graalvm 21.0.2 , Lanterna 3.1.1 and Clojure 10.1.3. Honestly, I'm having issues with Graal and with Lanterna so I cannot 100% specify that it doesn't work. Creating a UnixTerminal terminal directly works e.g def ^Terminal terminal (new ^Terminal UnixTerminal).
If I try and use DefaultTerminalFactory:
(def ^com.googlecode.lanterna.terminal.DefaultTerminalFactory termDefault (new DefaultTerminalFactory))
(def ^Terminal terminal (. termDefault createTerminal))
I get this:
Fatal error:java.lang.RuntimeException: java.lang.RuntimeException: There was an error linking the native image: Linker command exited with 1
Then I get this:
passtui.o:(.data+0x5c8): undefined reference to `Java_sun_java2d_loops_DrawGlyphListLCD_DrawGlyphListLCD'
passtui.o:(.data+0xb40): undefined reference to `Java_sun_java2d_loops_DrawGlyphListAA_DrawGlyphListAA'
passtui.o:(.data+0xbb8): undefined reference to `Java_sun_java2d_loops_DrawGlyphList_DrawGlyphList'
collect2: error: ld returned 1 exit status
at com.oracle.svm.hosted.image.NativeBootImageViaCC.handleLinkerFailure(NativeBootImageViaCC.java:474)
at com.oracle.svm.hosted.image.NativeBootImageViaCC.write(NativeBootImageViaCC.java:441)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:685)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:476)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
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:1676)
at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1426)
at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1387)
at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1374)
at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1858)
I've had to add --allow-incomplete-classpath
which points to there being issues in my set-up which I can't seem to find the solution for. In summary, please try the set-up above and see if it works for you. Apologies that I can't be more definitive.
Have you tried method "createHeadlessTerminal" (instead of createTerminal) from DefaultTerminalFactory?
That's the javadoc of it: /**
That sounds like your problem to me, but I'm not much into graal and I understand only about 30% of the question...
On Mon, Mar 15, 2021 at 1:56 PM Steve George @.***> wrote:
@eureton https://github.com/eureton I installed Graalvm 21.0.2 , Lanterna 3.1.1 and Clojure 10.1.3. Honestly, I'm having issues with Graal and with Lanterna so I cannot 100% specify that it doesn't work. Creating a UnixTerminal terminal directly works e.g def ^Terminal terminal (new ^Terminal UnixTerminal).
If I try and use DefaultTerminalFactory:
(def ^com.googlecode.lanterna.terminal.DefaultTerminalFactory termDefault (new DefaultTerminalFactory)) (def ^Terminal terminal (. termDefault createTerminal))
I get this:
Fatal error:java.lang.RuntimeException: java.lang.RuntimeException: There was an error linking the native image: Linker command exited with 1
Then I get this:
passtui.o:(.data+0x5c8): undefined reference to
Java_sun_java2d_loops_DrawGlyphListLCD_DrawGlyphListLCD' passtui.o:(.data+0xb40): undefined reference to
Java_sun_java2d_loops_DrawGlyphListAA_DrawGlyphListAA' passtui.o:(.data+0xbb8): undefined reference to `Java_sun_java2d_loops_DrawGlyphList_DrawGlyphList' collect2: error: ld returned 1 exit status at com.oracle.svm.hosted.image.NativeBootImageViaCC.handleLinkerFailure(NativeBootImageViaCC.java:474) at com.oracle.svm.hosted.image.NativeBootImageViaCC.write(NativeBootImageViaCC.java:441) at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:685) at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:476) at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) 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:1676) at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1426) at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1387) at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1374) at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1858)I've had to add --allow-incomplete-classpath which points to there being issues in my set-up which I can't seem to find the solution for. In summary, please try the set-up above and see if it works for you.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mabe02/lanterna/issues/499#issuecomment-799396838, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIDBMUWPVIQV7PYEW3J23DTDX7XDANCNFSM4OLDRY5A .
@avl42 I think you're right that this function was added for the use-case, thanks for that.
Not making much difference for me though, I get:
``passtui.o:(.data+0x480): undefined reference to
Java_sun_java2d_loops_DrawGlyphListLCD_DrawGlyphListLCD'
passtui.o:(.data+0x4b8): undefined reference to Java_sun_java2d_loops_DrawGlyphListAA_DrawGlyphListAA' passtui.o:(.data+0x648): undefined reference to
Java_sun_java2d_loops_DrawGlyphList_DrawGlyphList'
collect2: error: ld returned 1 exit status
at com.oracle.svm.hosted.image.NativeBootImageViaCC.handleLinkerFailure(NativeBootImageViaCC.java:474)
at com.oracle.svm.hosted.image.NativeBootImageViaCC.write(NativeBootImageViaCC.java:441)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:685)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:476)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Error: Image build request failed with exit status 1
Attached the whole of the build in case that's useful:
[buildoutput.txt](https://github.com/mabe02/lanterna/files/6170800/buildoutput.txt)
In that case, I fear, the culprit must be elsewhere...
What is the source of that "passtui" component? Does it use any other APIs other than lanterna?
On Fri, Mar 19, 2021 at 12:41 PM Steve George @.***> wrote:
@avl42 I think you're right that this function was added for the use-case, thanks for that.
Not making much difference for me though, I get:
passtui.o:(.data+0x648): undefined reference to `Java_sun_java2d_loops_DrawGlyphList_DrawGlyphList' collect2: error: ld returned 1 exit status at com.oracle.svm.hosted.image.NativeBootImageViaCC.handleLinkerFailure(NativeBootImageViaCC.java:474) at com.oracle.svm.hosted.image.NativeBootImageViaCC.write(NativeBootImageViaCC.java:441) at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:685) at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:476) at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) Error: Image build request failed with exit status 1 Attached the whole of the build in case that's useful: [buildoutput.txt](https://github.com/mabe02/lanterna/files/6170800/buildoutput.txt) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
The situation is that you can use Lanterna with GraalVM by directly creating a terminal (e.g. UnixTerminal). It would be nice if we could use the DefaultTerminalFactory
I think it's getting further into the compilation stage - but does fail eventually. I installed lanterna-3.2.0-SNAPSHOT
As far as reflection goes I have to tell it to defer these two classes:
If I delay these two classes to "run_time" I can get it a bit further, eventually it breaks down at:
This seems to refer to java.util.prefs not being supported, see https://github.com/oracle/graal/issues/2063. I tried adding:
-H:NativeLinkedOption='-lprefs'
This may or may not be helping to be honest: It compiles for longer but crashes and there's no obvious debug step. I guess questions are:
I'm using graalvm-ce-java11-20.1.0 with Java 11.0.7 on Ubuntu 16.04. Main files below for reference.
-- Makefile
-- Clojure source file
-- Lein project.clj file