Skip to content

Modernize build infrastructure: Gradle 6.7.1 → 8.6#580

Merged
wmoustafa merged 1 commit intolinkedin:masterfrom
YogeshKothari26:pr1-gradle-modernization
Mar 10, 2026
Merged

Modernize build infrastructure: Gradle 6.7.1 → 8.6#580
wmoustafa merged 1 commit intolinkedin:masterfrom
YogeshKothari26:pr1-gradle-modernization

Conversation

@YogeshKothari26
Copy link
Copy Markdown
Contributor

@YogeshKothari26 YogeshKothari26 commented Mar 4, 2026

What changes are proposed in this pull request, and why are they necessary?

This PR upgrades Coral's build infrastructure from Gradle 6.7.1 to Gradle 8.6. This is the first of three PRs to migrate Coral to Java 17 + Hive 2.3.9. This PR contains no functional changes — only build tooling updates required for Gradle 8 compatibility.

Why Gradle 8: Gradle 6.x does not support Java 17 toolchains, which are needed for the upcoming Java 17 migration.

Gradle wrapper: 6.7.1 → 8.6

Dependency configurations: compileimplementation/api, testCompiletestImplementation across all module build.gradle files. These configurations were removed in Gradle 7 — the build fails with Could not find method testCompile() without this change.

Shadow plugin: 6.1.0 → 8.3.5 in shading/coral-trino-parser. The old ConfigureShadowRelocation auto-relocation task was removed in Shadow 8. Replaced with explicit relocate calls covering the same packages (verified: shadow JAR contents are identical to master). compileOnly is no longer resolvable in Gradle 8, so a resolvable shadowDeps configuration is used instead. Publication override added because disabling the standard jar task requires explicitly telling Maven publishing to use the shadow jar.

Publication: classifierarchiveClassifier in gradle/java-publication.gradle (removed in Gradle 8). Publishing and signing remain fully functional.

Spring Boot: 2.4.0 → 2.7.18 in coral-service (2.4.0 is incompatible with Gradle 8 due to LazyPublishArtifact API change). http://conjars.orghttps://conjars.org (Gradle 8 blocks insecure HTTP repository URLs by default).

settings.gradle: Added pluginManagement block (required by Gradle 8 for plugin resolution). Changed subproject discovery to filter directories without build.gradle (the old eachDir pattern includes build/ and src/ as phantom subprojects, causing Gradle 8 strict validation failures on non-clean checkouts).

spark_itest.gradle: testCompile/testRuntimetestImplementation/testRuntimeOnly (removed in Gradle 8). sparktestCompile/spark3testCompilesparktestImplementation/spark3testImplementation.

coral-hive: Added spotlessJava.mustRunAfter(generateGrammarSource) (Gradle 8 strict validation requires explicit task ordering between Spotless and ANTLR source generation).

coral-common/coral-hive: Added java-library plugin and changed compileapi for dependencies that downstream modules use transitively. This preserves the transitive behavior that compile provided in Gradle 6.

How was this patch tested?

  1. ./gradlew clean build on Java 8 — BUILD SUCCESSFUL (233 tasks, all tests pass)
  2. ./gradlew spotlessApply — all formatting checks pass
  3. publishJavaLibraryPublicationToMavenLocal succeeds for all modules
  4. Shadow JAR contents verified identical to master — full verification report (3,450 entries, 3,280 class files, bytecode references all properly relocated)

- Gradle wrapper 6.7.1 → 8.6
- compile/testCompile → implementation/api/testImplementation (removed in Gradle 7+)
- Shadow 6.1.0 → 8.3.5 (ConfigureShadowRelocation removed, compileOnly not resolvable)
- classifier → archiveClassifier (removed in Gradle 8)
- Spring Boot 2.4.0 → 2.7.18 (LazyPublishArtifact incompatible with Gradle 8)
- conjars http → https (Gradle 8 blocks insecure HTTP repos)
- settings.gradle: pluginManagement block, subproject discovery filter
- coral-spark/spark_itest.gradle: testCompile/testRuntime → testImplementation/testRuntimeOnly
- coral-hive: spotless/ANTLR task ordering for Gradle 8 strict validation

Stays on Java 8, Hive 1.2.2, Spotless 5.9.0 — no functional changes.
@YogeshKothari26 YogeshKothari26 force-pushed the pr1-gradle-modernization branch from faeedb0 to 5d8855d Compare March 4, 2026 12:07
@YogeshKothari26
Copy link
Copy Markdown
Contributor Author

YogeshKothari26 commented Mar 4, 2026

Shadow JAR Verification: master vs PR branch

Verifying that the shadow JAR produced by the new Shadow 8.3.5 configuration is identical to the one produced by the old Shadow 6.1.0 + ConfigureShadowRelocation.

JAR Metadata

master (Shadow 6.1.0) PR branch (Shadow 8.3.5)
File coral-trino-parser-2.3.0.jar coral-trino-parser-2.3.3.jar
Size 4,692,039 bytes 4,692,052 bytes
Entry count 3,450 3,450
Class file count 3,280 3,280

Version difference (2.3.0 vs 2.3.3) is auto-generated by shipkit-auto-version based on commit count from the last tag. The 13-byte size difference is the version string in META-INF/MANIFEST.MF. Class files are identical.

Entry Diff

IDENTICAL — all 3,450 entries match exactly. Zero differences.

Unrelocated Packages Check

PASS — all class files are under coral/shading/. No unrelocated classes found outside the shading namespace.

Bytecode Reference Verification

Checked coral.shading.io.trino.sql.parser.SqlParser constant pool for unrelocated references:

PASS — no unrelocated io.trino, io.airlift, or org.antlr.v4 references in bytecode. All internal class references are properly rewritten to coral.shading.*.

Relocated Top-Level Packages

  • coral.shading.com (Google Guava)
  • coral.shading.io (Trino parser, Airlift)
  • coral.shading.javax (javax.annotation)
  • coral.shading.org (ANTLR v4, Checkerframework, OpenJDK JOL)

Verification Commands

# Build both JARs
git checkout master && ./gradlew :shading:coral-trino-parser:shadowJar
# produces: coral-trino-parser-2.3.0.jar

git checkout pr1-gradle-modernization && ./gradlew :shading:coral-trino-parser:shadowJar
# produces: coral-trino-parser-2.3.3.jar

# Compare all entries
jar tf coral-trino-parser-2.3.0.jar | sort > master-entries.txt
jar tf coral-trino-parser-2.3.3.jar | sort > pr-entries.txt
diff master-entries.txt pr-entries.txt
# (no output — identical)

# Check for unrelocated classes
jar tf coral-trino-parser-2.3.3.jar | grep '\.class$' | grep -v "^coral/shading/"
# (no output — all classes properly relocated)

# Check bytecode references
javap -v -c -cp coral-trino-parser-2.3.3.jar coral.shading.io.trino.sql.parser.SqlParser | grep " io\.trino\."
# (no output — no unrelocated references in bytecode)

@YogeshKothari26 YogeshKothari26 marked this pull request as ready for review March 4, 2026 12:51
Copy link
Copy Markdown
Contributor

@wmoustafa wmoustafa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the upgrade @YogeshKothari26!

@YogeshKothari26
Copy link
Copy Markdown
Contributor Author

@wmoustafa @aastha25 @ruolin59 Could you help approve the pending workflow to enable merging PR?
It needs to be approved by a maintainer.
image

@wmoustafa wmoustafa merged commit 39cc6bd into linkedin:master Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants