Read the primordial scope from jrt:/ and ship codeanalyzer-java on PyPI with a bundled JVM - #223
Merged
Merged
Conversation
…ith a bundled JVM WALA's primordial scope was loaded by walking $JAVA_HOME/jmods, which tied the analyzer to a full JDK with jmods and a JAVA_HOME. Unset, level 2 silently fell back to declared-only edges and the L3/L4 WALA engine was unavailable. The scope now comes from the JVM running the analysis, through the jrt:/ filesystem (lib/modules), so any runtime works, including jlink'd ones. WALA's own JrtModule cannot be used: it closes its Files.list stream inside try-with-resources before returning it, and iterating fails with "source already consumed or closed" (still true in 1.8.0). A small eager JrtModule under com.ibm.cldk.utils replaces it. packaging/python builds a pure wheel, codeanalyzer-java, with the fat jar under _bin/ and jdk4py (Temurin 21) as the runtime, installing a canjv launcher. jdk4py is pinned below 22 because Shrike 1.6.7 rejects class files above version 67. release.yml verifies the tag against gradle.properties, builds the wheel after the jar, and publishes it to PyPI via Trusted Publishing, so jar and wheel stay in lockstep. Bump to 3.0.2. Verified on daytrader8 under jdk4py 21 with JAVA_HOME unset: -a 2 edge set equal to the jmods baseline (1876 edges), -a 3 --l3-engine wala byte-identical. Closes #222
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.
Closes #222
What
ScopeUtilsloads WALA's primordial scope from the running JVM viajrt:/instead of$JAVA_HOME/jmods. NoJAVA_HOME, no jmods, any runtime.com.ibm.cldk.utils.JrtModule: WALA's own one closes its stream before returning it (1.6.7 through 1.8.0).packaging/python: pure wheelcodeanalyzer-java= fat jar +jdk4py>=21,<22runtime +canjvlauncher. One wheel for all platforms; jdk4py's platform wheels carry the JVM.release.yml: tag must equalgradle.properties; builds and publishes the wheel via PyPI Trusted Publishing alongside the jar.Verified
daytrader8, jdk4py 21,
JAVA_HOMEunset, no jmods on the machine:-a 2-a 3 --l3-engine walaanalysis.jsonpip installwheel,canjv -a 2./gradlew testBefore tagging
PyPI Trusted Publishing must be configured on the
codeanalyzer-javaproject for this repo andrelease.yml, or the publish step fails.