Skip to content

Run TornadoVM from Maven Central; TORNADOVM_HOME becomes optional - #87

Merged
stratika merged 3 commits into
mainfrom
feature/maven-central-runtime
Nov 30, 2026
Merged

stratika merged 3 commits into
mainfrom
feature/maven-central-runtime

Conversation

@stratika

@stratika stratika commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

TornadoVM 8.2.0 on Maven Central binds OpenCL, CUDA and Metal through java.lang.foreign, so its jars are a complete runtime on a stock JDK. With this change, users no longer need to install the TornadoVM SDK or set TORNADOVM_HOME (with launchctl setenv on macOS) for dynamic inspection or for running Tornadify's kernels.

Run TornadoVM from Maven Central

  • Download: MavenTornado fetches tornado-runtime, tornado-matrices and the drivers with the IDE's Maven resolver into ~/.m2/repository, from the repositories in Remote Jar Repositories. It picks 8.2.0-jdk21 for JDK 21 and 8.2.0-jdk22plus for JDK 22 and newer.
  • Backends: a driver whose native library is missing makes TornadoVM fail as a whole. For example, the CUDA driver fails on a Mac because libcuda is not found. So TornadoToolchain first lists the devices of each candidate backend on its own: OpenCL and Metal on macOS, CUDA and OpenCL elsewhere. Only the backends that start go into -Dtornado.enabled.backends.
  • Running: TornadoRunner uses the project JDK's java with --enable-preview, --enable-native-access=ALL-UNNAMED and -Dtornado.printKernel=True, and lists devices with TornadoDeviceQuery. TORNADOVM_HOME is removed from the child process's environment, so TornadoVM keeps its settings in ~/.tornadovm.
  • TORNADOVM_HOME is now an override: when it points at a TornadoVM SDK, the plugin still uses that SDK and its tornado launcher. When it is set but is not an SDK (no tornado-api jar), the plugin uses Maven Central instead, and says so in a notification at project open, a banner in the settings and a line in the console. Run Dynamic Inspection is always enabled, and the settings page says which TornadoVM will run.
  • Smaller changes: tornado-unittests.jar is no longer required, and the suggested tornado-api version is now 8.2.0.
  • Docs: the README, the plugin description and DEVELOPMENT.md describe the new setup; the launchctl instructions now cover only using an SDK.
  • Test fix: TornadoToolchainTest uses ProgressIndicatorBase. It used to fail when run on its own and passed only because of test order.

Bump TornadoVM workflow

A daily workflow, also run by hand, finds the newest release that every downloaded artifact has on Maven Central in both builds. If it is newer than MavenTornado.RELEASE, it:

  1. writes the new release in that constant, the README and the plugin description (not the change notes),
  2. checks that the artifacts resolve,
  3. runs test buildPlugin,
  4. opens a pull request from bot/tornadovm-<release>.

A manual run is a dry run by default, and pretend_current (e.g. 8.1.0) tests the whole flow while there is no newer release. The script's tests use a fake Maven repository on disk and run in Build as well.

After merging:

  • In Settings → Actions → General, enable Allow GitHub Actions to create and approve pull requests.
  • Pull requests opened with GITHUB_TOKEN do not start Build. The bump workflow runs the tests and the build itself.

Testing

  • ./gradlew test buildPlugin passes, and so do the script's 8 unit tests.
  • End to end on an Apple M4 Pro, starting from an empty local Maven repository with TORNADOVM_HOME unset, on JDK 25 (-jdk22plus) and on GraalVM 21 (-jdk21):
    • download, then backend detection (OpenCL and Metal), then the default device,
    • javac, then the printed kernel and correct results, with and without program arguments.
  • The bump script against the real Maven Central: no change at 8.2.0, and a correct bump from a copy set back to 8.1.0.
  • The resolver calls have the same signatures in IntelliJ 2023.1, so since-build 231 still holds.
  • The CI verify job (verifyPlugin against the recommended IDEs) passes.

Not tested

  • Linux, Windows and CUDA.
  • Clicking through the plugin in runIde.
  • The workflow on GitHub.

Before the next release, add a change note to plugin.xml.

TornadoVM 8.2.0 on Maven Central binds OpenCL, CUDA and Metal through
java.lang.foreign, so its jars are a complete runtime on a stock JDK. Users
no longer need to install the SDK or export TORNADOVM_HOME (launchctl on
macOS) for dynamic inspection or for running Tornadify's kernels.

- MavenTornado downloads tornado-runtime, tornado-matrices and the drivers
  with the IDE's resolver into the local Maven repository, in the -jdk21 or
  -jdk22plus build for the project JDK.
- TornadoToolchain prepares it: a driver whose native library is missing
  fails TornadoVM as a whole, so each candidate backend (OpenCL and Metal on
  macOS, CUDA and OpenCL elsewhere) lists its devices first, and only those
  that start are passed in -Dtornado.enabled.backends.
- TornadoRunner runs it with the project JDK's java (--enable-preview,
  --enable-native-access, -Dtornado.printKernel, TornadoDeviceQuery) and
  without TORNADOVM_HOME in the child environment.
- TORNADOVM_HOME, when set, still selects that SDK and its tornado launcher.
  The startup warning and settings banner now appear only when it is set
  but is not an SDK; Run Dynamic Inspection is always enabled.
- tornado-unittests.jar is no longer required; the suggested tornado-api
  version is 8.2.0.
- README, plugin description and DEVELOPMENT.md describe the new setup.
- TornadoToolchainTest uses ProgressIndicatorBase, so it no longer depends
  on another test having started the application.
A daily workflow (also run by hand) finds the newest TornadoVM release that
every artifact the plugin downloads has on Maven Central, in both the -jdk21
and the -jdk22plus build. If it is newer than MavenTornado.RELEASE, it writes
it there, in the README and in the plugin description (not the change notes),
checks that the artifacts resolve, runs the tests and buildPlugin, and opens a
pull request from bot/tornadovm-<release>. A release whose branch exists
already is skipped.

- .github/scripts/bump_tornadovm.py does the lookup and the rewrite; its
  tests run against a fake Maven repository on disk, here and in Build.
- A manual run is a dry run by default; pretend_current makes it act as if
  the plugin downloaded an older release, to test the whole workflow.
- The Java tests read MavenTornado.RELEASE instead of 8.2.0, so a bump does
  not break them.
TornadoVM comes from the SDK of TORNADOVM_HOME only when the variable points
at a TornadoVM SDK (TornadoSdk.isUsed); when it points at something without
the tornado-api jar, dynamic inspection and Tornadify use TornadoVM from
Maven Central instead of stopping. The notification at project open, the
settings banner and a new console line say so, and how to point the
variable at an SDK or unset it.
@stratika
stratika merged commit 5552c60 into main Nov 30, 2026
4 checks passed
@stratika
stratika deleted the feature/maven-central-runtime branch November 30, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant