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

Fixed Invalid CEN extra data field on recent JVM #81

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

romainreuillon
Copy link
Contributor

Jar crafted with BND raise an error when opened by the JVM jar tools:
https://bugs.openjdk.org/browse/JDK-8313765

It seems that this state of things won't be changed on the JVM side. This patch exposes an boolean settings to build the jar produced by sbt-osgi using the JVM tools instead of the one of BND. This result in bundle supported by the the build tools with no extra flags passed to the JVM.

@mdedetrich
Copy link
Collaborator

@eed3si9n Would it be possible to review + merge this and release a new version? We are also experiencing this in Pekko

@mdedetrich
Copy link
Collaborator

@romainreuillon Do you want to rebase this PR against main to bring in the latest changes? Also do you think it would be possible to add tests (not a deal breaker but would be good to verify that everything is working correctly).

Copy link
Collaborator

@mdedetrich mdedetrich left a comment

Choose a reason for hiding this comment

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

Considering that this is behind a flag I am going to go ahead and merge this since at least for us (Pekko) its breaking our build.

if (!useJVMJar) jar.write(tmpArtifactPath)
else {
val tmpArtifactDirectoryPath = file(artifactPath.absolutePath + "_tmpdir")
IO.delete(tmpArtifactDirectoryPath)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will it also deletes all the content?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know, I didn't write this code. @romainreuillon Might be able to explain more here.

val packageWithJVMJar: SettingKey[Boolean] =
SettingKey[Boolean](prefix("PackageWithJVMJar"), "Use the JVM jar tools to craft the bundle instead of the one from BND." +
"Without this setting the produced bundle are detected as corrupted by recent JVMs")

Copy link
Contributor

Choose a reason for hiding this comment

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

Just swith to the jar tool?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the jar tool that comes with JVM, and we cant use BND because it creates corrupted jar's (thats why this feature was implemented in the first place)

@mdedetrich
Copy link
Collaborator

So I can confirm that the feature that this PR implements doesn't work on Windows, see #115 for more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants