Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8313740

[macos] jpackage - allow specifying hostArchitectures (bundle x86_64 app on arm)

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      macOS
      JDK 17

      A DESCRIPTION OF THE PROBLEM :
      It would be nice to be able to create an x86_64 "app-image" from an arm64 host, especially since jlink can specify --module-path of a different jdk of a different architecture. This request is for macOS, but it may be relevant for Windows or Linux too.

      It looks like this ticket added support for arm: https://bugs.openjdk.org/browse/JDK-8266179

      However, looking at MacPkgBundler.class and searching for "hostArchitectures":
      https://github.com/openjdk/jdk/blob/master/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java

      It can be seen MacPkgBuilder is using `Architecture.isAARCH64()`, or in the case of JDK17, `System.getProperty("os.arch")`.

      It would be nice if jpackage on macOS could be passed `--hostArchitecture <arch>` (aarch64 or x86_64) to be able to build the app-image for x86_64 from an arm host (or vice-versa).


            almatvee Alexander Matveev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: