Sign maintenancetool.app on macOS #3391
Open
+116
−53
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On macOS Sonoma, attempting to update or uninstall GPT4All via the maintenance tool causes a crash.
This PR fixes the crash by signing MaintenanceTool.app. To do this, we must build it in a separate step and then sign it; otherwise I believe the bundle is generated on-the-fly during the installation process on the user's machine when it is too late to sign it. This is covered in Promoting Updates for the Maintenance Tool.
CPackIFW does not natively support
binarycreator --create-maintenancetool
, and although you can tell CPackIFW to run custom scripts during the build process, there is no script insertion point between generating the configuration that must be passed to binarycreator and running binarycreator to generate the final .dmg.I worked around this by running cmake and ninja once with
-DGPT4ALL_GEN_CPACK_CONFIG=ON
just to generate the CPackconfig
folder (including config.xml and the app icon), and then with the option disabled to actually build and package GPT4All, including generating the maintenancetool during the package step.When the user builds GPT4All themselves, it will still work as before since it is simpler to use the built-in maintenancetool.
Fixes #2982