-
Notifications
You must be signed in to change notification settings - Fork 43
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
Conversation
@eed3si9n Would it be possible to review + merge this and release a new version? We are also experiencing this in Pekko |
@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). |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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") | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
So I can confirm that the feature that this PR implements doesn't work on Windows, see #115 for more details |
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.