How to create macOS bundles for apple silicon? They always seem broken

Hi,

I’ve been trying to create a bundle of my application for macOS. I’ve tried both the cargo-bundler and cargo-packager crates, and in general, the bundles are built, but it seems to work on Intel Macs only.

I can build the x86_64-apple-darwin version just fine, and it works on my Intel mac (I don’t have an Apple Silicon device at hand).

I can also build a “raw”, un-bundled binary for aarch64-apple-darwin that can be executed in a terminal on an Apple Silicon mac.

BUT, as soon as I build a bundle for aarch64-apple-silicon, they don’t work. The message says that the bundle is broken and should be deleted, it’s NOT the “Unknown developer, don’t open” message. It seems like even the executable inside the bundle doesn’t work.

Is there some trick to build bundles for Apple Silicon? Is it just not possible to build a bundle for Apple Silicon on Intel Macs ? Could it be some version mismatch?

Best,

N

Does it work if resign the entire app bundle with an ad-hoc signature? codesign --force --deep -s - /path/to/program.app should work according to Making sure you're not a bot! Arm64 macOS refuses to run any executable without a code signature. For individual executables, the linker will generate an ad-hoc signature, but it is possible that cargo-bundle and cargo-packager are missing signing the app bundle.

Yes that was the problem indeed … I codesigned using a self-signed certificate and now it shows the usual behaviour where you have to go to settings and allow “Open Anyway” …

I found the this hint, which also contains the commands to notarize the app if you have an official certificate:

Thanks for the answer :slight_smile: