RFR: 8342576: [macos] AppContentTest still fails after JDK-8341443 for same reason on older macOS versions
Alexey Semenyuk
asemenyuk at openjdk.org
Tue Apr 29 19:18:03 UTC 2025
On Fri, 25 Oct 2024 01:49:01 GMT, Alexander Matveev <almatvee at openjdk.org> wrote:
> - It is not clear on which macOS versions codesign fails if application bundle contains additional content.
> - As a result test was modified to generate only application image, since PKG or DMG cannot be generated if signing fails. Exit code of jpackage is ignored, but generated application image will be checked for additional content.
> - This change is for macOS only.
> - Previous implementation of test (forcing expected exist code to 1) was not doing anything useful, since we never checked if additional content was copied or not.
The workaround at [workflows/deployment.yml](https://github.com/JabRef/jabref/blob/97aaab58e3ab543a0f50097ee59e52504d99c786/.github/workflows/deployment.yml#L167-L178) doesn't look right, I'm surprised "codesign" works in the script. Maybe it runs on older macos with a permissive codesign version?
If you want to build app image and create pkg and dmg packages from it in separate steps, you can leverage jpackage's `--app-image` option for this.
1. Build unsigned app image:
jpackage --type app-image ... --dest build/distribution
2. Copy additional content to the app image:
cp buildres/mac/jabrefHost.py build/distribution/JabRef.app/Contents/Resources
cp -R buildres/mac/native-messaging-host build/distribution/JabRef.app/Contents/Resources
3. Create a signed PKG package:
jpackage --type pkg --mac-sign --app-image build/distribution/JabRef.app ...
4. Create a signed DMG package:
jpackage --type dmg --mac-sign --app-image build/distribution/JabRef.app ...
No explicit codesign, hdiutil, and productbuild invocations.
You can have "the dmg background images and install instructions etc".
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21698#issuecomment-2839954808
More information about the core-libs-dev
mailing list