Repository navigation
docs: the PyPI install needs a real JDK from -a 2 onwards - #241
Merged
Merged
Conversation
The quick-install block said "no system Java needed" and then demonstrated `-a 2` — the first level that cannot work without one. `jdk4py` ships a JRE: `java`, no `javac`. From level 2 the analyzer shells out to the target project's Maven/Gradle wrapper to resolve dependencies and compile it, because WALA reads compiled classes rather than source, and that subprocess does its own JAVA_HOME discovery. The failure is quiet, which is what makes the wrong claim expensive: the run still exits 0, warns on stderr, and hands back declared call edges and the syntactic DDG with the RTA overlay and the L4 semantic DDG missing. A caller reading the exit code sees success and a thinner graph. Changes the example to `-a 1`, states the JRE/JDK split and what silently drops without it, and says `--emit neo4j` needs a JDK too since it always projects at full depth regardless of `-a`. The same correction goes into the wheel's own docstring, which made the claim in the package users actually install. Adds two FAQ entries for the adjacent surprise: `--no-build` does not suppress dependency resolution, so Maven still runs and writes into `<project>/target/_library_dependencies/`, and `No application classes found` under `--no-build` is the flag being taken at its word rather than a bug. Docs only; no behaviour change.
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.
The quick-install block said "no system Java needed" and then demonstrated
-a 2— the first level that cannot work without one. That is the worst possible pairing: it tells a reader the exact opposite of the truth and hands them a command that proves it.What is actually true
pip install codeanalyzer-javapullsjdk4py, whose runtime is a JRE. Verified:No
javac. From-a 2the analyzer shells out to the target project's Maven/Gradle wrapper to resolve dependencies and compile it — WALA reads compiled classes, not source — and that subprocess does its ownJAVA_HOMEdiscovery. So level 1 genuinely needs no system Java; level 2 onwards genuinely does.Why the wrong claim was expensive
The failure is quiet. The run exits 0, warns on stderr, and returns a thinner graph:
You keep declared call edges and the syntactic DDG; you lose the RTA overlay and the alias-aware
prov: ["points-to"]edges. A caller checking only the exit status sees success.Changes
-a 1, with an admonition stating the JRE/JDK split, theexport JAVA_HOME=...you actually need, exactly what drops silently without it, and that--emit neo4jneeds a JDK too since it always projects at full depth regardless of-a.packaging/python/src/codeanalyzer_java/__init__.py— it made the "needs no system Java" claim inside the package users install, so fixing only the README would leave the false promise shipping on PyPI.--no-builddoes not suppress dependency resolution.CodeAnalyzer.java:459callsdownloadLibraryDependenciesunconditionally, somvnw ... dependency:copy-dependenciesstill runs, printsBUILD SUCCESS, and writes into<project>/target/_library_dependencies/. It compiles nothing.No application classes foundunder--no-buildis the flag being taken at its word ("I have already built this"), not a bug.Docs only; no behaviour change. Applies to 3.1.0 and every 3.0.x wheel.
Not fixed here
The two underlying defects, which want their own issues rather than a docs patch:
--no-build's contract. It reads as "do not run a build tool against my project" and it does. The obvious fix — skip dependency resolution too — would regress type resolution to bare spellings at every level, so this is a naming/contract decision, not a one-line guard.WARNand exit 0. Worth considering a non-zero exit or an explicit marker in the payload so a programmatic caller can tell a full graph from a degraded one.