OSCPU / chisel-playground

56 stars 25 forks source link

Add .mill-version file #7

Closed ngc7331 closed 8 months ago

ngc7331 commented 8 months ago

Add .mill-version file to fix the mill version to 0.11.6.

Motivation: When I try to run make verilog with the latest mill (0.11.7) (+openjdk11/17/19), the following error occurs:

$ make verilog
mkdir -p ./build
mill -i __.test.runMain Elaborate -td ./build
[build.sc] [49/53] compile 
[info] compiling 1 Scala source to /<REDACTED>/chisel-playground/out/mill-build/compile.dest/classes ...
[info] done compiling
[build.sc] [53/53] methodCodeHashSignatures 
Unknown argument: "-t"
Expected Signature: runMain
  --mainClass <str>
  args <str>...

make: *** [Makefile:11: verilog] Error 1

After drilling into the source code for mill and chisel, I'm guessing that the problem is caused by mill 0.11.7 changing the way it handles short arguments, treating -td as combined short arguments -t -d.

This was introduced by com-lihaoyi/mill/pull/2990, in which a mainargs module was updated from 0.5.4 to 0.6.1. This update included changes that allow short arguments and flags to be combined, refer to com-lihaoyi/mainargs/pull/102.

There are two temporary solutions to the problem, one is to replace -td with --target-dir in Makefile, and the other is to downgrade the mill to 0.11.6, which is the latest version without the problem.

In order to ensure the out-of-the-box nature of this repository, and to avoid similar issues of being broken by tool version updates in the future, I think adding a .mill-version file is a good idea, and thus issue this PR.