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

Alexey Semenyuk asemenyuk at openjdk.org
Fri Oct 25 17:18:11 UTC 2024


On Fri, 25 Oct 2024 15:06:45 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

>> 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 incrementally with one additional commit since the last revision:
> 
>   All new InOutPathTest test cases pass

Test updated. On Windows it will execute the following command lines:

jpackage.exe --input .\test.72d35365\input --dest .\test.72d35365\output --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello  --temp .\test.72d35365\input\tmp --app-content .\test.72d35365\input\tmp
jpackage.exe --input .\test.4a142b7a\input --dest .\test.4a142b7a\output --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello  --app-content .\test.4a142b7a\output\bar
jpackage.exe --input .\test.95a8ec80\input --dest .\test.95a8ec80\output --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello  --app-content .\test.95a8ec80\input\foo
jpackage.exe --input .\test.652154c7\input --dest .\test.652154c7\output --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello  --app-content .\test.652154c7\output
jpackage.exe --input .\test.dc40ecd3\input --dest .\test.dc40ecd3\output --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello  --app-content .\test.dc40ecd3\input
jpackage.exe --input .\test.b682c86a\input --dest .\test.b682c86a\output --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello  --app-content .\test.b682c86a\output\InOutPathTest
jpackage.exe --input .\test.1f844f72\input --dest .\test.1f844f72\input\out --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello  --temp .\test.1f844f72\input\tmp
jpackage.exe --input .\test.80984a5d\input --dest .\test.80984a5d\input\out --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello
jpackage.exe --input .\test.9a82b116\input --dest .\test.9a82b116\input --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello
jpackage.exe --input .\test.65e1cf6b\input --dest .\test.65e1cf6b\output --name InOutPathTest --type app-image --main-jar duke.jar --main-class Hello  --temp .\test.65e1cf6b\input\tmp
jpackage.exe --input .\test.3cbe2211\input --dest .\test.3cbe2211\output --name InOutPathTest --type exe --main-jar duke.jar --main-class Hello  --temp .\test.3cbe2211\input\tmp --app-content .\test.3cbe2211\input\tmp
jpackage.exe --input .\test.3cbe2211\input.0 --dest .\test.3cbe2211\output --name InOutPathTest --type msi --main-jar duke.jar --main-class Hello  --temp .\test.3cbe2211\input.0\tmp --app-content .\test.3cbe2211\input.0\tmp
jpackage.exe --input .\test.5be3e44e\input --dest .\test.5be3e44e\output --name InOutPathTest --type exe --main-jar duke.jar --main-class Hello  --app-content .\test.5be3e44e\output\bar
jpackage.exe --input .\test.5be3e44e\input.0 --dest .\test.5be3e44e\output --name InOutPathTest --type msi --main-jar duke.jar --main-class Hello  --app-content .\test.5be3e44e\output\bar
jpackage.exe --input .\test.bdd04e2c\input --dest .\test.bdd04e2c\output --name InOutPathTest --type exe --main-jar duke.jar --main-class Hello  --app-content .\test.bdd04e2c\input\foo
jpackage.exe --input .\test.bdd04e2c\input.0 --dest .\test.bdd04e2c\output --name InOutPathTest --type msi --main-jar duke.jar --main-class Hello  --app-content .\test.bdd04e2c\input.0\foo
jpackage.exe --input .\test.82280073\input --dest .\test.82280073\output --name InOutPathTest --type exe --main-jar duke.jar --main-class Hello  --app-content .\test.82280073\output
jpackage.exe --input .\test.82280073\input.0 --dest .\test.82280073\output --name InOutPathTest --type msi --main-jar duke.jar --main-class Hello  --app-content .\test.82280073\output
jpackage.exe --input .\test.600fb6a7\input --dest .\test.600fb6a7\output --name InOutPathTest --type exe --main-jar duke.jar --main-class Hello  --app-content .\test.600fb6a7\input
jpackage.exe --input .\test.600fb6a7\input.0 --dest .\test.600fb6a7\output --name InOutPathTest --type msi --main-jar duke.jar --main-class Hello  --app-content .\test.600fb6a7\input.0
jpackage.exe --input .\test.3c8afb1e\input --dest .\test.3c8afb1e\input\out --name InOutPathTest --type exe --main-jar duke.jar --main-class Hello  --temp .\test.3c8afb1e\input\tmp
jpackage.exe --input .\test.3c8afb1e\input.0 --dest .\test.3c8afb1e\input.0\out --name InOutPathTest --type msi --main-jar duke.jar --main-class Hello  --temp .\test.3c8afb1e\input.0\tmp
jpackage.exe --input .\test.33883231\input --dest .\test.33883231\input\out --name InOutPathTest --type exe --main-jar duke.jar --main-class Hello
jpackage.exe --input .\test.33883231\input.0 --dest .\test.33883231\input.0\out --name InOutPathTest --type msi --main-jar duke.jar --main-class Hello
jpackage.exe --input .\test.fe2e8dc2\input --dest .\test.fe2e8dc2\input --name InOutPathTest --type exe --main-jar duke.jar --main-class Hello
jpackage.exe --input .\test.fe2e8dc2\input.0 --dest .\test.fe2e8dc2\input.0 --name InOutPathTest --type msi --main-jar duke.jar --main-class Hello
jpackage.exe --input .\test.18d1b73f\input --dest .\test.18d1b73f\output --name InOutPathTest --type exe --main-jar duke.jar --main-class Hello  --temp .\test.18d1b73f\input\tmp
jpackage.exe --input .\test.18d1b73f\input.0 --dest .\test.18d1b73f\output --name InOutPathTest --type msi --main-jar duke.jar --main-class Hello  --temp .\test.18d1b73f\input.0\tmp

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

PR Comment: https://git.openjdk.org/jdk/pull/21550#issuecomment-2438380596


More information about the core-libs-dev mailing list