Context: large platform-agnostic CLI tool built as a handcrafted bundle (not via an Xcode project) that has been successfully codesigned, stapled, and zipped; macOS 14.7.5 syspolicy_check
reports
App passed all pre-distribution checks and is ready for distribution.
However, running the executable in the Terminal produces a "cannot be opened because the developer cannot be verified" popup. The executable does succeed after manually clearing its quarantine attribute.
Having worked through Resolving Gatekeeper Problems, the only detail logged in the Console is
Adding Gatekeeper denial breadcrumb (direct):
... bundle_id: NOT_A_BUNDLE
.
Experimental observations: a minimized trivial CLI executable with a similar bundle layout and name successfully executes without being rejected, and oddly, renaming the original bundle from "name" to "name.suffix" allows it to be successfully executed.
It's unclear why the bundle name would affect Gatekeeper only in some circumstances, and we'd greatly prefer not to rename the bundle for compatibility reasons, so it would be good if there were some way to get further diagnostic detail leading to a workaround - thank you.
It would be very useful for Apple to add a test VM creation CLI to the developer toolkit
I tend to agree but, given that current reality, I encourage you to explore the raft of third-party options out there [1].
As to your original issue, adding an extension is the right option here.
macOS draws a clear distinction between bundled and non-bundle code. This really matters when comes to code signing. See the discussion is Creating distribution-signed code for macOS.
That Java runtime is signed as a bundle:
% codesign -d -vvv jdk-21.0.7+6-jre
Executable=/Users/quinn/Desktop/jdk-21.0.7+6-jre/Contents/MacOS/libjli.dylib
Identifier=net.java.openjdk.jre
Format=bundle with Mach-O thin (arm64)
^^^^^^
However, the exact definition of what constitutes a bundle is more squishy then it should be. It seems that codesign
and Gatekeeper disagree as to whether the file name extension is required, which is why the OpenJDK folks are able to sign that item as a bundle but that trips up Gatekeeper.
Now there are other problems here — Java runtimes are notorious for not following the rules in Placing Content in a Bundle — but they don’t seem to be causing you grief so I fine for us to just move on.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Given your background, I suspect you’d like Tart.