[ISSUE-76] Fix Gradle build failure — replace setup-java with Alpine JDK package #5
Labels
No Label
architect:complete
complexity:high
complexity:low
complexity:medium
cross-repo
cross-repo-dev
dev:in-progress
effort:l
effort:m
effort:s
effort:xl
effort:xs
epic
analytics
epic
development
epic
devops
epic
infra
epic
observability
epic
platform
epic
product
lead:complete
needs-decision
pipeline-complete
pipeline-error
pipeline-running
priority
later
priority
next
priority
now
start-pipeline
status
acceptance
status
blocked
status
done
status
in progress
status
in review
status
in testing
status
ready
status
refine
status
triage
subtask
type
analysis
type
bug
type
hygiene
type
mantainence
type
story
user-story
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Hithomelabs/ci-runner-test#5
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Dave/ci-runner-test:ISSUE-76"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The
actions/setup-java@v4step downloads a glibc-compiled Temurin JDK, which cannot execute on Alpine's musl libc (/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.19-10/x64/bin/java: not found). This causes./gradlew buildto fail.The fix replaces the
setup-javastep with Alpine's nativeopenjdk17-jdkpackage (compiled for musl), and explicitly setsJAVA_HOMEvia$GITHUB_ENVsogradlewcan find it.Changes
actions/setup-java@v4step (Fetches glibc Temurin JDK, incompatible with Alpine/musl)apk add --no-cache openjdk17-jdk— installs musl-native JDK 17echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk" >> "$GITHUB_ENV"— ensures gradlew can resolve JAVA_HOMEIssues
Testing
./gradlew buildPR Review: [ISSUE-76] Fix Gradle build failure — replace setup-java with Alpine JDK package
Summary
This PR fixes the Gradle build failure (Issue #76) by replacing
actions/setup-java@v4(which downloads a glibc-compiled Temurin JDK incompatible with Alpine/musl) with Alpine's nativeopenjdk17-jdkpackage viaapk, and explicitly settingJAVA_HOMEsogradlewcan resolve it.Code Quality
apk add --no-cache— correct practice (avoids leaving APK cache)$GITHUB_ENVis the proper mechanism for cross-step environment propagation in Gitea/GitHub ActionsJAVA_HOMEpath/usr/lib/jvm/java-17-openjdkmatches Alpine's openjdk17 package layoutSecurity
--no-cacheprevents local APK cache bloatConcerns
1. Diff includes stale
push:trigger additionThe diff shows
push:trigger being added to the workflow. This change was already merged in PR #3 (ISSUE-75). The PR's base commit predates that merge. While git shows this as mergeable, the actual meaningful change is only the JDK installation replacement. The merger should be aware when squashing.2. No inline
JAVA_HOMEverification after exportThe
JAVA_HOMEis written to$GITHUB_ENV, but there's no immediate verification that it resolves correctly before the Gradle build. The existing "Verify tools" step only checksjava -version(via PATH), not$JAVA_HOME/bin/java. Consider adding a quick check:This is optional — the Gradle build will fail fast if
JAVA_HOMEis wrong — but it would provide a clearer diagnostic point if something goes wrong.3. Image size concern (non-blocking)
The custom image is based on
eclipse-temurin:17-jre-alpine, which already contains a JRE. Installing the fullopenjdk17-jdkadds ~200MB on top. A long-term consideration: modify the Dockerfile (#68) to useeclipse-temurin:17-jdk-alpineor pre-installopenjdk17-jdkin the image itself, avoiding runtime package download.Testing
./gradlew buildstep (this is the primary validation)JAVA_HOMEshould be correctly resolved by the Gradle wrapperRecommendations
apk add+JAVA_HOMEexport is the right approach for a musl-based Alpine CI runner.Verify JAVA_HOMEstep for better debuggability.setup-javaand other GitHub Actions that expect glibc.Approval Status
APPROVED — Ready for human merge (squash recommended per PR request).
The core change is technically correct and addresses the root cause. The concerns noted are non-blocking and can be addressed in follow-up work.