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

[export] JPMS module info calculation fails #5258

Merged
merged 1 commit into from
May 23, 2022
Merged
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
[export] JPMS module info calculation fails
There was a recent change dd2f0c5 that took a shortcut to calculate the embedded packages unconditionally. It used the bundle class path analysis to analyze all the jars in the executable. 

However, this significantly slows down Eclipse but worse, it then tries to reinterpret the annotation headers. In my case, I got 3 types on the Bundle-Activator.

The analysis should only be done when it is needed and I'd suggest to do it either in a separate Builder or try to analyze the manifests for speedup.

This patch just makes the analysis conditional but that is a temporary fix to make it compatible with the the previous code.

This needs to be cherry picked for 6.3.0 since it is a very serious regression.

Fixes  #5257

Signed-off-by: Peter Kriens <Peter.Kriens@aqute.biz>
  • Loading branch information
pkriens committed May 23, 2022
commit 92ede60d4479bb032c298d8378710760183b38c4
Original file line number Diff line number Diff line change
Expand Up @@ -357,19 +357,24 @@ public Jar executable() throws Exception {
}
}

List<String> bcpList = new ArrayList<>();
bcpList.add(".");
bcpList.addAll(classpath);
bcpList.addAll(actualPaths);

builder.setProperty(BUNDLE_CLASSPATH, bcpList.stream()
.collect(joining(",")));
builder.setProperty(EXPORT_CONTENTS, "aQute.launcher.pre");

// Ignore common warnings resulting from the Bundle-ClassPath which
// are irrelevant in this use case
builder.setProperty(FIXUPMESSAGES,
"Classes found in the wrong directory, private references, Export-Package duplicate package name, Invalid package name: * in Export-Package");
String moduleProperty = builder.getProperty(JPMS_MODULE_INFO);
if (moduleProperty != null) {

List<String> bcpList = new ArrayList<>();
bcpList.add(".");
bcpList.addAll(classpath);
bcpList.addAll(actualPaths);

builder.setProperty(BUNDLE_CLASSPATH, bcpList.stream()
.collect(joining(",")));
builder.setProperty(EXPORT_CONTENTS, "aQute.launcher.pre");

// Ignore common warnings resulting from the Bundle-ClassPath
// which
// are irrelevant in this use case
builder.setProperty(FIXUPMESSAGES,
"Classes found in the wrong directory, private references, Export-Package duplicate package name, Invalid package name: * in Export-Package");
}

LauncherConstants lc = getConstants(actualPaths, true);
lc.embedded = true;
Expand Down