Issue 1:
I have been using Julia-1.0 at the Terminal and under Jupyter for some time under the previous MacOS. I recently upgraded to Catalina 10.15.2. I can still use Julia 1.0 under Terminal, but when I try to run the new Julia-1.3, I get the alert:

“Julia-1.3” can’t be opened because Apple cannot check it for malicious software.

Update: I am able to get around this by approving within "System Preferences / Security & Privacy".

Not sure, but I am guessing this is related to the new required app notarization under Catalina. Anyone want to fight with this? Maybe someone can update the instructions in the meantime.

Issue 2:
macOS 10.15+ is going to start requiring us to "notarize" our apps by sending them to Apple to be scanned. If we do not, we will get scary errors like the following:

"Julia-1.0" can't be opened because Apple cannot check it for malicious software.

This software needs to be updated. Contact the developer for more information.

To temporarily work around this, right click on the application and select "open."

Note that this is distinct from the "cannot be verified" error when an app is not signed; notarization protects against malware by forcing developers to upload their app bundles to Apple, where Apple can scan them with some algorithm, determine there is nothing harmful in there, then pass back a cryptographic notarization. This must be done for every single build of Julia, if we want the .app to be openable. (We could conceivably not do this for nightly builds, and expect users to bypass the scary dialog, if this turns out to be a flaky process)

The workflow we'll have to adopt is:

Build and package Julia, just like normal.

Sign julia, but opt in to the "hardened runtime". Note that this, by default, disables things like being able to jump into writable pages, so we'll have to figure out the right set of "entitlements" to request, in order to peel back the appropriate layers of protection to get our JIT to still work. This is done by passing --options runtime to codesign.

Submit the packaged .dmg to Apple Notary service. This should be doable by /usr/bin/xcrun altool --notarize-app --primary-bundle-id "$BUNDLE_ID" --username "$APPLE_ID_EMAIL" --password "$APPLE_ID_PASSWORD" --file "$JULIA_DMG" --output-format "xml"

Poll Apple until the notarization is complete. We do that with something like /usr/bin/xcrun altool --notarization-info --username "$APPLE_ID_EMAIL" --password "$APPLE_ID_PASSWORD" --output-format "xml", then parse the XML. Note that this notarization can take multiple hours to complete, it is not a fast process, so I think we're going to need to run this as an asynchronous job, perhaps in parallel to testing.

Staple notarization ticket to our app. xcrun stapler staple Julia.app. Note that this is performed on an .app, not a .dmg. We need to download the DMG, mount it as read/write (probably by using shadow mounts, like we do when needing to resign something), staple the ticket to the .app, then generate a new .dmg.

References:

https://stackoverflow.com/questions/56890749/macos-notarize-in-script

https://developer.apple.com/documentation/security/hardened_runtime_entitlements

https://gist.github.com/staticfloat/62369d705f265c0b35ff8888b2e1d76c