chipsalliance / playground

chipyard in mill :P
72 stars 34 forks source link

firrtlCrossModule.antlr4Path java.util.NoSuchElementException: empty.head #52

Open vowstar opened 1 year ago

vowstar commented 1 year ago

Checklist

What is the current behavior?

build with error firrtlCrossModule.antlr4Path java.util.NoSuchElementException: empty.head

error massage:

[23/376] foreign-modules.dependencies.firrtl.build.firrtlCrossModule.antlr4Path 
1 targets failed
firrtlCrossModule.antlr4Path java.util.NoSuchElementException: empty.head
    scala.collection.immutable.Vector.head(Vector.scala:279)
    ammonite.$file.dependencies.firrtl.build$firrtlCrossModule.$anonfun$antlr4Path$4(build.sc:108)
    scala.collection.immutable.List.flatMap(List.scala:293)
    scala.collection.immutable.List.flatMap(List.scala:79)
    ammonite.$file.dependencies.firrtl.build$firrtlCrossModule.$anonfun$antlr4Path$3(build.sc:106)

What is the expected behavior?

Build without error.

Steps to Reproduce

  1. install antlr:2 and antlr:4 on gentoo
  2. clone https://github.com/chipsalliance/playground
  3. run mill sanitytests.rocketchip

After a while, the following error will appear firrtlCrossModule.antlr4Path java.util.NoSuchElementException: empty.head

After careful analysis, I found that the version information of antlr2 is printed on stderr, which will cause os.proc(f).call(check = false).out.lines.head.split(" ").last fails because the lines are empty.

I will submit a patch to fix this issue later.

Your environment

External Information

None