[fix](ci) Use actions/setup-java to install JDK 17 for BE UT macOS workflow#62820
Open
BiteTheDDDDt wants to merge 1 commit intoapache:masterfrom
Open
[fix](ci) Use actions/setup-java to install JDK 17 for BE UT macOS workflow#62820BiteTheDDDDt wants to merge 1 commit intoapache:masterfrom
BiteTheDDDDt wants to merge 1 commit intoapache:masterfrom
Conversation
…rkflow
The macOS-15 runner was rotated to arm64 (Apple Silicon) and the
`JAVA_HOME_17_X64` env var that previously exposed the preinstalled JDK 17
is no longer set on arm64 runners. As a result, `export JAVA_HOME="${JAVA_HOME_17_X64%/}"`
left `JAVA_HOME` empty, env.sh then fell back to the system `java` (which
is now JDK 25 by default on macOS-15), and the build failed with:
Check JAVA version
ERROR: The JAVA version is 25, it must be JDK-17.
Use `actions/setup-java@v4` (Temurin 17) to install and expose JDK 17 in
a runner-arch-agnostic way, and drop the obsolete `JAVA_HOME_17_X64` line.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the BE UT (macOS) GitHub Actions workflow on macos-15 by ensuring the job consistently uses JDK 17 regardless of runner architecture, avoiding reliance on runner-specific preinstalled JAVA_HOME_* environment variables.
Changes:
- Add a
actions/setup-java@v4step to install Temurin JDK 17 and setJAVA_HOMEautomatically. - Remove the workflow’s prior reliance on
JAVA_HOME_17_X64(which is absent on arm64 runners) and document the rationale inline.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
BE UT (macOS)workflow onmacos-15started failing with:Root cause
The
macos-15GitHub-hosted runner is arm64 (Apple Silicon), confirmed by job logs:Target system: Darwin; Target arch: arm64. On arm64 macOS runners, the env varJAVA_HOME_17_X64is not set (onlyJAVA_HOME_17_arm64would be), so:ends up empty. Then
env.sh(check_jdk_version) falls back tocommand -v java, which onmacos-15is now JDK 25 by default, hence the failure.Fix
Use
actions/setup-java@v4(Temurin 17) to install JDK 17 in a runner-arch-agnostic way; the action setsJAVA_HOMEautomatically. Drop the obsoleteexport JAVA_HOME="${JAVA_HOME_17_X64%/}"line.This avoids depending on hosted-runner preinstalled JDK env vars (which differ across image versions and architectures) and matches the pattern already used by other workflows in the repo (e.g.
.github/workflows/checkstyle.yamlandbuild-extension.yml).Release note
None (CI fix only).