chipsalliance / firrtl

Flexible Intermediate Representation for RTL
https://www.chisel-lang.org/firrtl/
Apache License 2.0
721 stars 176 forks source link

(possible?) Windows compile issue #910

Open ducky64 opened 6 years ago

ducky64 commented 6 years ago

I get this error while trying to compile firrtl in sbt under Windows on two different machines. However, firrtl compiles fine under Linux, even using WSL on the same machine. I tried blowing away the entire firrtl repository as well as the entire .ivy2 cache and versions of firrtl in the .ivy2 local.

Anyone else have issues building firrtl under Windows?

[error] C:\GitHub\firrtl\target\scala-2.12\src_managed\main\firrtl\antlr\FIRRTLBaseVisitor.java:13:14: FIRRTLBaseVisitor is already defined as object FIRRTLBaseVisitor
[error] public class FIRRTLBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements FIRRTLVisitor<T> {
[error]              ^
[error] C:\GitHub\firrtl\target\scala-2.12\src_managed\main\firrtl\antlr\FIRRTLLexer.java:16:14: FIRRTLLexer is already defined as object FIRRTLLexer
[error] public class FIRRTLLexer extends Lexer {
[error]              ^
[error] C:\GitHub\firrtl\target\scala-2.12\src_managed\main\firrtl\antlr\FIRRTLParser.java:13:14: FIRRTLParser is already defined as object FIRRTLParser
[error] public class FIRRTLParser extends Parser {
[error]              ^
[error] C:\GitHub\firrtl\target\scala-2.12\src_managed\main\firrtl\antlr\FIRRTLVisitor.java:12:18: FIRRTLVisitor is already defined as object FIRRTLVisitor
[error] public interface FIRRTLVisitor<T> extends ParseTreeVisitor<T> {
[error]                  ^
[error] four errors found
[error] C:\GitHub\firrtl\target\scala-2.12\src_managed\main\firrtl\antlr\FIRRTLBaseVisitor.java:13:14: FIRRTLBaseVisitor is already defined as object FIRRTLBaseVisitor
[error] public class FIRRTLBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements FIRRTLVisitor<T> {
[error]              ^
[error] C:\GitHub\firrtl\target\scala-2.12\src_managed\main\firrtl\antlr\FIRRTLLexer.java:16:14: FIRRTLLexer is already defined as object FIRRTLLexer
[error] public class FIRRTLLexer extends Lexer {
[error]              ^
[error] C:\GitHub\firrtl\target\scala-2.12\src_managed\main\firrtl\antlr\FIRRTLParser.java:13:14: FIRRTLParser is already defined as object FIRRTLParser
[error] public class FIRRTLParser extends Parser {
[error]              ^
[error] C:\GitHub\firrtl\target\scala-2.12\src_managed\main\firrtl\antlr\FIRRTLVisitor.java:12:18: FIRRTLVisitor is already defined as object FIRRTLVisitor
[error] public interface FIRRTLVisitor<T> extends ParseTreeVisitor<T> {
[error]                  ^
[info] No documentation generated with unsuccessful compiler run
[warn] two warnings found
[error] four errors found
[error] (Compile / compileIncremental) Compilation failed
[error] (Scalaunidoc / doc) Scaladoc generation failed
[error] Total time: 30 s, completed Oct 5, 2018 12:43:30 PM

Type of issue: bug report

If the current behavior is a bug, please provide the steps to reproduce the problem:

What is the use case for changing the behavior?

Impact: unknown

Development Phase: something is broken and I don't know what

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. Stack Overflow, gitter, etc) See above for stack trace.

jackkoenig commented 6 years ago

Are you using an IDE? We've previously had similar issues on MacOS using IntelliJ

ducky64 commented 6 years ago

No, this is with just sbt.

borancar commented 5 years ago

I can reproduce it on my Windows 10 machine. All it takes is a fresh clone followed by a sbt assembly.

fire3 commented 5 years ago

I have the same problem on my Windows 10 machine with fresh installed Oracle JDK8 and SBT tools.

qiner199 commented 5 years ago

I have the same problem ,anyone know how to solve it

ducky64 commented 5 years ago

I haven't found a good solution, but here are some workarounds:

Trudddddy commented 5 years ago

I have the same problem on win7 and fedora29. and get a temporary solution from a kind-hearted guy, and I also share it with you. When the error comes up compiling firrtl, remove other files except FirrtlProtos.java in firrtl\target\streams\protobuf\protobufGenerate\$global\streams\protobuf_2.12\out-cache, then re-compile, it will pass and you will notice the java files to be compiled are reduced from 9 to 5. Hope anyone can find the root cause for this problem.

ThomasPDye commented 5 years ago

I have the same problem on win7 and fedora29. and get a temporary solution from a kind-hearted guy, and I also share it with you. When the error comes up compiling firrtl, remove other files except FirrtlProtos.java in firrtl\target\streams\protobuf\protobufGenerate$global\streams\protobuf_2.12\out-cache, then re-compile, it will pass and you will notice the java files to be compiled are reduced from 9 to 5. Hope anyone can find the root cause for this problem.

It may compile but it doesn't pass the tests.

banditos13 commented 5 years ago

sbt -mem 2048 ++2.11.12 publishLocal

zengjianjiang commented 4 years ago

The problem can be solved by using AdoptOpenJDK prebuild windows binaries. I got the same problem when I use Oracle JAVA 1.8.0_231 in my win10 x64 machine. After installing AdoptOpenJDK 1.8.0_242 instead, the build was successful.