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

rebel-readline does not work when compiled with Graal native-image #173

Open
dundalek opened this issue May 2, 2020 · 0 comments
Open
Labels

Comments

@dundalek
Copy link
Owner

dundalek commented May 2, 2020

I tried to compile the rebel-readline frontend with Graal native-image in the feature/sci-rebel branch. When running the binary it fails with following error:

May 02, 2020 4:55:07 PM org.jline.utils.Log logr
WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
Exception in thread "main" java.lang.NullPointerException
	at java.io.Reader.<init>(Reader.java:167)
	at org.jline.utils.InputStreamReader.<init>(InputStreamReader.java:135)
	at org.jline.utils.InfoCmp.getCapabilitiesByName(InfoCmp.java:518)
	at org.jline.utils.InfoCmp.parseInfoCmp(InfoCmp.java:569)
	at org.jline.terminal.impl.AbstractTerminal.parseInfoCmp(AbstractTerminal.java:176)
	at org.jline.terminal.impl.DumbTerminal.<init>(DumbTerminal.java:102)
	at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:350)
	at org.jline.terminal.TerminalBuilder.build(TerminalBuilder.java:219)
	at rebel_readline.jline_api$create_terminal.invokeStatic(jline_api.clj:62)
	at rebel_readline.jline_api$create_terminal.doInvoke(jline_api.clj:59)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at closh.zero.frontend.sci$repl.invokeStatic(sci.clj:127)
	at closh.zero.frontend.sci$repl.invoke(sci.clj:126)
	at closh.zero.frontend.sci$_main.invokeStatic(sci.clj:171)
	at closh.zero.frontend.sci$_main.doInvoke(sci.clj:166)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at closh.zero.frontend.sci.main(Unknown Source)

The reason seems to be that jline3 library tries to load terminal info resources using relative path which graal does not seem to support: oracle/graal#2250.

I tried to change the resource loading to use absolute path in local version of jline. To use the local jline-terminal version I added following into deps.edn:

{:deps
 { ...
  com.bhauman/rebel-readline {:mvn/version "0.1.4"
                              :exclusions [org.jline/jline-terminal]}
  org.jline/jline-terminal {:local/root "/local/path/to/jline3/terminal"}}}

But then I get (I run Java11, not sure why it is trying to pick up 9 profile):

Error building classpath. 1 problem was encountered while building the effective model for org.jline:jline-parent:3.12.2-SNAPSHOT
[ERROR] Failed to determine Java version for profile java9 @

org.apache.maven.model.building.ModelBuildingException: 1 problem was encountered while building the effective model for org.jline:jline-parent:3.12.2-SNAPSHOT
[ERROR] Failed to determine Java version for profile java9 @

	at org.apache.maven.model.building.DefaultModelProblemCollector.newModelBuildingException(DefaultModelProblemCollector.java:197)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:481)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:423)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:413)
	at clojure.tools.deps.alpha.extensions.pom$read_model.invokeStatic(pom.clj:62)
	at clojure.tools.deps.alpha.extensions.pom$read_model.invoke(pom.clj:53)
	at clojure.tools.deps.alpha.extensions.pom$read_model_file.invokeStatic(pom.clj:67)
	at clojure.tools.deps.alpha.extensions.pom$read_model_file.invoke(pom.clj:65)
	at clojure.tools.deps.alpha.extensions.pom$eval822$fn__824.invoke(pom.clj:103)
	at clojure.lang.MultiFn.invoke(MultiFn.java:244)
	at clojure.tools.deps.alpha$expand_deps$fn__1161.invoke(alpha.clj:192)
	at clojure.tools.deps.alpha$expand_deps.invokeStatic(alpha.clj:191)
	at clojure.tools.deps.alpha$expand_deps.invoke(alpha.clj:169)
	at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:237)
	at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:217)
	at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invokeStatic(make_classpath2.clj:55)
	at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invoke(make_classpath2.clj:47)
	at clojure.tools.deps.alpha.script.make_classpath2$run_core.invokeStatic(make_classpath2.clj:81)
	at clojure.tools.deps.alpha.script.make_classpath2$run_core.invoke(make_classpath2.clj:72)
	at clojure.tools.deps.alpha.script.make_classpath2$run.invokeStatic(make_classpath2.clj:101)
	at clojure.tools.deps.alpha.script.make_classpath2$run.invoke(make_classpath2.clj:95)
	at clojure.tools.deps.alpha.script.make_classpath2$_main.invokeStatic(make_classpath2.clj:146)
	at clojure.tools.deps.alpha.script.make_classpath2$_main.doInvoke(make_classpath2.clj:118)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.core$apply.invokeStatic(core.clj:665)
	at clojure.main$main_opt.invokeStatic(main.clj:514)
	at clojure.main$main_opt.invoke(main.clj:510)
	at clojure.main$main.invokeStatic(main.clj:664)
	at clojure.main$main.doInvoke(main.clj:616)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.main.main(main.java:40)

Not sure how can I proceed, I am not very familiar with building maven artifacts.

@dundalek dundalek added the bug label May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant