The build fails but the error message is not clear. Running with debugging and then running the command manually in the Bazel sandbox unveils the exception. We should catch it and report a more user friendly way.
external/bazel_jdt_java_toolchain/compiler/export/JdtJavaBuilder_deploy.jar \
@bazel-out/k8-fastbuild/bin/....jar-0.params \
@bazel-out/k8-fastbuild/bin/....jar-1.params)
java.io.IOException: Error while instrumenting bazel-out/k8-fastbuild/bin/....class with JaCoCo 0.8.11.202310140853/f33756c.
at org.jacoco.core.instr.Instrumenter.instrumentError(Instrumenter.java:161)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:111)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:136)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:156)
at com.google.devtools.build.buildjar.instrumentation.JacocoInstrumentationProcessor$1.visitFile(JacocoInstrumentationProcessor.java:143)
at com.google.devtools.build.buildjar.instrumentation.JacocoInstrumentationProcessor$1.visitFile(JacocoInstrumentationProcessor.java:115)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2786)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2857)
at com.google.devtools.build.buildjar.instrumentation.JacocoInstrumentationProcessor.instrumentRecursively(JacocoInstrumentationProcessor.java:113)
at com.google.devtools.build.buildjar.instrumentation.JacocoInstrumentationProcessor.processRequest(JacocoInstrumentationProcessor.java:87)
at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.buildJar(SimpleJavaLibraryBuilder.java:159)
at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.run(SimpleJavaLibraryBuilder.java:128)
at com.google.devtools.build.buildjar.BazelEcjJavaBuilder.build(BazelEcjJavaBuilder.java:110)
at com.google.devtools.build.buildjar.BazelEcjJavaBuilder.parseAndBuild(BazelEcjJavaBuilder.java:82)
at com.google.devtools.build.buildjar.BazelEcjJavaBuilder.main(BazelEcjJavaBuilder.java:70)
Caused by: org.objectweb.asm.MethodTooLargeException: Method too large: ...
at org.objectweb.asm.MethodWriter.computeMethodInfoSize(MethodWriter.java:2088)
at org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:512)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:92)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:109)
... 13 more
The build fails but the error message is not clear. Running with debugging and then running the command manually in the Bazel sandbox unveils the exception. We should catch it and report a more user friendly way.