Exception when building application with a lot of dependencies, String too large to record error #39350
Description
Describe the bug
We have application which is using a lot of dependencies. Our GH Action started to fail recently. The error is String too large to record
coming from https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java#L681
I searched for the commit that triggers this and it's 4d05306 to bump GraalVM SDK version to 23.1.2
When I put some logging into BytecodeRecorderImpl
I realized that when graal sdk 23.0 is used there is no long string coming through BytecodeRecorderImpl
.
But with graal sdk 23.1 there is long string that represents the classpath.
After some additional digging I found 738a24d (make Truffle from GraalVM 23.1 work) which confirmed that passing of classpath is happening with GraalVM 23.1 (and later).
Questions:
So to me this looks like both regression/bug and intentional behavior (fix for issue)
- Can be the fix for Quarkus cannot load Truffle/polyglot languages with the custom class loader. #36242 be adjusted (
truffleUsed
logic)? - We keep it as is and communicate that Quarkus has limit on classpath length?
How does GraalVM get on the CP?
[INFO] +- io.quarkus:quarkus-junit5:jar:999-SNAPSHOT:test
[INFO] | +- io.quarkus:quarkus-bootstrap-core:jar:999-SNAPSHOT:test
[INFO] | | +- io.quarkus:quarkus-bootstrap-app-model:jar:999-SNAPSHOT:test
[INFO] | | \- io.smallrye.common:smallrye-common-io:jar:2.3.0:compile
[INFO] | +- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.9.0.M2:test
[INFO] | +- io.quarkus:quarkus-test-common:jar:999-SNAPSHOT:test
[INFO] | | +- io.quarkus:quarkus-core-deployment:jar:999-SNAPSHOT:test
[INFO] | | | +- org.aesh:readline:jar:2.4:test
[INFO] | | | | \- org.fusesource.jansi:jansi:jar:2.4.0:test
[INFO] | | | +- org.aesh:aesh:jar:2.7:test
[INFO] | | | +- io.quarkus.gizmo:gizmo:jar:1.8.0:test
[INFO] | | | | \- org.ow2.asm:asm-util:jar:9.6:test
[INFO] | | | | \- org.ow2.asm:asm-analysis:jar:9.6:test
[INFO] | | | +- org.ow2.asm:asm:jar:9.6:test
[INFO] | | | +- org.ow2.asm:asm-commons:jar:9.6:test
[INFO] | | | | \- org.ow2.asm:asm-tree:jar:9.6:test
[INFO] | | | +- io.quarkus:quarkus-class-change-agent:jar:999-SNAPSHOT:test
[INFO] | | | +- io.quarkus:quarkus-devtools-utilities:jar:999-SNAPSHOT:test
[INFO] | | | +- io.quarkus:quarkus-builder:jar:999-SNAPSHOT:test
[INFO] | | | +- org.graalvm.sdk:graal-sdk:jar:23.1.2:test
[INFO] | | | | +- org.graalvm.sdk:collections:jar:23.1.2:test
[INFO] | | | | +- org.graalvm.sdk:nativeimage:jar:23.1.2:test
[INFO] | | | | +- org.graalvm.polyglot:polyglot:jar:23.1.2:test
[INFO] | | | | \- org.graalvm.sdk:word:jar:23.1.2:test
Stack trace:
[ERROR] Errors:
[ERROR] AlmostAllQuarkusExtensionsTest.testQuarkusEndpointWithManyExtensions » Runtime java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.deployment.steps.MainClassBuildStep#build threw an exception: java.lang.RuntimeException: Failed to record call to method public void io.quarkus.runtime.ClassPathSystemPropertyRecorder.set(java.lang.String)
at io.quarkus.deployment.recording.BytecodeRecorderImpl.writeBytecode(BytecodeRecorderImpl.java:480)
at io.quarkus.deployment.steps.MainClassBuildStep.writeRecordedBytecode(MainClassBuildStep.java:501)
at io.quarkus.deployment.steps.MainClassBuildStep.build(MainClassBuildStep.java:201)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at java.base/java.lang.Thread.run(Thread.java:833)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.RuntimeException: String too large to record: /Users/rsvoboda/.m2/repository/io/quarkus/quarkus-bootstrap-core/999-SNAPSHOT/quarkus-bootstrap-core-999-SNAPSHOT.jar:/Users/rsvoboda/...
....
Expected behavior
Execution passes without error.
Actual behavior
Error is thrown.
How to Reproduce?
git clone https://github.com/quarkus-qe/beefy-scenarios
cd beefy-scenarios
mvn clean verify -fae -pl 002-quarkus-all-extensions -DskipTests
Output of uname -a
or ver
macOS
Output of java -version
Java 17
Quarkus version or git rev
Quarkus main 4ca065f
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
No response
Activity