You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2026/09/28 06:19:56 UTC

(spark-kubernetes-operator) branch main updated: [SPARK-59780] Use Java 27 toolchain while supporting Java 21+

This is an automated email from the ASF dual-hosted git repository.

dongjoon-hyun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new 05697322 [SPARK-59780] Use Java 27 toolchain while supporting Java 21+
05697322 is described below

commit 056973222017a6a3634280de882f749bd09c2f3d
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Sun Sep 27 23:19:49 2026 -0700

    [SPARK-59780] Use Java 27 toolchain while supporting Java 21+
    
    ### What changes were proposed in this pull request?
    
    This PR aims to use the Java 27 toolchain while supporting Java 21+.
    
    - `build.gradle`: Change the Gradle Java toolchain from `26` to `27`, keeping `options.release = 21`.
    - `build.gradle`: Temporarily require the `AZUL` vendor for the Java toolchain with `TODO(SPARK-59809)`.
    - `AGENTS.md`: Update the Java 27 toolchain and the current CI matrix (Java 21 / 25 / 26 / 27).
    
    ### Why are the changes needed?
    
    [JDK 27](https://openjdk.org/projects/jdk/27/) reached General Availability on 2026-09-15. We can use the latest Java 27 toolchain to build the Apache Spark K8s Operator project. The generated bytecode still targets Java 21, so Java 21+ runtimes stay supported.
    
    The `AZUL` vendor requirement is a temporary workaround. Currently, the [foojay Disco API](https://github.com/foojayio/discoapi) indexes only the `musl` (Alpine) builds of Temurin 27 for Linux. However, the `glibc` builds were published at [jdk-27+35](https://github.com/adoptium/temurin27-binaries/releases/tag/jdk-27%2B35) on 2026-09-22. Since `foojay-resolver-convention` prefers Temurin when no vendor is specified, it downloads the Alpine JDK, and Gradle fails on the `glibc`-based Gi [...]
    
    `build-tools/docker/Dockerfile` keeps `gradle:9.8.0-jdk26-noble` because no `gradle:9.8.0-jdk27-*` images have been published yet. The Java 27 toolchain is auto-provisioned via the `foojay-resolver-convention` plugin.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No. The generated bytecode still targets Java 21.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    I also manually verified the following on a Java 21 runtime.
    - `gradle build` passes with the auto-provisioned Azul Zulu 27 toolchain.
    - The generated class files have major version 65 (Java 21).
    - `docker build` of `build-tools/docker/Dockerfile` passes.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Opus 5.5
    
    Closes #888 from dongjoon-hyun/SPARK-59780.
    
    Authored-by: Dongjoon Hyun <do...@apache.org>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 AGENTS.md    | 8 ++++----
 build.gradle | 4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md
index 17436c01..31371b53 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -39,8 +39,8 @@ there, never inline in a module.
 
 **Requirements**
 
-- **JDK 21 or newer** — the Gradle toolchain auto-provisions JDK 26 and targets Java 21 bytecode;
-  CI builds on Java 21 / 25 / 26.
+- **JDK 21 or newer** — the Gradle toolchain auto-provisions JDK 27 and targets Java 21 bytecode;
+  CI builds on Java 21 / 25 / 26 / 27.
 - **Docker** — required for `./gradlew buildDockerImage`.
 - **Kubernetes cluster** (e.g. minikube), **Helm 3**, and **kubectl** — to deploy and run the
   operator.
@@ -69,7 +69,7 @@ Gradle multi-project build (see [settings.gradle](settings.gradle)); root group
 ## Build, Test & Dev Commands
 
 Use `./gradlew` (the bundled Gradle wrapper). The build targets Java 21 bytecode while the
-toolchain provisions JDK 26, so a JDK 21+ is required.
+toolchain provisions JDK 27, so a JDK 21+ is required.
 
 ```bash
 ./gradlew build -x test          # Compile + run linters, skip tests (fast)
@@ -112,7 +112,7 @@ chainsaw test --test-dir ./tests/e2e/state-transition --parallel 1
 ```
 
 `./gradlew build` runs the full quality gate locally — Checkstyle, PMD, SpotBugs, Spotless, and
-JaCoCo. Run it before pushing; CI runs the same matrix on Java 21 / 25 / 26 (x86 and arm).
+JaCoCo. Run it before pushing; CI runs the same matrix on Java 21 / 25 / 26 / 27 (x86 and arm).
 
 ## Code Style
 
diff --git a/build.gradle b/build.gradle
index 7e8d363f..c417e373 100644
--- a/build.gradle
+++ b/build.gradle
@@ -63,7 +63,9 @@ subprojects {
 
   java {
     toolchain {
-      languageVersion = JavaLanguageVersion.of(26)
+      languageVersion = JavaLanguageVersion.of(27)
+      // TODO(SPARK-59809): Remove the `AZUL` vendor requirement from Java 27 toolchain
+      vendor = JvmVendorSpec.AZUL
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org