Skip to content

v0.9.2

Compare
Choose a tag to compare
@sgammon sgammon released this 26 Aug 09:07
· 241 commits to main since this release
v0.9.2
a71eb4a

Summary

This release focused on compatibility fixes for issues reported in:

Compatibility with rules_graal is now much smoother, with fewer changes required and previous versions of GraalVM under continuous test. Tests have been added for CE 17/20 and Oracle 17/20, as well as older versions of GraalVM and the previous use style of the rules.

Warning

Previous releases of this package defaulted the distribution attribute to oracle. This was unintended. In this new release, the distribution defaults to Community Edition. This is a breaking change.

Usage

Via WORKSPACE.bazel:

http_archive(
    name = "rules_graalvm",
    sha256 = "baf82fa979fe4c1c90fe676dfe80aea5a70bb6a8287c3d6d1d4418c0f3a3b2b2",
    strip_prefix = "rules_graalvm-0.9.2",
    urls = [
        "https://github.com/sgammon/rules_graalvm/releases/download/v0.9.2/rules_graalvm-0.9.2.zip",
    ],
)
load("@rules_graalvm//graalvm:repositories.bzl", "graalvm_repository")
graalvm_repository(
    name = "graalvm",
    components = [
       # if you need components like `js` or `wasm`, add them here
    ],
    distribution = "ce",  # `oracle`, `ce`, or `community`
    java_version = "20",  # `17`, `20`, or `21`, as supported by the version provided
    version = "20.0.2",  # earlier version format like `22.x` also supported
)

Or, via MODULE.bazel:

Important

To use Bzlmod with rules_graalvm, you will need the archive_override below (until this package is made available on BCR).

bazel_dep(name = "rules_graalvm", version = "0.9.2")
# Until we ship to BCR:
archive_override(
    module_name = "rules_graalvm",
    urls = ["https://github.com/sgammon/rules_graalvm/releases/download/v0.9.2/rules_graalvm-0.9.2.zip"],
    strip_prefix = "rules_graalvm-0.9.2",
    integrity = "sha256-uvgvqXn+TByQ/mdt/oCupacLtqgofD1tHUQYwPOjsrI=",
)
gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm")

gvm.graalvm(
    name = "graalvm",
    version = "20.0.2",  # earlier version format like `22.x` also supported
    distribution = "ce",  # `oracle`, `ce`, or `community`
    java_version = "20",  # `17`, `20`, or `21`, as supported by the version provided
    components = [
       # if you need components like `js` or `wasm`, add them here
    ],
)
use_repo(gvm, "graalvm")
register_toolchains("@graalvm//:all")

Using GraalVM as your Java toolchain

Via WORKSPACE.bazel:

# graalvm_repository(...)
load("@rules_graalvm//graalvm:workspace.bzl", "register_graalvm_toolchains")

register_graalvm_toolchains()

Via Bzlmod:

register_toolchains("@graalvm//:all")

To use the toolchain, add this to your .bazelrc:

build --extra_toolchains=@graalvm//:toolchain
build --java_runtime_version=graalvm_20

Note

If you name your repository example and set the Java version to 21, your java_runtime_version would be example_21.

--

What's Changed

  • chore(deps): lock file maintenance by @renovate in #49
  • fix issues native image migration by @johnynek in #58
  • chore(deps): update dependency aspect_rules_js to v1.32.0 by @renovate in #42
  • fix: download urls, legacy rule compatibility by @sgammon in #61

New Contributors

Full Changelog: v0.9.1...v0.9.2