Closed lefou closed 2 years ago
Mostly fixed in #791 😃
Works correctly but pipe returns Failed to connect to server
.. (with exit code 1)
I'll try to find more time to debug that also.
Is there any chance of getting some more background as to what the issue here is?
874
What if you are not running on WSL for windows. I'm also trying to get this working at a powershell or cmd prompt. Things work with -i , but why is it needed?
You'll have to investigate and tell us if it's needed or not, and why.
If I could understand a bit more what -i
is supposed to enable maybe I can understand what fails on windows. At worst though we should probably just make -i
the default for windows. I'm also not sure how we discover WSL
vs normal windows, and if that distinction is needed.
Also it should be noted that WSL2
has a different kernel from WSL1
... I can take a look at how it executes in WSL2
as I have a machine with that installed.
Mill -i
forces mill to run in a single Java process (entry point: MillMain
). By default, it will run two processes, a client (entry point: MillClientMain
) and a server process, which is started by the client in case there is no free running one. The communication between these two processes is the culprit on Windows. Also, because of the unclear implications of the name --interactive
, we deprecated -i
and introduced two new options, see #927.
@DamianReeves I did some fixing in #1230
Can you please try to build latest mill and test if it works?
Instructions here:
https://gitter.im/lihaoyi/mill?at=605dbef03b9278255bd52443
mill foo.compile
, mill foo.run
) and checked project/out/mill-worker-.....=-1/run
, saw the command updating in there (and the commands completed sucessfully)
Just doing a little more testing (running mill at the same time on two different projects). I didn't look into the "locked pipe" stuff, but I thought each server/worker gets its own directory. Package structure of the workers looks the same in MacOS and Windows anyway.... so I'd guesss each package could have 5 independent servers/workers. Will update comment and tag when I know if there's a problem/if ticket can be closed
Thread.sleep(10_000)
, 2x mill foo.run
and 1x mill foo.compile
→ 3 workers, all finemill moduleName.run
in each project
mill-worker-y4i2xmtm5Hv8lzskMkPKIWcZtwM=-<index>
. I'm not sure what decides this naming (I thought it was a hash of the code/module names or so), but they all seem like independent workers.@sake92 Thanks for your merge! I don't see the error you mentioned 🎉 @lefou I believe you can close this ticket :)
@IdiosApps now we use junixsocket library which supports native Windows10 implementation of UNIX pipes, so it is much more reliable, thankfully. Glad you confirmed everything works! 🥳
Btw, you get at most 5 servers worker per JVM+project_path (if one is busy, another one will be instantiated).
See https://github.com/com-lihaoyi/mill/blob/main/main/client/src/mill/main/client/MillClientMain.java#L108
@sake92 Nice, I'll have a little look into UNIX pipes. I'm not sure what they are in this context - I guess like sockets, from what I've seen.
Ah that makes sense, thank you for the explanation and the link! I was curious about worker folders today when looking into this issue I opened.
Closing this one, as Windows now properly supports client-server-mode. Also Mill in general is able to recover from am failing server connection by running in-process.
AFAIK, mill under Windows will only work when started with
-i
option. Until someone comes with proper fix it makes much sense to disable mill server mode under Windows.See discussion https://gitter.im/lihaoyi/mill?at=5e5c146fd045e2582509fba4