satellite-of-love / elm-rugs

Programs to develop Elm programs at a higher level
6 stars 1 forks source link

`rug install` step seems to fail to load compiled rug #1

Closed Tuxified closed 7 years ago

Tuxified commented 7 years ago

Hi,

I wanted to try out elm-rugs, but I've run into an issue which is hard to debug/fix for me. I've installed rug-cli via homebrew, cloned the repo, did a yarn install inside the .atomist folder and the output of rug install (from repo root), looks like this:

~/Projects/experiments/elm-rugs {master *}$ rug install
Please update your Java™ Runtime Environment (JRE) from 1.8.0_25 to version 1.8.0_111 or newer.
Resolving dependencies for jessitron:elm-rugs (2.0.5·local) completed
Compiling source files of jessitron:elm-rugs (2.0.5·local) completed
Loading rugs of jessitron:elm-rugs (2.0.5·local) failed

--optimistic-types

I've also tried running rug install -V (to get verbose output) but the output is too large to scroll all the way back. As far as I can see all steps seem to succeed except loading the rugs. Tried to redirect the output to less or a file but that yields a different output (ex. rug install -V > error.log, error.log turns up almost empty)

I'm using OSX 10.10.5, rug-cli 1.0.0-m.6, JRE 1.8.0_25, yarn 0.24.5, node v6.10.3 (via nvm). Do you have any suggestions where/what the culprit might be?

jessitron commented 7 years ago

OK. Sorry about the terrible error message. This has to be some typescript compilation error.

Would you mind running rug install -X ? That's the (sadly, undocumented) option to display the stack trace.

Tuxified commented 7 years ago

Seems like somewhere down the chain, the wrong flag is used:

~/Projects/experiments/elm-rugs {master *}$ rug install -X
Please update your Java™ Runtime Environment (JRE) from 1.8.0_25 to version 1.8.0_111 or newer.
Resolving dependencies for jessitron:elm-rugs (2.0.5·local) completed
Compiling source files of jessitron:elm-rugs (2.0.5·local) completed
Loading rugs of jessitron:elm-rugs (2.0.5·local) failed

java.lang.IllegalArgumentException: --optimistic-types
    at jdk.nashorn.internal.runtime.options.Options$ParsedArg.<init>(Options.java:665)
    at jdk.nashorn.internal.runtime.options.Options.process(Options.java:460)
    at jdk.nashorn.api.scripting.NashornScriptEngine.<init>(NashornScriptEngine.java:157)
    at jdk.nashorn.api.scripting.NashornScriptEngineFactory.getScriptEngine(NashornScriptEngineFactory.java:169)
    at com.atomist.rug.runtime.js.JavaScriptContext.<init>(JavaScriptContext.scala:61)
    at com.atomist.project.archive.ArchiveRugResolver.com$atomist$project$archive$ArchiveRugResolver$$find(ArchiveRugResolver.scala:31)
    at com.atomist.project.archive.ArchiveRugResolver.<init>(ArchiveRugResolver.scala:48)
    at com.atomist.rug.cli.command.AbstractCompilingAndOperationLoadingCommand.lambda$createRugResolver$1(AbstractCompilingAndOperationLoadingCommand.java:69)
    at com.atomist.rug.cli.command.AbstractCompilingAndOperationLoadingCommand$$Lambda$72/35864696.run(Unknown Source)
    at com.atomist.rug.cli.output.ProgressReportingOperationRunner.run(ProgressReportingOperationRunner.java:22)
    at com.atomist.rug.cli.command.AbstractCompilingAndOperationLoadingCommand.createRugResolver(AbstractCompilingAndOperationLoadingCommand.java:67)
    at com.atomist.rug.cli.command.AbstractCompilingAndOperationLoadingCommand.run(AbstractCompilingAndOperationLoadingCommand.java:157)
    at com.atomist.rug.cli.command.AbstractCommand.run(AbstractCommand.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.atomist.rug.cli.command.ReflectiveCommandRunMethodRunner.invokeCommand(ReflectiveCommandRunMethodRunner.java:17)
    at com.atomist.rug.cli.command.ReflectiveCommandRunner.invokeReflectiveCommand(ReflectiveCommandRunner.java:93)
    at com.atomist.rug.cli.command.ReflectiveCommandRunner.invokeCommand(ReflectiveCommandRunner.java:262)
    at com.atomist.rug.cli.command.ReflectiveCommandRunner.runCommand(ReflectiveCommandRunner.java:60)
    at com.atomist.rug.cli.Runner.runCommand(Runner.java:93)
    at com.atomist.rug.cli.Runner.run(Runner.java:40)
    at com.atomist.rug.cli.Main.invokeRunner(Main.java:34)
    at com.atomist.rug.cli.Main.main(Main.java:25)

I tried grepping --optimistic-types on repo, different node folders and atomist repos, until I stumbled upon this commit: https://github.com/atomist/rug/commit/2964921f59779d4f69b6d46067628bc9150310bd I'll try building rug without that option enabled, see if it helps.

cdupuis commented 7 years ago

You have to update to a newer version of Java. The version you are using and up to 1.8.0_111 had bugs in the JavaScript support insides Nashorn.

Updating Java should fix that problem.

Tuxified commented 7 years ago

Installing a new version of Java (1.8.0_111) fixed my issue, thanks both for your help 🙌

jessitron commented 7 years ago

Thanks @cd and thank you Tonći for trying it! I stuck a thing in the README for this.