-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8333664: Decouple command line parsing and package building in jpackage #19668
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
8333664: Decouple command line parsing and package building in jpackage #19668
Conversation
|
👋 Welcome back asemenyuk! A progress list of the required criteria for merging this PR into |
|
@alexeysemenyukoracle 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 117 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. ➡️ To integrate this PR with the above commit message to the |
|
@alexeysemenyukoracle The following label 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 list. If you would like to change these labels, use the /label pull request command. |
|
@alexeysemenyukoracle this pull request can not be integrated into git checkout JDK-8333664
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
|
|
@alexeysemenyukoracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
keep the PR open |
|
@alexeysemenyukoracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@alexeysemenyukoracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
2 similar comments
|
@alexeysemenyukoracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@alexeysemenyukoracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@alexeysemenyukoracle This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
|
keep it open |
|
/open |
|
@alexeysemenyukoracle This pull request is now open |
|
@sashamatveev PTAL |
9776f49 to
b7865ff
Compare
|
@alexeysemenyukoracle Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
… directories in external directory; Add clean_stashed_files.sh
30e2a72 to
011eb71
Compare
|
@alexeysemenyukoracle Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
sashamatveev
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.
Looks good with minor comments.
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/DesktopIntegration.java
Outdated
Show resolved
Hide resolved
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/DesktopIntegration.java
Show resolved
Hide resolved
src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageDesc.java
Outdated
Show resolved
Hide resolved
src/jdk.jpackage/share/classes/jdk/jpackage/internal/BuildEnvBuilder.java
Outdated
Show resolved
Hide resolved
src/jdk.jpackage/share/classes/jdk/jpackage/internal/PackageBuilder.java
Outdated
Show resolved
Hide resolved
src/jdk.jpackage/share/classes/jdk/jpackage/internal/model/package-info.java
Outdated
Show resolved
Hide resolved
src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/CompositeProxy.java
Outdated
Show resolved
Hide resolved
src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixAppImageFragmentBuilder.java
Outdated
Show resolved
Hide resolved
|
Thank you for the review! I'll address the findings. |
|
All findings fixed. |
sashamatveev
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.
Looks good.
|
/integrate |
|
Going to push as commit 21c1282.
Your commit was automatically rebased without conflicts. |
|
@alexeysemenyukoracle Pushed as commit 21c1282. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Refactor jpackage to separate the configuration and execution phases.
At the configuration phase, jpackage parses command-line arguments and validates them.
At the execution phase, jpackage builds a bundle based on data collected at the configuration phase.
There was no clear separation between these phases. Both used the same data type (
Map<String, Object>), making it hard to understand and use properly.This change introduces data model to jpackage (classes in "jdk.jpackage.internal.model" package). The output of the configuration phase is either an instance of jdk.jpackage.internal.model.Application interface for app image bundling or jdk.jpackage.internal.model.Package for native package bundling.
The execution phase has been reworked to get configuration properties from the new
jdk.jpackage.internal.model.Applicationandjdk.jpackage.internal.model.Packageinterfaces instead of extracting data fromMap<String, Object>"params".Additionally, a notion of "packaging pipeline" (jdk.jpackage.internal.PackagingPipeline class) was added to configure packaging declaratively with more code sharing between bundlers.
jdk.jpackage module javadoc - https://alexeysemenyukoracle.github.io/jpackage-javadoc/jdk.jpackage/module-summary.html
Functional changes
jpackage behavior 99% remains the same, i.e., it produces the same bundles for the given parameters. This change affects only the implementation. Still, there are some changes in jpackage behavior. They are outlined below.
Before this change, native package bundlers made redundant copies of the source app image. E.g., msi and linux package bundlers copied the external app image (the one specified with
--app-imageparameter); linux package bundlers always transformed the source app image if the installation directory was in the "/usr" tree (--install-dir /usr). This change eliminates all redundant app image copy/transformations.post- and pre- install PKG scripts for SimplePackageTest package before and after the change:
This change relates to the JDK-8356047 issue. Although the scripts are different, they are functionally identical (they don't change anything in the system).
jpackage will not create post- and pre- install scripts in runtime PKGs. This doesn't make a difference as runtime bundling on macOS is currently broken, see JDK-8351073 issue.
Use
java.security.cert.X509Certificateclass to parse the signing certificates data instead of "/usr/bin/openssl" invocations.To identify the certificate unambiguously, the certificate's SHA1 hash is passed as a value of the "-s" parameter for codesign instead of the certificate name.
Testing
With these significant code changes, ensuring that jpackage still produces packages with the same properties for the given input was essential.
jpackage uses external tools for building packages, supplying them with the configuration files. Assuming that a packaging tool would produce the same package for the given configuration files, these configuration files created by the "old" jpackage and the "new" jpackage in every jpackage test were examined and verified for no substantial differences. ConfigFilesStasher.java and clean_stashed_files.sh tools served this purpose. Thanks to this way to test jpackage, JDK-8356219 was uncovered.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19668/head:pull/19668$ git checkout pull/19668Update a local copy of the PR:
$ git checkout pull/19668$ git pull https://git.openjdk.org/jdk.git pull/19668/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19668View PR using the GUI difftool:
$ git pr show -t 19668Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19668.diff
Using Webrev
Link to Webrev Comment