v0.9.1
Summary
This release focuses on:
- Hermeticity improvements for Native Image compilation
- Bazel-native downloads of GraalVM components
- Toolchain-based native image actions
- Script for producing artifact mappings
There is a new way to invoke the rules: now, the original rules for Native Image are made available at the familiar location, same as rules_graal
. This should ease transition for previous users, who should not even need to change imports or targets now 🥳
Usage
Via WORKSPACE.bazel
:
http_archive(
name = "rules_graalvm",
sha256 = "f41cc6ccdcacb5aeab7eb9f62223f1f570213b3fd0deeab386ef6188e35486ce",
strip_prefix = "rules_graalvm-0.9.1",
urls = [
"https://github.com/sgammon/rules_graalvm/releases/download/v0.9.1/rules_graalvm-0.9.1.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.1")
# Until we ship to BCR:
archive_override(
module_name = "rules_graalvm",
urls = ["https://github.com/sgammon/rules_graalvm/releases/download/v0.9.1/rules_graalvm-0.9.1.zip"],
strip_prefix = "rules_graalvm-0.9.1",
integrity = "sha256-9BzGzNysta6rfrn2IiPx9XAhOz/Q3uqzhu9hiONUhs4=",
)
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 = "oracle", # `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
- Tooling Improvements by @sgammon in #6
- Tooling, Part 2 by @sgammon in #17
- [StepSecurity] Apply security best practices by @step-security-bot in #22
- chore(deps): bump ossf/scorecard-action from 2.0.6 to 2.2.0 by @dependabot in #14
- chore(deps): bump advanced-security/maven-dependency-submission-action from 3.0.1 to 3.0.2 by @dependabot in #23
- chore(deps): bump microsoft/setup-msbuild from 1.1.3 to 1.3.1 by @dependabot in #19
- chore(deps): bump step-security/harden-runner from 2.5.0 to 2.5.1 by @dependabot in #16
- chore(deps): update googleapis digest to c61daf8 by @renovate in #10
- chore(deps): lock file maintenance by @renovate in #13
- chore(deps-dev): bump prettier from 3.0.0 to 3.0.1 by @dependabot in #20
- chore(deps): bump actions/dependency-review-action from 3.0.7 to 3.0.8 by @dependabot in #25
- chore(deps): bump github/codeql-action from 2.21.3 to 2.21.4 by @dependabot in #26
- fix(docs): move doc targets to
docs
root by @sgammon in #31 - chore(deps-dev): bump prettier from 3.0.1 to 3.0.2 by @dependabot in #32
- docs: add doc for binary targets by @sgammon in #33
- Feature: Support for Bazel 6 by @sgammon in #34
- Feature: Hermetic GraalVM by @sgammon in #35
- chore(deps): update googleapis digest to 83585eb by @renovate in #39
New Contributors
- @dependabot made their first contribution in #14
Full Changelog: v0.9.0...v0.9.1