-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8296329: jar validator doesn't account for minor class file version #11153
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
Conversation
|
👋 Welcome back blindpirate! A progress list of the required criteria for merging this PR into |
|
@blindpirate The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
See also JDK-8296119. I don't know how common it will be for someone to publish a MR JAR containing classes compiled to use preview features. It would be a bit inconvenient for users as they would need to know to run with --enable-preview on some releases. This shouldn't impact the API compatibility checking that the jar tool does so dropping the minor version and just checking the major version might be okay. |
JornVernee
left a comment
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.
Please assign the JBS ticket to yourself as well.
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.
My concern with this is that this will need to be updated after each release. Looks like there are also ways to directly alter the minor version of a class file, and I recommend doing that instead. See: https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java#L51
Also, there's one more negative case missing where the base version uses 20 + preview features, and the other version is 19.
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.
Thanks @JornVernee . I have updated the test, PTAL!
Please assign the JBS ticket to yourself as well.
Sorry, I don't have permission to update JBS ticket.
93ec7fb to
b293cbf
Compare
|
@blindpirate Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information. |
JornVernee
left a comment
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 looks good to me. Thanks for fixing.
I'm running a test job for tier 1-4 as well
|
@blindpirate This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 173 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@JornVernee) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
@JornVernee can you please sponsor this PR? |
|
@blindpirate Yes. If you |
|
/integrate |
|
@blindpirate |
|
/sponsor |
|
Thanks @JornVernee ! |
|
Going to push as commit faf48e6.
Your commit was automatically rebased without conflicts. |
|
@JornVernee @blindpirate Pushed as commit faf48e6. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
As described in JDK-8296329, previously, the jar validator compare the "version" to validate a multi-release jar. The "version" is a mix of the major and minor version fused into a single int, which might be a negative number with
--enable-preview- this result in wrong comparison.This PR fixes it by only comparing major versions.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11153/head:pull/11153$ git checkout pull/11153Update a local copy of the PR:
$ git checkout pull/11153$ git pull https://git.openjdk.org/jdk pull/11153/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11153View PR using the GUI difftool:
$ git pr show -t 11153Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11153.diff