On Sat, 1 May 2021 04:04:17 GMT, Alexander Matveev <almat...@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 [v2] Changes requested by asemenyuk (Reviewer). test/jdk/tools/jpackage/macosx/HostArchPkgTest.java line 55: > 53: > 54: private static void verifyHostArch(JPackageCommand cmd) throws > Exception { > 55: Path distributionFile = cmd.unpackedPackageDirectory() I think `cmd.pathToUnpackedPackageFile("/")` would be the equivalent to `cmd.unpackedPackageDirectory()`. If it is, there would be no need for changes to JPackageCommand. test/jdk/tools/jpackage/macosx/HostArchPkgTest.java line 57: > 55: Path distributionFile = cmd.unpackedPackageDirectory() > 56: .toAbsolutePath() > 57: .getParent() Why .getParent() is needed here? ------------- PR: https://git.openjdk.java.net/jdk/pull/3807