Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. Pull request: #1729
- Loading branch information