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

[macos]Signing app bundle with jpackage fails if runtime is already signed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 14
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86
    • OS:
      os_x

      Description

      A DESCRIPTION OF THE PROBLEM :
      Reopening JDK-8240636, as codesign fails on final app signing still. Apparent regression.

      REGRESSION : Last worked in version 14.0.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      $JAVA_HOME/bin/jpackage -i build/ -n Autoplot-dev --main-class org.autoplot.AutoplotUI --main-jar autoplot.jar -t app-image --mac-package-identifier org.autoplot --icon Autoplot2017.icns --mac-sign --verbose --mac-signing-key-user-name "Daniel Crawford (KKUXJV9FP5)" --mac-package-name "Autoplot"

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      jpackage exiting with no codes, and a signed app.
      ACTUAL -
      Creating app package: Autoplot-dev.app in /Users/dgcrawfo/Desktop/workspace-autoplot_app
      jlink arguments: [--output, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/runtime/Contents/Home, --module-path, /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home/jmods, --add-modules, java.rmi,jdk.management.jfr,jdk.jdi,jdk.charsets,jdk.xml.dom,java.xml,java.datatransfer,jdk.jstatd,jdk.httpserver,java.desktop,java.security.sasl,jdk.zipfs,java.base,jdk.crypto.ec,jdk.javadoc,jdk.management.agent,jdk.jshell,jdk.editpad,jdk.sctp,jdk.jsobject,java.sql.rowset,jdk.jlink,java.smartcardio,jdk.unsupported,jdk.scripting.nashorn,java.security.jgss,java.compiler,jdk.nio.mapmode,jdk.dynalink,jdk.unsupported.desktop,jdk.accessibility,jdk.security.jgss,java.sql,java.xml.crypto,java.transaction.xa,java.logging,jdk.jfr,jdk.crypto.cryptoki,jdk.net,java.naming,jdk.internal.ed,java.prefs,java.net.http,jdk.compiler,jdk.naming.rmi,jdk.internal.opt,jdk.jconsole,jdk.attach,jdk.internal.le,java.management,jdk.jdwp.agent,jdk.incubator.foreign,jdk.internal.jvmstat,java.instrument,jdk.management,jdk.security.auth,java.scripting,jdk.jdeps,jdk.incubator.jpackage,jdk.jartool,java.management.rmi,jdk.naming.dns,jdk.localedata, --strip-native-commands, --strip-debug, --no-man-pages, --no-header-files]
      jlink output: WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.jpackage

      Using custom package resource [icon] (loaded from file /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot2017.icns).
      Preparing Info.plist: /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/Info.plist.
      Using default package resource Info-lite.plist.template [Application Info.plist] (add Info.plist to the resource-dir to customize).
      Using default package resource Runtime-Info.plist.template [Java Runtime Info.plist] (add Runtime-Info.plist to the resource-dir to customize).
      Running [codesign, --verify, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/MacOS/libapplauncher.dylib]
      Running [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), --prefix, org.autoplot., -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/app/Autoplot-dev.cfg]
      /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/app/Autoplot-dev.cfg: signed generic [org.autoplot.Autoplot-dev]
      Running [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), --prefix, org.autoplot., -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/app/autoplot.jar]
      /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/app/autoplot.jar: signed generic [org.autoplot.autoplot]
      Running [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), --prefix, org.autoplot., -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/Resources/Autoplot-dev.icns]
      /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/Resources/Autoplot-dev.icns: signed generic [org.autoplot.Autoplot-dev]
      Running [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), --prefix, org.autoplot., -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/Info.plist]
      /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/Info.plist: signed generic [org.autoplot.Info]
      Running [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), --prefix, org.autoplot., -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/PkgInfo]
      /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/PkgInfo: signed generic [org.autoplot.PkgInfo]
      Running [codesign, -f, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), --prefix, org.autoplot., -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/runtime]
      /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/runtime: replacing existing signature
      /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/runtime: signed bundle with Mach-O thin (x86_64) [com.oracle.java.org.autoplot]
      Running [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), --prefix, org.autoplot., -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/runtime/Contents/_CodeSignature/CodeResources]
      /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app/Contents/runtime/Contents/_CodeSignature/CodeResources: signed generic [org.autoplot.CodeResources]
      Running [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app]
      /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app: is already signed
      java.io.IOException: Command [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app] exited with 1 code
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Executor.executeExpectSuccess(Executor.java:73)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.IOUtils.exec(IOUtils.java:179)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.IOUtils.exec(IOUtils.java:150)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppImageBuilder.signAppBundle(MacAppImageBuilder.java:895)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppImageBuilder.sign(MacAppImageBuilder.java:363)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppImageBuilder.prepareApplicationFiles(MacAppImageBuilder.java:314)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.JLinkBundlerHelper.execute(JLinkBundlerHelper.java:186)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppBundler.doAppBundle(MacAppBundler.java:249)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppBundler.doBundle(MacAppBundler.java:237)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppBundler.execute(MacAppBundler.java:285)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.generateBundle(Arguments.java:641)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.processArguments(Arguments.java:514)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.execute(Main.java:97)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.main(Main.java:51)
      jdk.incubator.jpackage.internal.PackagerException: java.io.IOException: Command [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app] exited with 1 code
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppBundler.doAppBundle(MacAppBundler.java:259)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppBundler.doBundle(MacAppBundler.java:237)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppBundler.execute(MacAppBundler.java:285)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.generateBundle(Arguments.java:641)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.processArguments(Arguments.java:514)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.execute(Main.java:97)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.main(Main.java:51)
      Caused by: java.io.IOException: Command [codesign, -s, Developer ID Application: Daniel Crawford (KKUXJV9FP5), -vvvv, /Users/dgcrawfo/Desktop/workspace-autoplot_app/Autoplot-dev.app] exited with 1 code
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Executor.executeExpectSuccess(Executor.java:73)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.IOUtils.exec(IOUtils.java:179)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.IOUtils.exec(IOUtils.java:150)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppImageBuilder.signAppBundle(MacAppImageBuilder.java:895)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppImageBuilder.sign(MacAppImageBuilder.java:363)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppImageBuilder.prepareApplicationFiles(MacAppImageBuilder.java:314)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.JLinkBundlerHelper.execute(JLinkBundlerHelper.java:186)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.MacAppBundler.doAppBundle(MacAppBundler.java:249)
      ... 6 more
      abraxas:~ dgcrawfo$ java -version
      openjdk version "14.0.1" 2020-04-14
      OpenJDK Runtime Environment (build 14.0.1+7)
      OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)

      CUSTOMER SUBMITTED WORKAROUND :
      Adding explicit "-f" to final codesign works.

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tongwan Andrew Wang
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: