bazel: Bazel 4.1 fails to desugar kotlinx-coroutines-core-jvm:1.5.0

Description of the problem / feature request:

Bazel 4.1 fails to desugar kotlinx-coroutines-core-jvm:1.5.0 producing the following exception:

ERROR: /private/var/tmp/_bazel_blee/f1f2afba98d721e05bb8ec203ca691d8/external/maven/BUILD:57:11: Desugaring v1/https/repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.5.0/kotlinx-coroutines-core-jvm-1.5.0.jar for Android failed: (Exit 1): desugar_java8 failed: error executing command bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/bazel_tools/tools/android/desugar_java8 ... (remaining 1 argument(s) skipped)
java.lang.TypeNotPresentException: Type sun.misc.SignalHandler not present
        at java.base/sun.invoke.util.BytecodeDescriptor.parseSig(BytecodeDescriptor.java:97)
        at java.base/sun.invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:69)
        at java.base/sun.invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:45)
        at java.base/java.lang.invoke.MethodType.fromDescriptor(MethodType.java:1134)
        at java.base/java.lang.invoke.MethodType.fromMethodDescriptorString(MethodType.java:1113)
        at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:406)
        at org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(MethodVisitor.java:461)
        at org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(MethodVisitor.java:461)
        at com.google.devtools.build.android.desugar.strconcat.IndyStringConcatDesugaring$IndifiedStringConcatInvocationConverter.visitInvokeDynamicInsn(IndyStringConcatDesugaring.java:141)
        at org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(MethodVisitor.java:461)
        at org.objectweb.asm.ClassReader.readCode(ClassReader.java:2444)
        at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1487)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:717)
        at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:544)
        at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:320)
        at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:240)
        at com.google.devtools.build.android.desugar.Desugar.processRequest(Desugar.java:1014)
        at com.google.devtools.build.android.desugar.Desugar.runPersistentWorker(Desugar.java:974)
        at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:952)
Caused by: java.lang.ClassNotFoundException: Class sun.misc.SignalHandler not found
        at com.google.devtools.build.android.desugar.io.HeaderClassLoader.findClass(HeaderClassLoader.java:53)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/sun.invoke.util.BytecodeDescriptor.parseSig(BytecodeDescriptor.java:95)
        ... 18 more

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Steps to reproduce can be found here https://github.com/Bencodes/bazel_issue_13553

Example failure: https://github.com/Bencodes/bazel_issue_13553/runs/2742154274?check_suite_focus=true#step:5:44

What operating system are you running Bazel on?

macOs 10.15.7

What’s the output of bazel info release?

release 4.1.0

Any other information, logs, or outputs that you want to share?

java-runtime: OpenJDK Runtime Environment (build 11.0.6+10-LTS) by Azul Systems, Inc. java-vm: OpenJDK 64-Bit Server VM (build 11.0.6+10-LTS, mixed mode) by Azul Systems, Inc.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 9
  • Comments: 15 (11 by maintainers)

Most upvoted comments

Bencodes/bazel_issue_13553#1 is a working workaround.

Thanks a lot!

Reproduced on release 5.2.0