Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mill fail to connect to the server with apple silicon M1 #1098

Closed
parzival3 opened this issue Jan 6, 2021 · 5 comments
Closed

Mill fail to connect to the server with apple silicon M1 #1098

parzival3 opened this issue Jan 6, 2021 · 5 comments

Comments

@parzival3
Copy link

Step to reproduce the problem

curl -L https://github.com/lihaoyi/mill/releases/download/0.9.4/0.9.4-13-75bc5a > mill && chmod +x mill

and then

MILL_VERSION=0.9.4-13-75bc5a ./mill -h
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   650  100   650    0     0   2241      0 --:--:-- --:--:-- --:--:--  2233
100 58.0M  100 58.0M    0     0  1147k      0  0:00:51  0:00:51 --:--:-- 2148k
main.MillServerMain$.main(MillServerMain.scala:43)
	at mill.main.MillServerMain.main(MillServerMain.scala)
Exception in thread "main" java.lang.Exception: Failed to connect to server
	at mill.main.client.MillClientMain.run(MillClientMain.java:217)
	at mill.main.client.MillClientMain.main0(MillClientMain.java:146)
	at mill.main.client.MillClientMain.main(MillClientMain.java:99)

If I use the interactive version everything works 😃

MILL_VERSION=0.9.4-13-75bc5a mill -i -h                                                    
Incomplete argument -h --home <path> is missing a corresponding value
Expected Signature: Mill Build Tool
usage: mill [mill-options] [target [target-options]]
  --no-default-predef  Disable the default predef and run Ammonite with the minimal predef possible
  -s --silent          Make ivy logs go silent instead of printing though failures will still throw
                       exception
  -w --watch           Watch and re-run your scripts when they change
  --bsp                Run a BSP server against the passed scripts
  -c --code <str>      Pass in code to be run immediately in the REPL
  -h --home <path>     The home directory of the REPL; where it looks for config and caches
  -p --predef <path>   Lets you load your predef from a custom location, rather than the "default
                       location in your Ammonite home
[...]

@todor-kolev
Copy link

Hey @parzival3 what is "interactive version"?

@lefou
Copy link
Member

lefou commented Feb 3, 2021

mill -i is the interactive mode. But mill --no-server would be sufficient. Both disable the separate server process.

lefou added a commit that referenced this issue Feb 6, 2021
Various fixes only shown on Windows, probably also elsewhere.

* Fixed string stream writer/reader used for mill client-server communication, by using an explicit charset for byte conversion
* Avoid `java.nio.file.Paths.get(url.getFile())` in favour of `java.nio.file.Paths.get(url.toURI())` as the latter handles windows paths with leading drive letters well
* Improved CI setup for Windows
* Better run/spawn of Java sub-processes by selecting the same Java executable which is used by mill

We still have some CI failures on Windows, as we need some of these fixed in mill before we can benefit from it. Expect more PRs.

Probably related issues:
* #781
* #874
* #646
* #1098

Commits:

* CI: Added test on Windows

* Try a better handing of windows absolute paths
I hope to avoid a error like:
  Illegal char <:> at index 2: /D:/a/mill/mill/

* Improve string assertion message?

* More details in assertion error

* Use explicit charset for string-byte conversion

* Search java exe in same JAVA_HOME as mill is using

* CI: job deps

* check for Win

* Debug run java process

Pull request: #1146
@RickyTino
Copy link

Having the same issue on a VM (x86-64) running Ubuntu 20.04.
image

@lefou
Copy link
Member

lefou commented Feb 7, 2022

I've committed a potential fix for this (#1729), which is currently in release process. Until it's available, you can try the already mentioned --no-server Mill option to workaround the issue.

@lefou
Copy link
Member

lefou commented Mar 8, 2022

Once Mill 0.10.1 is out, no explicit -i or --no-server should be needed anymore. MIll is able to automatically fall back to in-process mode when the server-process mode isn't working for some reasons. Please report back if you still have issues.

@lefou lefou closed this as completed Mar 8, 2022
@lefou lefou added this to the 0.10.1 milestone Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants