Skip to content

Use GraalVM Native Image for Mill Client (1500USD Bounty) #4007

Description

@lihaoyi

From the maintainer Li Haoyi: I'm putting a 1500USD bounty on this issue, payable by bank transfer on a merged PR implementing this.


Mill's client is currently a Java/JVM application. This means it suffers from the normal JVM slow startup (>100ms) and warmup times, and it prevents us from moving more logic into the client otherwise it will become even slower.

We should explore using GraalVM to generate cross-platform native image launchers for the Mill client, and integrate that into our ./mill script. This will allow us to make the client smarter:

  • Using Scala rather than Java
  • Parsing command line arguments in the client, which would remove the -i must be passed as first argument restriction
  • Allow the client to use Coursier to bootstrap the JVM for the server to use, i.e. Allow Mill to bootstrap its own Java version #3951

For this bounty, the success criteria of this issue is twofold:

  1. An example in the Mill documentation of the recommended way to use Graal native image to compile a native binary from a JavaModule, ScalaModule, or KotlinModule

  2. Have a Mill generate a native image version of the runner.client jar on different operating systems and CPU architectures (linux,mac,windows X arm,intel) that is able to replace the current JVM client launcher to launch and manage the Mill backend server process, using the same Java code that runner.client is implemented with today.

Reference https://blogs.oracle.com/developers/post/building-cross-platform-native-images-with-graalvm

Metadata

Metadata

Assignees

No one assigned

    Labels

    bountyThe fix/close of this issue is rewarded with a bounty

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions