RFR: 8266179: [macos] jpackage should specify architecture for produced pkg files [v3]

Alexey Semenyuk asemenyuk at openjdk.java.net
Mon May 3 20:24:51 UTC 2021


On Mon, 3 May 2021 19:26:19 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:

>> jpackage should specify architecture for produced PKG files via hostArchitectures="x86_x64 or arm64". aarch64 installer will be installable on x64 without specifying hostArchitectures which is not correct and if install on arm Mac it will request Rosetta 2. With proposed fix by setting hostArchitectures="x86_x64" if installer contains x64 binaries, it will be installable on x64 Mac and will require Rosetta 2 on arm Mac. hostArchitectures will be set to arm64 if installer contain aarch64 binaries and will gave error when run on x64 Mac and will be installable on arm Mac without triggering installation of Rosetta 2.
>
> Alexander Matveev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8266179: [macos] jpackage should specify architecture for produced pkg files [v3]

Changes requested by asemenyuk (Reviewer).

test/jdk/tools/jpackage/macosx/HostArchPkgTest.java line 93:

> 91:                 .forTypes(PackageType.MAC_PKG)
> 92:                 .addInstallVerifier(HostArchPkgTest::verifyHostArch)
> 93:                 .run();

The test is applicable only to the scenario when .pkg installer is unpacked and not when it is installed. So `PackageTest.run()` is not quite a good fit for this execution scenario as it depends on the value of `jpackage.test.action` system property (its default value is indeed to create and unpack installer, but can be overriden). The better option would be to use `PackageTest.run()` with explicit list of actions the test should perform. Suggested fix:

new PackageTest()
                .forTypes(PackageType.MAC_PKG)
                .configureHelloApp()
                .addInstallVerifier(HostArchPkgTest::verifyHostArch)
                .run(PackageTest.Action.CREATE_AND_UNPACK);

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

PR: https://git.openjdk.java.net/jdk/pull/3807


More information about the core-libs-dev mailing list