-
Notifications
You must be signed in to change notification settings - Fork 39
feat: pluggable runner jvms #1522
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
Conversation
feat(runner): implement espresso-based runner feat(runner): implement in-proc and subproc jvm runners test(runner): add tests for jvm runners Signed-off-by: Sam Gammon <sam@elide.dev>
Signed-off-by: Sam Gammon <sam@elide.dev>
| versions.java.language = 22 | ||
| versions.java.language = 21 | ||
| versions.java.toolchain = 24 | ||
| versions.java.minimum = 22 | ||
| versions.java.target = 22 | ||
| versions.java.minimum = 21 | ||
| versions.java.target = 21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darvld note for IDEA work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only really need to change the target for tooling, core, and base, but this might be better for the sake of consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a pluggable, SPI-based Runner interface with two JVM implementations and integrates them into the CLI.
- Add
RunnerSPI and service loader support. - Implement
StandardJvmRunner(subprocess or reflective) andEspressoJvmRunner(Truffle/Espresso). - Wire up CLI (
ToolShellCommand) to resolve and invoke the chosen JVM runner.
Reviewed Changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runner/src/main/kotlin/elide/runtime/runner/Runners.kt | Service‐loader utilities for resolving runners |
| packages/runner/src/main/kotlin/elide/runtime/runner/jvm/StandardJvmRunner.kt | Standard JVM runner implementation |
| packages/runner/src/main/kotlin/elide/runtime/runner/jvm/EspressoJvmRunner.kt | Truffle/Espresso JVM runner implementation |
| packages/cli/src/main/kotlin/elide/tool/cli/cmd/repl/ToolShellCommand.kt | CLI integration for selecting and running JVM jobs |
| gradle.properties | Lowered Java target from 22 to 21 |
Comments suppressed due to low confidence (2)
packages/runner/src/main/kotlin/elide/runtime/runner/jvm/StandardJvmRunner.kt:115
- Similar to classpath, the module path is joined with
":". Consider using the platform-specific path separator for modulepath as well.
addAllStrings(jvmArgs.asArgumentList())
packages/cli/src/main/kotlin/elide/tool/cli/cmd/repl/ToolShellCommand.kt:1296
Dispatchers.Defaultis used butkotlinx.coroutines.Dispatchersis not imported. Addimport kotlinx.coroutines.Dispatchersat the top of the file.
runner.configure(context = unwrap(), coroutineContext = Dispatchers.Default)
packages/runner/src/main/kotlin/elide/runtime/runner/jvm/StandardJvmRunner.kt
Outdated
Show resolved
Hide resolved
packages/runner/src/main/kotlin/elide/runtime/runner/jvm/StandardJvmRunner.kt
Outdated
Show resolved
Hide resolved
packages/runner/src/main/kotlin/elide/runtime/runner/jvm/EspressoJvmRunner.kt
Outdated
Show resolved
Hide resolved
darvld
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit but otherwise great stuff
packages/runner/src/main/kotlin/elide/runtime/runner/AbstractRunner.kt
Outdated
Show resolved
Hide resolved
feat(cli): resolve jvm runner when executing jvm feat(cli): add `--jvm:espresso` option to prefer truffle feat(cli): use stock jvm runner by default feat(cli): prefer truffle when running tests Signed-off-by: Sam Gammon <sam@elide.dev>
Summary
Adds support for a pluggable SPI-based
Runnerinterface, specialized for now toJvmRunner; such runners are capable of accepting JVM-like arguments and running code in a JVM-like manner. There are two initial implementations:EspressoJvmRunner, which uses Truffle and Espresso, andStandardJvmRunner, which either runs code reflectively or via CLI invocation ofjava.By default, the
StandardJvmRunnerwill be used, unless any of the following conditions are true:--jvm:espressoto prefer an Espresso JVMjavabin is resolvable)RunnerTypesEspressoJvmRunnerStandardJvmRunner--jvm:espressoflag to prefer a Truffle JVMFixes #1398