RFR: 8356116: [macos] Add logging of sign commands in jpackage

Alexey Semenyuk asemenyuk at openjdk.org
Wed Dec 3 15:23:11 UTC 2025


On Wed, 3 Dec 2025 03:20:45 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:

> - Added logging of sign commands.
> - Sign commands will be logged with `DEBUG` level. Skipped files and signature removal with `TRACE` to reduce amount of less important messages.
> - Renamed `unsign` to `removeSignature`. I think it is better name.
> - Removed `sign` and `codesigners.accept(path)` will be used instead. Not sure why we need function with one line and we using `codesigners.accept(path)` in other places anyway.
> - Direct call to `codesigners.codesignDir().accept(path)` was changed to `codesigners.accept(path)`. In this case exception will be logged if `codesignDir` is not available and I think it is better for `codesigners.accept(path)` to select code signer vs calling it directly.

src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigner.java line 63:

> 61:                 new AppImageSigner(Codesigners.create(signingCfg)).sign(app, appImage);
> 62:             } catch (CodesignException ex) {
> 63:                 LOGGER.log(Level.ERROR, ex);

This log statement is redundant. There is no point in logging exceptions being passed through.

This catch block catches an exception, passes it to `handleCodesignException()` method, and then rethrows it. What additional information do we need about this "event"?

src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigner.java line 66:

> 64:                 throw handleCodesignException(app, ex);
> 65:             } catch (ExceptionBox ex) {
> 66:                 LOGGER.log(Level.ERROR, ex);

This log statement is redundant. Same as above.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28623#discussion_r2585541827
PR Review Comment: https://git.openjdk.org/jdk/pull/28623#discussion_r2585543304


More information about the core-libs-dev mailing list