Integrated: 8377331: jpackage: improve sign errors reporting

Alexey Semenyuk asemenyuk at openjdk.org
Mon Feb 9 21:40:01 UTC 2026


On Thu, 5 Feb 2026 23:23:28 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

> Improve reporting of errors from failed external commands, and signing errors in particular. Use the same formatting for signing errors as for any other errors.
> 
> Instead of printing:
> 
> "codesign" failed with following output:
> jpackage-tests/MacSignTest/testAppContentWarning/output/AppContentWarningMacSignTest.app: replacing existing signature
> jpackage-tests/MacSignTest/testAppContentWarning/output/AppContentWarningMacSignTest.app: bundle format unrecognized, invalid, or unsuitable
> In subcomponent: jpackage-tests/MacSignTest/testAppContentWarning/output/AppContentWarningMacSignTest.app/Contents/foo.1
> jdk.jpackage.internal.util.function.ExceptionBox: jdk.jpackage.internal.Codesign$CodesignException
>         at jdk.jpackage/jdk.jpackage.internal.util.function.ExceptionBox.toUnchecked(ExceptionBox.java:51)
>         <stack trace omitted>
> Error: jdk.jpackage.internal.Codesign$CodesignException
> 
> 
> jpackage will print:
> 
> Error: Unexpected exit code 1 from executing the command /usr/bin/codesign -s 'Developer ID Application: jpackage.openjdk.java.net' -vvvv --timestamp --options runtime --prefix Hello. --keychain jpackagerTest.keychain --entitlements config/AppContentWarningMacSignTest.entitlements --force MacSignTest/testAppContentWarning/output/AppContentWarningMacSignTest.app
> Command output:
> MacSignTest/testAppContentWarning/output/AppContentWarningMacSignTest.app: replacing existing signature
> MacSignTest/testAppContentWarning/output/AppContentWarningMacSignTest.app: bundle format unrecognized, invalid, or unsuitable
> In subcomponent: MacSignTest/testAppContentWarning/output/AppContentWarningMacSignTest.app/Contents/foo.1
> 
> 
> As for reporting generic errors from failed external commands, jpackage will always print the command's output, regardless of whether it is running in verbose or quiet mode. Previously, it would print command output only in quiet mode, assuming that in verbose mode, the output would be printed immediately after command execution. However, jpackage runs some commands quietly in verbose mode; if one of them failed, the user didn't see its output. To address this problem, jpackage will print the output of the failed command in both quiet and verbose modes.

This pull request has now been integrated.

Changeset: 5152fdcd
Author:    Alexey Semenyuk <asemenyuk at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/5152fdcd490412025ba5f608378982abc1eadc07
Stats:     276 lines in 10 files changed: 203 ins; 33 del; 40 mod

8377331: jpackage: improve sign errors reporting

Reviewed-by: almatvee

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

PR: https://git.openjdk.org/jdk/pull/29596


More information about the core-libs-dev mailing list