drrb / rust-netbeans

NetBeans Rust plugin
GNU General Public License v3.0
52 stars 20 forks source link

Doesn't package on linux #6

Closed nukesparrow closed 9 years ago

nukesparrow commented 9 years ago

Maven output:

$ mvn -e package [INFO] Error stacktraces are turned on. [INFO] Scanning for projects... [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building Rust NetBeans Plugin 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- antlr4-maven-plugin:4.0:antlr4 (default) @ rust-netbeans --- [INFO] ANTLR 4: Processing source directory /home/portable/tmp/rust-netbeans/src/main/antlr4 [INFO] Processing grammar: com/github/drrb/rust/netbeans/parsing/Rust.g4 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.719s [INFO] Finished at: Fri Nov 21 12:15:46 YEKT 2014 [INFO] Final Memory: 14M/444M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.antlr:antlr4-maven-plugin:4.0:antlr4 (default) on project rust-netbeans: Execution default of goal org.antlr:antlr4-maven-plugin:4.0:antlr4 failed: Index: 0, Size: 0 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.antlr:antlr4-maven-plugin:4.0:antlr4 (default) on project rust-netbeans: Execution default of goal org.antlr:antlr4-maven-plugin:4.0:antlr4 failed: Index: 0, Size: 0 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 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 org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.antlr:antlr4-maven-plugin:4.0:antlr4 failed: Index: 0, Size: 0 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:638) at java.util.ArrayList.get(ArrayList.java:414) at org.antlr.v4.misc.OrderedHashMap.getElement(OrderedHashMap.java:46) at org.antlr.v4.analysis.LeftRecursiveRuleTransformer.setAltASTPointers(LeftRecursiveRuleTransformer.java:241) at org.antlr.v4.analysis.LeftRecursiveRuleTransformer.translateLeftRecursiveRule(LeftRecursiveRuleTransformer.java:162) at org.antlr.v4.analysis.LeftRecursiveRuleTransformer.translateLeftRecursiveRules(LeftRecursiveRuleTransformer.java:89) at org.antlr.v4.semantics.SemanticPipeline.process(SemanticPipeline.java:94) at org.antlr.v4.Tool.processNonCombinedGrammar(Tool.java:399) at org.antlr.v4.Tool.process(Tool.java:384) at org.antlr.mojo.antlr4.Antlr4Mojo$CustomTool.process(Antlr4Mojo.java:461) at org.antlr.v4.Tool.processGrammarsOnCommandLine(Tool.java:343) at org.antlr.mojo.antlr4.Antlr4Mojo.execute(Antlr4Mojo.java:272) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) ... 20 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

pythoneer commented 9 years ago

Same here

vbmacher commented 9 years ago

When used antlr4-maven-plugin and dependency antlr4 in pom.xml version 4.5 (current version), errors are different. I used cygwin for the compilation.

$ mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Rust NetBeans Plugin 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- antlr4-maven-plugin:4.3:antlr4 (default) @ rust-netbeans ---
[INFO] ANTLR 4: Processing source directory D:\projects\rust-netbeans-master\src\main\antlr4
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:42:7: syntax error: '"' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [42:7]: syntax error: '"' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:42:16: syntax error: '"' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [42:16]: syntax error: '"' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:42:20: syntax error: '"' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [42:20]: syntax error: '"' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:42:28: syntax error: '"' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [42:28]: syntax error: '"' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:366:4: syntax error: '_' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [366:4]: syntax error: '_' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:366:5: syntax error: '_' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [366:5]: syntax error: '_' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:447:4: syntax error: '_' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [447:4]: syntax error: '_' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:447:5: syntax error: '_' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [447:5]: syntax error: '_' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:596:4: syntax error: '_' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [596:4]: syntax error: '_' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:596:5: syntax error: '_' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [596:5]: syntax error: '_' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:699:0: syntax error: '_' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [699:0]: syntax error: '_' came as a complete surprise to me
[ERROR] error(50): D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4:699:1: syntax error: '_' came as a complete surprise to me
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\com\github\drrb\rust\netbeans\parsing\Rust.g4 [699:1]: syntax error: '_' came as a complete surprise to me

UPDATE: When quotes are removed in line 42 in file Rust.g4, and also __LOG is replaced with LOG everywhere, another errors appear:

[ERROR] error(156): xidcont.g4:762:15: invalid escape sequence
[ERROR] D:\projects\rust-netbeans-master\src\main\antlr4\xidcont.g4 [762:15]: invalid escape sequence
...

I found the issue here: https://github.com/antlr/antlr4/issues/276. I am not familiar with ANTL4, but I tried to play with it so I had to remove all statements in files xidstart.g4 and xidcont.g4 beginning with \U.... Then the grammar is finally processed and code compiles well.

However, there are other errors:

[INFO] NBM Plugin generates manifest
[INFO] Adding on module's Class-Path:
[INFO]     org.antlr:antlr4:jar:4.5
[INFO]     org.antlr:antlr4-runtime:jar:4.5
[INFO]     org.abego.treelayout:org.abego.treelayout.core:jar:1.0.1
[INFO]     org.antlr:antlr-runtime:jar:3.5.2
[INFO]     org.antlr:ST4:jar:4.0.8
[INFO]     org.pegdown:pegdown:jar:1.4.0
[INFO]     org.parboiled:parboiled-java:jar:1.1.5
[INFO]     org.parboiled:parboiled-core:jar:1.1.5
[INFO]     org.ow2.asm:asm:jar:4.1
[INFO]     org.ow2.asm:asm-tree:jar:4.1
[INFO]     org.ow2.asm:asm-analysis:jar:4.1
[INFO]     org.ow2.asm:asm-util:jar:4.1
[INFO]     com.google.guava:guava:jar:14.0.1
[ERROR] Project uses classes from transitive module org.netbeans.api:org-netbeans-libs-javacapi:jar:RELEASE74-BETA which will not be accessible at runtime.
[INFO]     To fix the problem, add this module as direct dependency. For OSGi bundles that are supposed to be wrapped in NetBeans modules, use the useOSGiDependencies=false parameter
drrb commented 9 years ago

Hi All, thanks for the investigation and sorry about the delay. I've been in the process of replacing the ANTLR-based lexer/parser with a native one that uses the Rust compiler directly. It's in master now, and works well on OSX (the main OS I develop on). It also compiles properly on Linux (a step forward, at least!). Unfortunately it doesn't seem to load the native component on Linux properly (see #7). I'll keep investigating, and aiming to get it running on Linux. If anyone is able to work out why the native component is not loading properly on Linux, I'd love to hear from you! Meanwhile, I'll close this issue (the ANTLR issue is solved) and track any progress on #7.