Skip to content
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

Overcome 'String too large to record' issue with Truffle #40549

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import io.quarkus.deployment.annotations.BuildProducer;
Expand Down Expand Up @@ -46,8 +45,8 @@ public void set(List<SetClassPathSystemPropBuildItem> setCPItems,

}
}
String classPathValue = Stream.concat(parentFirst.stream(), regular.stream()).map(p -> p.toAbsolutePath().toString())
.collect(Collectors.joining(":"));
recorder.set(classPathValue);
List<String> allJarPaths = Stream.concat(parentFirst.stream(), regular.stream()).map(p -> p.toAbsolutePath().toString())
.toList();
recorder.set(allJarPaths);
Comment on lines +48 to +50
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we could merge this as it's better to not fail but I'm thinking that we are definitely not registering the appropriate paths.
From what I can see, it points to the jars in ~/.m2, which is definitely not expected.

@aloubyansky I suppose we have a way to point to the jars relative to the application? I'm not entirely sure though if the path would be the same in the case of a legacy-jar vs fast-jar vs uber-jar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we could merge this as it's better to not fail but I'm thinking that we are definitely not registering the appropriate paths

Yup, I mentioned that in the issue as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aloubyansky I suppose we have a way to point to the jars relative to the application? I'm not entirely sure though if the path would be the same in the case of a legacy-jar vs fast-jar vs uber-jar?

It would depend on the packaging. In case of uber-jar it would be paths to the artifacts in the local Maven repo relative to the application root.

}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.quarkus.runtime;

import java.util.List;

import io.quarkus.runtime.annotations.Recorder;

@Recorder
public class ClassPathSystemPropertyRecorder {

public void set(String value) {
System.setProperty("java.class.path", value);
public void set(List<String> allJarPaths) {
System.setProperty("java.class.path", String.join(":", allJarPaths));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to be OS-dependent?

}
}
Loading