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.04k stars 331 forks source link

java.io.IOException: GetOverlappedResult() failed for read operation: 233 #1310

Closed nornagon closed 2 years ago

nornagon commented 3 years ago

When running Mill on Windows I get this error after every command. It seems like the command is otherwise successful, though...

java.io.IOException: GetOverlappedResult() failed for read operation: 233
        at org.scalasbt.ipcsocket.Win32NamedPipeSocket$Win32NamedPipeSocketInputStream.read(Win32NamedPipeSocket.java:161)
        at java.io.InputStream.read(Unknown Source)
        at org.scalasbt.ipcsocket.Win32NamedPipeSocket$Win32NamedPipeSocketInputStream.read(Win32NamedPipeSocket.java:134)
        at mill.main.client.ProxyStreamPumper.run(ProxyStreamPumper.java:24)
        at java.lang.Thread.run(Unknown Source)
> java -version
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)

Windows 10 build 19041.928

lefou commented 3 years ago

This is a know issue and the reason why --no-server option is suggested for mill on Windows.

nornagon commented 3 years ago

Where is that suggested? I didn't see any reference to that option in the documentation or README 🤔

lefou commented 3 years ago

Where is that suggested? I didn't see any reference to that option in the documentation or README thinking

https://com-lihaoyi.github.io/mill/mill/Intro_to_Mill.html#_windows

In some environments (such as WSL), mill might have to be run without a server (using -i, --interactive, --no-server, or --repl.)

nornagon commented 3 years ago

Hm, I'm not using WSL. Perhaps that documentation could be updated to more clearly include Windows?

sake92 commented 3 years ago

@nornagon does it happen with the latest version? (0.9.9)

unkarjedy commented 2 years ago

Reproduced it on Windows with 0.10.0 This was my first experience with mill. All I did is run ./mill mill.bsp.BSP/install on this project https://github.com/chpache/test-intellij_scala_2and3 (updated version to 0.10.0)

$ ./mill mill.bsp.BSP/install
...
Compiling ...\build.sc
[1/1] mill.bsp.BSP.install
Creating BSP connection file: ...\.bsp\mill-bsp.json
Exception in thread "proxyInputStreamThroughPumper" java.lang.RuntimeException: java.io.IOException: GetOverlappedResult() failed for read operation: 233
        at mill.main.client.InputPumper.run(InputPumper.java:51)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: GetOverlappedResult() failed for read operation: 233
        at org.scalasbt.ipcsocket.Win32NamedPipeSocket$Win32NamedPipeSocketInputStream.read(Win32NamedPipeSocket.java:161)
        at java.base/java.io.InputStream.read(InputStream.java:205)
$ java -version
java version "11.0.3" 2019-04-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.3+12-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.3+12-LTS, mixed mode)

Windows Version 10.0.19041 Build 19041

sake92 commented 2 years ago

There is this new(to me) library that we can investigate instead of sbt-ipcsocket: https://github.com/kohlschutter/junixsocket
I'll try when I find some spare time.

nemoo commented 2 years ago

Reproduced it on Windows with 0.10.2

I was just trying to install mill manually from: https://github.com/com-lihaoyi/mill/releases/download/0.10.2/0.10.2-assembly

Then I renamed the file to mill.bat and ran it:

C:\dev\mill> .\mill.bat
Exception in thread "proxyInputStreamThroughPumper" java.lang.RuntimeException: java.io.IOException: GetOverlappedResult() failed for read operation: 233
        at mill.main.client.InputPumper.run(InputPumper.java:51)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: GetOverlappedResult() failed for read operation: 233
        at org.scalasbt.ipcsocket.Win32NamedPipeSocket$Win32NamedPipeSocketInputStream.read(Win32NamedPipeSocket.java:161)
        at java.base/java.io.InputStream.read(InputStream.java:205)
        at mill.main.client.InputPumper.run(InputPumper.java:36)
        ... 1 more

Windows 10 Version H2 Build 19042.1586

lefou commented 2 years ago

@nemoo Thanks for the update.

@sake92 Yeah, it's worth a try.

Meanwhile the Mill (client) main has the ability to recover from server start failures and can start in-process instead. Looks like the missing part here is to transport the server communication exception form the pumper thread to the main thread, so we can actually handle it. This is not a fix, but a very useful workaround.

sake92 commented 2 years ago

@nornagon @unkarjedy @nemoo Can you try 0.10.3-15-d3d866-assembly?
I made some improvements

nemoo commented 2 years ago

@sake92 works for me! Just tried https://github.com/com-lihaoyi/mill/releases/download/0.10.3/0.10.3-15-d3d866-assembly on Windows and the error did not occur anymore.