Skip to content

[CALCITE-7649] Add bytecode verification check using ASM in the gradle build#5092

Draft
thomasrebele wants to merge 2 commits into
apache:mainfrom
thomasrebele:tr/CALCITE-7649
Draft

[CALCITE-7649] Add bytecode verification check using ASM in the gradle build#5092
thomasrebele wants to merge 2 commits into
apache:mainfrom
thomasrebele:tr/CALCITE-7649

Conversation

@thomasrebele

Copy link
Copy Markdown
Contributor

This is a rebase of @zabetak's PR #3783. I've fixed some warnings by adapting AsmCheckerTask to Gradle 8. I had to exclude spark/build/sparkServer/classes, as the classes in that dir failed the check.

I've verified the functionality by building a183b26 (i.e., without the fix for the invalid bytecode of CALCITE-6393) with JDK8. As expected, it produces java.lang.RuntimeException: Invalid bytecode file:/home/trebele/dev/calcite/c1/core/build/classes/java/main/org/apache/calcite/runtime/SqlFunctions.class when running ./gradlew build. The build passes with JDK17 and JDK21.

Here the versions that I've used:

$ /usr/lib/jvm/java-8-openjdk-amd64/bin/java -version
openjdk version "1.8.0_492"
OpenJDK Runtime Environment (build 1.8.0_492-8u492-ga~us2-0ubuntu1~24.04.1-b09)
OpenJDK 64-Bit Server VM (build 25.492-b09, mixed mode)
$ /usr/lib/jvm/java-17-openjdk-amd64/bin/java -version
openjdk version "17.0.19" 2026-04-21
OpenJDK Runtime Environment (build 17.0.19+10-1-24.04.2-Ubuntu)
OpenJDK 64-Bit Server VM (build 17.0.19+10-1-24.04.2-Ubuntu, mixed mode, sharing)
$ /usr/lib/jvm/java-21-openjdk-amd64/bin/java -version
openjdk version "21.0.11" 2026-04-21
OpenJDK Runtime Environment (build 21.0.11+10-1-24.04.2-Ubuntu)
OpenJDK 64-Bit Server VM (build 21.0.11+10-1-24.04.2-Ubuntu, mixed mode, sharing)

Jira Link

CALCITE-7649

Changes Proposed

This PR proposes to add a check to fail the build if it produced invalid bytecode.

@sonarqubecloud

Copy link
Copy Markdown

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.

3 participants