RFR: 8325089: jpackage utility creates an "infinite", undeleteable directory tree [v9]

Alexey Semenyuk asemenyuk at openjdk.org
Tue Oct 29 18:37:38 UTC 2024


> Make jpackage correctly handle the output directory (`--dest`) that is:
>  - a subdirectory of the input directory;
>  - the same as the input directory.
> 
> Make jpackage correctly handle temp directory (`--temp`) that is:
>  - a subdirectory of the input directory.
> 
> jpackage will produce an app image or a package in the above directory configurations without running in an infinite loop.
> 
> The new test/jdk/tools/jpackage/share/InOutPathTest.java test covers all the above scenarios.
> 
> `IOUtils.copyRecursive()` fixed to never run in a recursive loop by building the list of non-recursive file/dir copy commands and executing them outside the recursive directory tree traversal.
> 
> src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java, src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java, src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java, test/jdk/tools/jpackage/junit/jdk.jpackage/jdk/jpackage/internal/DeployParamsTest.java files fixed to get rid of `DeployParams.input` and `DeployParams.output` fields and replace them with the new `StandardBundlerParam.OUTPUT_DIR` param.
> 
> The above changes altered the logic of configuring the output directory, thus added a new `BasicTest.testNoOutputDir()` test to test jpackage without `--dest` parameter. This required adding new API to test helper classes.

Alexey Semenyuk has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 24 additional commits since the last revision:

 - Merge branch 'master' into JDK-8325089
 - Bugfix
 - All new InOutPathTest test cases pass
 - Make app image asserts configurable in JPackageCommand
 - Merge branch 'master' into JDK-8325089
 - Add tests for `--app-content` and `--dmg-app-content` CLI parameters
 - Files.isSameFile() throws exception if a file doesn't exist
 - Replace Path.equals() call with Files.isSameFile()
 - Use jdk.jpackage.test.Annotations.Parameter annotation to parameterize packaging type in the test
 - Bugfix
 - ... and 14 more: https://git.openjdk.org/jdk/compare/e7072b1b...abf8a897

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/21550/files
  - new: https://git.openjdk.org/jdk/pull/21550/files/1902637a..abf8a897

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=21550&range=08
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21550&range=07-08

  Stats: 13398 lines in 433 files changed: 11444 ins; 877 del; 1077 mod
  Patch: https://git.openjdk.org/jdk/pull/21550.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21550/head:pull/21550

PR: https://git.openjdk.org/jdk/pull/21550


More information about the core-libs-dev mailing list