com-lihaoyi / mill

Mill is a fast JVM build tool that supports Java and Scala. 2-3x faster than Gradle and 5-10x faster than Maven for common workflows, Mill aims to make your project’s build process performant, maintainable, and flexible
https://mill-build.org/
MIT License
2.05k stars 333 forks source link

First compile error after changed the build.sc #3273

Open Huelse opened 2 months ago

Huelse commented 2 months ago

mill version:

Mill Build Tool version 0.11.8
Java version: 22.0.1, vendor: Oracle Corporation, runtime: /usr/local/jvm/graalvm-jdk-22.0.1+8.1/Contents/Home
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "Mac OS X", version: 14.5, arch: x86_64

scala version: 3.4.2

error log:

mill __.compile
[176/1237] libs.wx.compile
[info] compiling 1 Scala source to /Users/max/Work/lime-backend/out/libs/wx/compile.dest/classes ...
[info] done compiling
[1237/1237] modules.order.services.compile
An unexpected error occurred
Exception in thread "MillServerActionRunner" java.nio.file.NoSuchFileException: /Users/max/Work/lime-backend/out/libs/wx/compile.json
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:379)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:431)
    at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
    at java.base/java.nio.file.Files.newInputStream(Files.java:159)
    at ujson.Readable$$anon$1.transform(Readable.scala:26)
    at ujson.Readable$.transform(Readable.scala:15)
    at ujson.Readable$.transform(Readable.scala:13)
    at upickle.core.BufferedValue$.maybeSortKeysTransform(BufferedValue.scala:76)
    at ujson.package$.transform(package.scala:8)
    at ujson.package$.transform(package.scala:13)
    at ujson.package$.$anonfun$read$1(package.scala:18)
    at upickle.core.TraceVisitor$.withTrace(TraceVisitor.scala:18)
    at ujson.package$.read(package.scala:18)
    at mill.main.RunScript$.$anonfun$evaluateNamed$1(RunScript.scala:62)
    at scala.collection.immutable.List.map(List.scala:251)
    at scala.collection.immutable.List.map(List.scala:79)
    at mill.main.RunScript$.evaluateNamed(RunScript.scala:58)
    at mill.main.RunScript$.$anonfun$evaluateTasksNamed$2(RunScript.scala:26)
    at scala.util.Either.map(Either.scala:390)
    at mill.main.RunScript$.evaluateTasksNamed(RunScript.scala:26)
    at mill.runner.MillBuildBootstrap$.evaluateWithWatches(MillBuildBootstrap.scala:399)
    at mill.runner.MillBuildBootstrap.$anonfun$processFinalTargets$3(MillBuildBootstrap.scala:308)
    at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)

When I add a dep for exist module, it always compile fail at first time, clean it or re-compile will work fine. This can be stably reproduced.

lefou commented 2 months ago

Can you please provide a reproducer?