-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade of JDK11 to >11.0.9.1 breaks android desugarer #12880
Comments
This is blocking JDK upgrade, which is required by some organisations.
|
This was fixed internally in cl/164671681, which added a # A wrapper around the desugar binary that sets
# jdk.internal.lambda.dumpProxyClasses.
# exit on errors and uninitialized variables
set -eu
readonly TMPDIR="$(mktemp -d)"
trap "rm -rf ${TMPDIR}" EXIT
"${0}.runfiles/bazel/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_java" \
"--jvm_flag=-Djdk.internal.lambda.dumpProxyClasses=${TMPDIR}" "$@" |
Thanks @cushon, I'll take a look if I can do the same in Bazel and upgrade the JDK. |
…at sets jdk.internal.lambda.dumpProxyClasses In JDK11 >11.0.9.1, the platform uses lambdas early enough that the LambdaMetaFactory class gets loaded by desugar's main is reached, so it doesn't get a chance to set the dump directory. The wrapper script let's us upgrade JDK version. Fixes #12880 PiperOrigin-RevId: 401933663
Description of the problem / feature request:
Upgrade of JDK11 to version 11.0.9.1, 11.0.10 breaks Android desugarer. (Versions up to 11.0.9 work)
Problem is in Desugar.java#L108,
which attempts to set system property
jdk.internal.lambda.dumpProxyClasses
in static initializer before it is read byjava.lang.invoke.InnerClassLambdaMetafactory
static initializer. The latter initializer is invoked first.Target
//src/test/java/com/google/devtools/build/android/desugar:desugar_testdata
fails to build, with exception:While tests
continue to work (because property is set using jvm_opts).
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Checkout
https://github.com/comius/bazel/tree/bazel_issue_12880
and run
bazel test //src/test/java/com/google/devtools/build/android/desugar:desugar_testdata
What operating system are you running Bazel on?
Linux
What's the output of
bazel info release
?Bazel@a181dd4
Related issue #12512
The text was updated successfully, but these errors were encountered: