Pass KYTHE_JAVA_RUNTIME_OPTIONS via Gradle forkOptions#3030
Pass KYTHE_JAVA_RUNTIME_OPTIONS via Gradle forkOptions#3030sharma1210 wants to merge 9 commits intogoogle:masterfrom
Conversation
|
You can test this PR by running this command in the release/ directory. _KYTHE_VERSION is v0.0.68 You'll need to specify the GCP project for the command. Try domain-registry-crash first. If it won't run, then use domain-registry-dev. Code quote: # gcloud builds submit --config cloudbuild-kythe.yaml --substitutions \
# _KYTHE_VERSION=[kythe_version] .. |
|
This is fragile. You may want to:
Code quote: chmod +x $${JAVA_HOME}/bin/javac
sed -i 's/"$REAL_JAVAC" "$@"/ "$REAL_JAVAC" $REAL_JAVAC_JVM_OPTIONS "$@"/g' $${JAVA_HOME}/bin/javac |
Thanks for your suggestion Weimin it worked now! |
weiminyu
left a comment
There was a problem hiding this comment.
@weiminyu reviewed 2 files and all commit messages, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on sharma1210).
weiminyu
left a comment
There was a problem hiding this comment.
@weiminyu resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on sharma1210).
This PR fixes the Kythe extraction failure caused by Error Prone access to JDK internals.
Problem
The build was failing during the
:util:compileJavatask because the Error Prone static analysis plugin was trying to access internal compiler APIs (com.sun.tools.javac.comp.Resolve.findIdent) that are strictly encapsulated in newer Java versions. Previous attempts to pass--add-opensvia compiler arguments or specific environment variables failed or were ignored by the wrapper scripts.Fix
Used the standard
JAVA_TOOL_OPTIONSenvironment variable incloudbuild-kythe.yamlto pass the required--add-opensflags to all JVMs started during the build (including the Gradle daemon and forked compiler workers). This ensures that Error Prone has the necessary access tojdk.compilermodules.This has been tested manually in Cloud Build and successfully generated and uploaded the kzip file.
BUG=496522435
This change is