-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Universal Main #1729
Universal Main #1729
Conversation
We have a Java-based client for faster speed up. With this change we can now rudimentary detect if we should not run in client-mode because the user said so (e.g. (-i, --no-server) or we can't start the server.
Also more refactoring to share logic. Added --bsp to non-server selectors.
This is a great improvement for Mill. I tested on my biggest project and I didn't notice any problem. I'd say to merge this and let users test it before releasing |
The documentation still says that installing Mill via coursier is unsupported:
https://com-lihaoyi.github.io/mill/mill/Intro_to_Mill.html#_coursier_unsupported When this PR is merged is are the docs still right on this or should they be updated? If other blocking issues exist where are these issues filed? The only issue I found is this in coursier's repo which directs to this PR. |
This is a good question. I didn't follow recent changes in coursier and it's installable apps. If there is only one Mill app which is running the Mill client, than we are closer to remove that notice. It needs further review though, e.g. whether handling of |
Taking into account com-lihaoyi/mill#1729 in particular (single entrypoint).
It doesn't for now. |
I think coursier/apps#166 is not doing the right thing. The properties are not meant to be loaded by the Mill client JVM. Mill client automatically loads the properties file to start the server process. But in case we don't want a server (e.g. options
|
Taking into account com-lihaoyi/mill#1729 in particular (single entrypoint).
This PR is an attempt to improve the startup process of Mill. Currently, to run in different modes (client/server, standalone/no-server) we use different entry points which reside in different classes. Also, the client main is implemented in pure Java to improve the startup time of the client (by keep classloading at a minimum). To reflect the different entry points, we currently need a rather sophisticated start script. Although this PR does not simplify the process as such, it simplifies it's user side by supporting all modes through only one main class, the
mill.main.client.MillClientMain
. That way the good startup times in client mode remain.Because we handle all modes in a single point, we can better handle server startup issues. E.g. we can now gracefully fall back to a in-process or sub-process runner when the server runner can not be properly started. This should improve the user experience on some Windows setups and newer M1 Macs a lot.
I didn't removed the complexity of the startup script for now, but simply ensured it always calls the client main.
The client main now ensures that custom JVM properties (
.mill-jvm-opts
) are properly applied in case we can't start the server and will, if necessary, start in a sub-process (with properly applied JVM options) instead of in-process.The
.mill-version
is currently not handled (as before), but there is no reason that we could not detect a mismatch and even implement fetching and starting of another version in future.So, this PR should also improve the way Mill can be embedded into other tools or launcher, like coursier.
I have no idea how to test all this automatically, so I tried to test as much locally as possible, but any help in testing this, especially in edge cases like special environments, high load scenarios, many mill server instances (e.g. with different JVMs) would be really appreciated.