diff --git a/.github/workflows/module.build.yml b/.github/workflows/module.build.yml index 83e245c..b040120 100644 --- a/.github/workflows/module.build.yml +++ b/.github/workflows/module.build.yml @@ -234,6 +234,14 @@ jobs: labs: false skip: false + # Test: Bazel 7 + - label: Bazel 7 + target: sample + action: build + directory: "./example/integration_tests/bazel7" + labs: false + skip: false + # Test: Inert - label: Inert target: sample diff --git a/README.md b/README.md index 48ea097..b31303e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # GraalVM Rules for Bazel -![Bazel 7](https://img.shields.io/badge/Bazel%207-black?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0My41NyA0My4zNyI%2BCiAgPGRlZnM%2BCiAgICA8c3R5bGU%2BCiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogIzAwNDMwMDsKICAgICAgfQoKICAgICAgLmNscy0yIHsKICAgICAgICBmaWxsOiAjMDA3MDFhOwogICAgICB9CgogICAgICAuY2xzLTMgewogICAgICAgIGZpbGw6ICM0M2EwNDc7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgZmlsbDogIzc2ZDI3NTsKICAgICAgfQogICAgPC9zdHlsZT4KICA8L2RlZnM%2BCiAgPGcgaWQ9IkxheWVyXzEtMiIgZGF0YS1uYW1lPSJMYXllciAxIj4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMiIgZD0ibTIxLjc4LDMyLjY4djEwLjY5bC0xMC44OS0xMC44OXYtMTAuNjlsMTAuODksMTAuODlaIi8%2BCiAgICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Im0yMS43OCwzMi42OGwxMC45LTEwLjg5djEwLjY5bC0xMC45LDEwLjg5di0xMC42OVoiLz4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0ibTEwLjg5LDIxLjc5djEwLjY5TDAsMjEuNTh2LTEwLjY5bDEwLjg5LDEwLjlaIi8%2BCiAgICA8cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Im00My41NywxMC44OXYxMC42OWwtMTAuODksMTAuOXYtMTAuNjlsMTAuODktMTAuOVoiLz4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0ibTIxLjc4LDMyLjY4bC0xMC44OS0xMC44OSwxMC44OS0xMC45LDEwLjksMTAuOS0xMC45LDEwLjg5WiIvPgogICAgPHBhdGggY2xhc3M9ImNscy00IiBkPSJtMTAuODksMjEuNzlMMCwxMC44OSwxMC44OSwwbDEwLjg5LDEwLjg5LTEwLjg5LDEwLjlaIi8%2BCiAgICA8cGF0aCBjbGFzcz0iY2xzLTQiIGQ9Im0zMi42OCwyMS43OWwtMTAuOS0xMC45TDMyLjY4LDBsMTAuODksMTAuODktMTAuODksMTAuOVoiLz4KICA8L2c%2BCjwvc3ZnPg%3D%3D&logoColor=gray) -![Bzlmod](https://img.shields.io/badge/Bzlmod-black?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0My41NyA0My4zNyI%2BCiAgPGRlZnM%2BCiAgICA8c3R5bGU%2BCiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogIzAwNDMwMDsKICAgICAgfQoKICAgICAgLmNscy0yIHsKICAgICAgICBmaWxsOiAjMDA3MDFhOwogICAgICB9CgogICAgICAuY2xzLTMgewogICAgICAgIGZpbGw6ICM0M2EwNDc7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgZmlsbDogIzc2ZDI3NTsKICAgICAgfQogICAgPC9zdHlsZT4KICA8L2RlZnM%2BCiAgPGcgaWQ9IkxheWVyXzEtMiIgZGF0YS1uYW1lPSJMYXllciAxIj4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMiIgZD0ibTIxLjc4LDMyLjY4djEwLjY5bC0xMC44OS0xMC44OXYtMTAuNjlsMTAuODksMTAuODlaIi8%2BCiAgICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Im0yMS43OCwzMi42OGwxMC45LTEwLjg5djEwLjY5bC0xMC45LDEwLjg5di0xMC42OVoiLz4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0ibTEwLjg5LDIxLjc5djEwLjY5TDAsMjEuNTh2LTEwLjY5bDEwLjg5LDEwLjlaIi8%2BCiAgICA8cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Im00My41NywxMC44OXYxMC42OWwtMTAuODksMTAuOXYtMTAuNjlsMTAuODktMTAuOVoiLz4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0ibTIxLjc4LDMyLjY4bC0xMC44OS0xMC44OSwxMC44OS0xMC45LDEwLjksMTAuOS0xMC45LDEwLjg5WiIvPgogICAgPHBhdGggY2xhc3M9ImNscy00IiBkPSJtMTAuODksMjEuNzlMMCwxMC44OSwxMC44OSwwbDEwLjg5LDEwLjg5LTEwLjg5LDEwLjlaIi8%2BCiAgICA8cGF0aCBjbGFzcz0iY2xzLTQiIGQ9Im0zMi42OCwyMS43OWwtMTAuOS0xMC45TDMyLjY4LDBsMTAuODksMTAuODktMTAuODksMTAuOVoiLz4KICA8L2c%2BCjwvc3ZnPg%3D%3D&logoColor=gray) +![Bazel 8](https://img.shields.io/badge/Bazel%207-black?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0My41NyA0My4zNyI%2BCiAgPGRlZnM%2BCiAgICA8c3R5bGU%2BCiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogIzAwNDMwMDsKICAgICAgfQoKICAgICAgLmNscy0yIHsKICAgICAgICBmaWxsOiAjMDA3MDFhOwogICAgICB9CgogICAgICAuY2xzLTMgewogICAgICAgIGZpbGw6ICM0M2EwNDc7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgZmlsbDogIzc2ZDI3NTsKICAgICAgfQogICAgPC9zdHlsZT4KICA8L2RlZnM%2BCiAgPGcgaWQ9IkxheWVyXzEtMiIgZGF0YS1uYW1lPSJMYXllciAxIj4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMiIgZD0ibTIxLjc4LDMyLjY4djEwLjY5bC0xMC44OS0xMC44OXYtMTAuNjlsMTAuODksMTAuODlaIi8%2BCiAgICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Im0yMS43OCwzMi42OGwxMC45LTEwLjg5djEwLjY5bC0xMC45LDEwLjg5di0xMC42OVoiLz4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0ibTEwLjg5LDIxLjc5djEwLjY5TDAsMjEuNTh2LTEwLjY5bDEwLjg5LDEwLjlaIi8%2BCiAgICA8cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Im00My41NywxMC44OXYxMC42OWwtMTAuODksMTAuOXYtMTAuNjlsMTAuODktMTAuOVoiLz4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0ibTIxLjc4LDMyLjY4bC0xMC44OS0xMC44OSwxMC44OS0xMC45LDEwLjksMTAuOS0xMC45LDEwLjg5WiIvPgogICAgPHBhdGggY2xhc3M9ImNscy00IiBkPSJtMTAuODksMjEuNzlMMCwxMC44OSwxMC44OSwwbDEwLjg5LDEwLjg5LTEwLjg5LDEwLjlaIi8%2BCiAgICA8cGF0aCBjbGFzcz0iY2xzLTQiIGQ9Im0zMi42OCwyMS43OWwtMTAuOS0xMC45TDMyLjY4LDBsMTAuODksMTAuODktMTAuODksMTAuOVoiLz4KICA8L2c%2BCjwvc3ZnPg%3D%3D&logoColor=gray) [![CI](https://github.com/sgammon/rules_graalvm/actions/workflows/on.push.yml/badge.svg)](https://github.com/sgammon/rules_graalvm/actions/workflows/on.push.yml) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4-ff69b4.svg)](CODE_OF_CONDUCT.md) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8287/badge)](https://www.bestpractices.dev/projects/8287) @@ -24,8 +23,8 @@ Use [GraalVM](https://graalvm.org) with [Bazel](https://bazel.build) to: - [Example projects for all use cases](./docs/examples.md) - [Hermetic compilation on all platforms](./docs/hermeticity.md) - [Run tools from GraalVM directly](./docs/binary-targets.md) -- [Support for Bazel 6, Bazel 7, and Bzlmod](./docs/modern-bazel.md) -- [Support for Bazel 4 and Bazel 5, drop-in replacement for `rules_graal`](./legacy-bazel.md) +- [Support for Bazel 6-8 (Bzlmod)](./docs/modern-bazel.md) +- [Support for Bazel 4+, drop-in replacement for `rules_graal`](./legacy-bazel.md) - Support for macOS, Linux, Windows (including Native Image!) ([support matrix](./docs/modern-bazel.md)) - Support for the latest modern GraalVM releases (Community Edition and Oracle GraalVM) diff --git a/example/integration_tests/bzlmod/.bazelrc b/example/integration_tests/bzlmod/.bazelrc index d871601..ca6fe78 100644 --- a/example/integration_tests/bzlmod/.bazelrc +++ b/example/integration_tests/bzlmod/.bazelrc @@ -3,4 +3,3 @@ build --java_runtime_version=21 build --extra_toolchains=@graalvm//:toolchain build --extra_toolchains=@graalvm//:toolchain_gvm build --extra_toolchains=@graalvm//:bootstrap_runtime_toolchain -build --toolchain_resolution_debug='@@bazel_tools//tools/jdk:toolchain_type' diff --git a/example/integration_tests/bzlmod/MODULE.bazel b/example/integration_tests/bzlmod/MODULE.bazel index 607047e..05e98ee 100644 --- a/example/integration_tests/bzlmod/MODULE.bazel +++ b/example/integration_tests/bzlmod/MODULE.bazel @@ -22,8 +22,8 @@ gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm") gvm.graalvm( name = "graalvm", distribution = "ce", - java_version = "21", - version = "23.0.0", + java_version = "23", + version = "23.0.1", ) use_repo( gvm, diff --git a/example/integration_tests/bzlmod/MODULE.bazel.lock b/example/integration_tests/bzlmod/MODULE.bazel.lock index 80a6edd..2fde46d 100644 --- a/example/integration_tests/bzlmod/MODULE.bazel.lock +++ b/example/integration_tests/bzlmod/MODULE.bazel.lock @@ -188,8 +188,8 @@ }, "@@rules_graalvm+//:extensions.bzl%graalvm": { "general": { - "bzlTransitiveDigest": "JxUDZR5MBdi8Oo/PFU78tlKNBPAOHk2NLAFjnSlbEVs=", - "usagesDigest": "1GQfdlzpcu5HJzqviTTtoXeCFVznnf0wYdNieVeVc/c=", + "bzlTransitiveDigest": "lgQhCPnm9iQXnieE/Tk0F4FujL1FSiZXkRAvTDBg9CA=", + "usagesDigest": "K3Fhj1rbmyyB1oDiudEuWVhSQSzOJUFHZnwGvODfBDM=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -197,14 +197,14 @@ "graalvm_toolchains": { "repoRuleId": "@@rules_graalvm+//internal:graalvm_bindist.bzl%_toolchain_config", "attributes": { - "build_file": "\nalias(\n name = \"toolchain_gvm\",\n actual = \"gvm\",\n visibility = [\"//visibility:public\"],\n)\ntoolchain(\n name = \"gvm\",\n exec_compatible_with = [\n \n ],\n target_compatible_with = [\n \n ],\n toolchain = \"@graalvm//:gvm\",\n toolchain_type = \"@rules_graalvm//graalvm/toolchain\",\n visibility = [\"//visibility:public\"],\n)\n\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"graalvm_21\"},\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [],\n target_settings = [\":prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\n\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [],\n target_settings = [\":prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\n\n" + "build_file": "\nalias(\n name = \"toolchain_gvm\",\n actual = \"gvm\",\n visibility = [\"//visibility:public\"],\n)\ntoolchain(\n name = \"gvm\",\n exec_compatible_with = [\n \n ],\n target_compatible_with = [\n \n ],\n toolchain = \"@graalvm//:gvm\",\n toolchain_type = \"@rules_graalvm//graalvm/toolchain\",\n visibility = [\"//visibility:public\"],\n)\n\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"graalvm_23\"},\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [],\n target_settings = [\":prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\n\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [],\n target_settings = [\":prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\n\n" } }, "graalvm": { "repoRuleId": "@@rules_graalvm+//internal:graalvm_bindist.bzl%_graalvm_bindist_repository", "attributes": { - "version": "23.0.0", - "java_version": "21", + "version": "23.0.1", + "java_version": "23", "distribution": "ce", "components": [], "setup_actions": [], diff --git a/internal/graalvm_bindist.bzl b/internal/graalvm_bindist.bzl index 5496144..d8c29cd 100644 --- a/internal/graalvm_bindist.bzl +++ b/internal/graalvm_bindist.bzl @@ -24,6 +24,7 @@ load( "VmReleaseVersions", "VmReleaseVersionsOracle", "resolve_distribution_artifact", + "resolve_version_pair", Component = "DistributionComponent", Distribution = "DistributionType", ) @@ -267,9 +268,12 @@ def _graal_bindist_repository_impl(ctx): else: platform, os, archive = _get_platform(ctx, True) - version = ctx.attr.version + version_spec = ctx.attr.version distribution = ctx.attr.distribution or Distribution.COMMUNITY - java_version = ctx.attr.java_version + java_version_spec = ctx.attr.java_version + + # resolves potentially symbolic version strings + (java_version, version) = resolve_version_pair(java_version_spec, version_spec) # new gvm distribution check _check_version(version, java_version, True) @@ -286,9 +290,7 @@ def _graal_bindist_repository_impl(ctx): fail("Cannot find distribution name for GraalVM: " + ctx.attr.distribution) # resolve & download vm - dist_tag = "{dist}-{version}".format(dist = dist_name, version = ctx.attr.version) - version = ctx.attr.version - java_version = ctx.attr.java_version + dist_tag = "{dist}-{version}".format(dist = dist_name, version = version) format_args = { "version": version, "platform": platform, @@ -302,7 +304,7 @@ def _graal_bindist_repository_impl(ctx): platform, version, java_version, - strict = False, + strict = True, ) if config == None: fail("Unable to locate GraalVM distribution '%s' at version '%s' for platform '%s'" % ( diff --git a/internal/graalvm_bindist_map.bzl b/internal/graalvm_bindist_map.bzl index 6bc6d1c..ad8db09 100644 --- a/internal/graalvm_bindist_map.bzl +++ b/internal/graalvm_bindist_map.bzl @@ -2,11 +2,15 @@ # ! THIS FILE IS GENERATED. DO NOT EDIT. ! -# Last updated: 2024-09-29T13:05PDT by sam +# Last updated: 2024-12-17T17:15PDT by sam # To learn how to regenerate this file, consult the contributor docs for # the `rules_graalvm` repository: https://github.com/sgammon/rules_graalvm +# Latest supported major JVM version. +# buildifier: disable=name-conventions +_LatestJvmRelease = "23" + # Enumerates available distribution types. # buildifier: disable=name-conventions _DistributionType = struct( @@ -53,6 +57,7 @@ _ComponentDependencies = { # Aligned GraalVM distribution versions. # buildifier: disable=name-conventions _AlignedVersions = { + "23.0.1": "24.1.1", "23.0.0": "24.1.0", "22.0.2": "24.0.2", "22.0.1": "24.0.1", @@ -66,9 +71,20 @@ _AlignedVersions = { "17.0.7": "23.0.1", } +# Aligned GraalVM distribution versions, at latest. +# buildifier: disable=name-conventions +_LatestVersions = { + "23": ("23.0.1", "24.1.1"), + "22": ("22.0.2", "24.0.2"), + "21": ("21.0.2", "23.1.2"), + "20": ("20.0.2", "23.0.1"), + "17": ("17.0.8", "23.0.1"), +} + # VM release versions for calculating prefixes. # buildifier: disable=name-conventions _VmReleaseVersions = { + "24.1.1": "23.0.1+11.1", "24.1.0": "23+37.1", "24.0.2": "22.0.2+9.1", "24.0.1": "22.0.1+8.1", @@ -78,6 +94,7 @@ _VmReleaseVersions = { "21.0.1": "21.0.1+12.1", "23.1.1": "21.0.1+12.1", "23.1.0": "21+35.1", + "23.0.1": "23.0.1+11.1", "23.0.0": "23+37.1", "22.0.2": "22.0.2+9.1", "22.0.1": "22.0.1+8.1", @@ -92,6 +109,7 @@ _VmReleaseVersions = { # VM release versions (for Oracle GVM) for calculating prefixes. # buildifier: disable=name-conventions _VmReleaseVersionsOracle = { + "24.1.1": "23.0.1+11.1", "24.1.0": "23+37.1", "24.0.2": "22.0.2+9.1", "24.0.1": "22.0.1+8.1", @@ -101,6 +119,7 @@ _VmReleaseVersionsOracle = { "21.0.1": "21.0.1+12.1", "23.1.1": "21.0.1+12.1", "23.1.0": "21+35.1", + "23.0.1": "23.0.1+11.1", "23.0.0": "23+37.1", "22.0.2": "22.0.2+9.1", "22.0.1": "22.0.1+8.1", @@ -112,12 +131,44 @@ _VmReleaseVersionsOracle = { "17.0.7": "17.0.8+9.1", } +def _resolve_version_pair(java_version, version): + """Resolve a pair of Java and GraalVM version strings to actual versions of each component. + + Symbolic versions like the string `latest` are resolved by this method. A tuple is returned, + with the first position representing a JVM version, and the second representing a GraalVM + version. + + If either (or neither) version parameter is symbolic, it/they are returned literally. + + Args: + java_version: Java version specified or expected by the developer, which should be resolved. + version: GraalVM version specified by the developer, which should be resolved. + + Returns: + Tuple of resolved version strings; JVM version in first position, GVM version in second.""" + + resolved_jvm = java_version + if java_version == "latest": + resolved_jvm = _LatestJvmRelease + + if version == "latest": + latest_gvm_for_jvm = _LatestVersions.get(resolved_jvm) + if latest_gvm_for_jvm == None: + fail("Can't resolve latest GraalVM for JVM version: %s" % resolved_jvm) + return (resolved_jvm, latest_gvm_for_jvm) + + # gvm version is non-symbolic so return it literally + return (resolved_jvm, version) + + def _generate_distribution_coordinate(dist, platform, version, java_version, component = None): """Generate a well-formed distribution coordinate key. Generates a key for the generated binary distribution map, which holds download URLs and known-good integrity values. + The special value "latest" can be specified for either or both of `version` and `java_version`. + Args: dist: Distribution for the coordinate (a `DistributionType`). platform: Platform for the release (a `DistributionPlatform`). @@ -130,21 +181,43 @@ def _generate_distribution_coordinate(dist, platform, version, java_version, com """ aligned_version = None - if version == "23.1.0" and java_version == "21": - version = "21.0.0" - aligned_version = "23.1.0" - elif version == "24.0.0" and java_version == "22": - version = "22.0.0" - aligned_version = "24.0.0" - elif version == "24.0.1" and java_version == "22": - version = "22.0.1" - aligned_version = "24.0.1" - elif version == "24.0.2" and java_version == "22": - version = "22.0.2" - aligned_version = "24.0.2" - elif version == "24.1.0" and java_version == "23": - version = "23.0.0" - aligned_version = "24.1.0" + if not java_version: + fail( + "Please specify a `java_version` for GraalVM. " + + ("Version 17-%s is supported (or set to 'latest')." % _LatestJvmRelease) + ) + if not version: + fail( + "Please specify a `version` for GraalVM, or use 'latest'." + ) + if version != "latest": + if version == "23.1.0" and java_version == "21": + version = "21.0.0" + aligned_version = "23.1.0" + elif version == "24.0.0" and java_version == "22": + version = "22.0.0" + aligned_version = "24.0.0" + elif version == "24.0.1" and java_version == "22": + version = "22.0.1" + aligned_version = "24.0.1" + elif version == "24.0.2" and java_version == "22": + version = "22.0.2" + aligned_version = "24.0.2" + elif version == "24.1.0" and java_version == "23": + version = "23.0.0" + aligned_version = "24.1.0" + elif version == "24.1.1" and java_version == "23": + version = "23.0.1" + aligned_version = "24.1.1" + else: + latest_info = _LatestVersions.get(java_version) + if not latest_info: + fail("Unable to resolve latest GraalVM coordinates for JVM version '%s'." % java_version) + + # otherwise, unpack as versions + (latest_jvm, latest_gvm) = latest_info + aligned_version = latest_gvm + version = latest_jvm segments = [ dist, @@ -2532,7 +2605,7 @@ _GRAALVM_BINDIST = { }, "oracle_23.0.0_linux-aarch64_24.1.0": { # Oracle GraalVM 23.0.0 (Java 23), Linux (arm64), Version 24.1.0 - "url": "https://download.oracle.com/graalvm/23/latest/graalvm-jdk-23_linux-aarch64_bin.tar.gz", + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23_linux-aarch64_bin.tar.gz", "sha256": "f6a12e7f09f3bc23d46d2dda6f9dc6a16f094489d56549a1dcc11a7e6826ed9f", "compatible_with": [ "@platforms//cpu:aarch64", @@ -2542,7 +2615,7 @@ _GRAALVM_BINDIST = { }, "oracle_23.0.0_linux-x64_24.1.0": { # Oracle GraalVM 23.0.0 (Java 23), Linux (amd64), Version 24.1.0 - "url": "https://download.oracle.com/graalvm/23/latest/graalvm-jdk-23_linux-x64_bin.tar.gz", + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23_linux-x64_bin.tar.gz", "sha256": "9e0632fe4be3d7fed6f03b3afc349b72fd5cb857ec6b69008202257e8a3ed858", "compatible_with": [ "@platforms//cpu:x86_64", @@ -2552,7 +2625,7 @@ _GRAALVM_BINDIST = { }, "oracle_23.0.0_macos-aarch64_24.1.0": { # Oracle GraalVM 23.0.0 (Java 23), macOS (arm64), Version 24.1.0 - "url": "https://download.oracle.com/graalvm/23/latest/graalvm-jdk-23_macos-aarch64_bin.tar.gz", + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23_macos-aarch64_bin.tar.gz", "sha256": "63290bf6242836ac46ca4c8c4ad048e4482fdb3f8276b9689088f059be430687", "compatible_with": [ "@platforms//cpu:aarch64", @@ -2562,7 +2635,7 @@ _GRAALVM_BINDIST = { }, "oracle_23.0.0_macos-x64_24.1.0": { # Oracle GraalVM 23.0.0 (Java 23), macOS (amd64), Version 24.1.0 - "url": "https://download.oracle.com/graalvm/23/latest/graalvm-jdk-23_macos-x64_bin.tar.gz", + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23_macos-x64_bin.tar.gz", "sha256": "d516ea854e361a821c7679d127ff7126c254b8c43c99e571e203df218df2764b", "compatible_with": [ "@platforms//cpu:x86_64", @@ -2572,7 +2645,7 @@ _GRAALVM_BINDIST = { }, "oracle_23.0.0_windows-x64_24.1.0": { # Oracle GraalVM 23.0.0 (Java 23), Windows (amd64), Version 24.1.0 - "url": "https://download.oracle.com/graalvm/23/latest/graalvm-jdk-23_windows-x64_bin.zip", + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23_windows-x64_bin.zip", "sha256": "42ead2ed36451e746d475c550ca022b81bf777f6dba463a113cb58585574a3b6", "compatible_with": [ "@platforms//cpu:x86_64", @@ -2580,6 +2653,106 @@ _GRAALVM_BINDIST = { "@rules_graalvm//platform/jvm:java23", ], }, + "ce_23.0.1_linux-aarch64_24.1.1": { + # GraalVM CE 23.0.1 (Java 23), Linux (arm64), Version 24.1.1 + "url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-23.0.1/graalvm-community-jdk-23.0.1_linux-aarch64_bin.tar.gz", + "sha256": "5a456db9162a89be5fadd50e703c19313d25ef7f5043b750b639cd0460335e60", + "compatible_with": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + "@rules_graalvm//platform/jvm:java23", + ], + }, + "ce_23.0.1_linux-x64_24.1.1": { + # GraalVM CE 23.0.1 (Java 23), Linux (amd64), Version 24.1.1 + "url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-23.0.1/graalvm-community-jdk-23.0.1_linux-x64_bin.tar.gz", + "sha256": "e26a0a74064b1689c056b5f24d7cc3b271f57f576be063b139d27aafa1322951", + "compatible_with": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + "@rules_graalvm//platform/jvm:java23", + ], + }, + "ce_23.0.1_macos-aarch64_24.1.1": { + # GraalVM CE 23.0.1 (Java 23), macOS (arm64), Version 24.1.1 + "url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-23.0.1/graalvm-community-jdk-23.0.1_macos-aarch64_bin.tar.gz", + "sha256": "d142ecf3d36775e457cdfe67e31982821dfe2d75ade28083990be19ee955f48f", + "compatible_with": [ + "@platforms//cpu:aarch64", + "@platforms//os:macos", + "@rules_graalvm//platform/jvm:java23", + ], + }, + "ce_23.0.1_macos-x64_24.1.1": { + # GraalVM CE 23.0.1 (Java 23), macOS (amd64), Version 24.1.1 + "url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-23.0.1/graalvm-community-jdk-23.0.1_macos-x64_bin.tar.gz", + "sha256": "d8206c29232a68908bbce146012925c52f060722fe2fc2dbb41fe17bd906b210", + "compatible_with": [ + "@platforms//cpu:x86_64", + "@platforms//os:macos", + "@rules_graalvm//platform/jvm:java23", + ], + }, + "ce_23.0.1_windows-x64_24.1.1": { + # GraalVM CE 23.0.1 (Java 23), Windows (amd64), Version 24.1.1 + "url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-23.0.1/graalvm-community-jdk-23.0.1_windows-x64_bin.zip", + "sha256": "be5fe8f734476469f364329d9126c365a35d245755f3fc17a583e3a0f3688d38", + "compatible_with": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + "@rules_graalvm//platform/jvm:java23", + ], + }, + "oracle_23.0.1_linux-aarch64_24.1.1": { + # Oracle GraalVM 23.0.1 (Java 23), Linux (arm64), Version 24.1.1 + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23.0.1_linux-aarch64_bin.tar.gz", + "sha256": "1835a98b87c439c8c654d97956c22d409855952e5560a8127f56c50f3f919d7d", + "compatible_with": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + "@rules_graalvm//platform/jvm:java23", + ], + }, + "oracle_23.0.1_linux-x64_24.1.1": { + # Oracle GraalVM 23.0.1 (Java 23), Linux (amd64), Version 24.1.1 + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23.0.1_linux-x64_bin.tar.gz", + "sha256": "46ec9582ebe114f93470403f2cc123238ac0c7982129c358af7d8e1de52dd663", + "compatible_with": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + "@rules_graalvm//platform/jvm:java23", + ], + }, + "oracle_23.0.1_macos-aarch64_24.1.1": { + # Oracle GraalVM 23.0.1 (Java 23), macOS (arm64), Version 24.1.1 + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23.0.1_macos-aarch64_bin.tar.gz", + "sha256": "c00a7a62ce453aa026bff65e5a18c63464f725c01e5a71771856226928ba5b0f", + "compatible_with": [ + "@platforms//cpu:aarch64", + "@platforms//os:macos", + "@rules_graalvm//platform/jvm:java23", + ], + }, + "oracle_23.0.1_macos-x64_24.1.1": { + # Oracle GraalVM 23.0.1 (Java 23), macOS (amd64), Version 24.1.1 + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23.0.1_macos-x64_bin.tar.gz", + "sha256": "539699d8ff4979623bc7bdf8282ac6f76cd2560f47d14ec5438bada24f136f96", + "compatible_with": [ + "@platforms//cpu:x86_64", + "@platforms//os:macos", + "@rules_graalvm//platform/jvm:java23", + ], + }, + "oracle_23.0.1_windows-x64_24.1.1": { + # Oracle GraalVM 23.0.1 (Java 23), Windows (amd64), Version 24.1.1 + "url": "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-23.0.1_windows-x64_bin.zip", + "sha256": "e758646504cfaf23cf218a22691ad70491f3196448a77d03d78e50dff2145533", + "compatible_with": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + "@rules_graalvm//platform/jvm:java23", + ], + }, } # Exports. @@ -2599,6 +2772,12 @@ ComponentDependencies = _ComponentDependencies # buildifier: disable=name-conventions AlignedVersions = _AlignedVersions +# buildifier: disable=name-conventions +LatestVersions = _LatestVersions + +# buildifier: disable=name-conventions +LatestJvmRelease = _LatestJvmRelease + # buildifier: disable=name-conventions VmReleaseVersions = _VmReleaseVersions @@ -2607,3 +2786,4 @@ VmReleaseVersionsOracle = _VmReleaseVersionsOracle generate_distribution_coordinate = _generate_distribution_coordinate resolve_distribution_artifact = _resolve_distribution_artifact +resolve_version_pair = _resolve_version_pair