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

8287971: Throw exception for missing values in .jpackage.xml #9098

Closed
wants to merge 1 commit into from

Conversation

sashamatveev
Copy link
Member

@sashamatveev sashamatveev commented Jun 9, 2022

  • Warning will be printed if .jpackage.xml has old version number.
  • Error will be thrown if main-class and app-store values are missing from .jpackage.xml.
  • Both main-class and app-store are required values for JDK-8286850 and they might be missing if user uses app images generated by previous jpackage version.

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8287971: Throw exception for missing values in .jpackage.xml

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/9098/head:pull/9098
$ git checkout pull/9098

Update a local copy of the PR:
$ git checkout pull/9098
$ git pull https://git.openjdk.java.net/jdk pull/9098/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9098

View PR using the GUI difftool:
$ git pr show -t 9098

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/9098.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 9, 2022

👋 Welcome back almatvee! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 9, 2022
@openjdk
Copy link

openjdk bot commented Jun 9, 2022

@sashamatveev The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Jun 9, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 9, 2022

Webrevs

@alexeysemenyukoracle
Copy link
Member

alexeysemenyukoracle commented Jun 9, 2022

If some fields of .jpackage.xml are not valid, the entire file must be considered invalid, not only the invalid fields. This is the idea of AppImageFile.isValid() method.
We do not support backward compatibility for .jpackage.xml for simplicity.
We do support only the case when an application image supplied in --app-image parameter to jpackage was created by the same jpackage, and not by jpackage from another JDK or from the same JDK but on another platform.

I'd discard this fix and create a new one that will:

  1. Make AppImageFile.getVersion() return the value of java.version system property instead of hardcoded "1.0" value
  2. If AppImageFile.isValid() returns false, throw exception saying that .jpackage.xml is malformed instead of returning empty AppImageFile instance from AppImageFile.load()
  3. Drop AppImageFile.verifyCompatible() as it seems to be not used

@sashamatveev
Copy link
Member Author

Re-submitted in JDK 19. openjdk/jdk19#9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review
2 participants