AFAIK there’s nothing fundamentally wrong with enabling the hardened runtime on ad-hoc signed code.
I asked about this internally and uncovered a useful titbit. If you enable the hardened runtime in ad-hoc signed code, simple things work but you’ll run into problems if you depend on libraries. The hardened runtime enables library validation by default, and library validation requires that any library code loaded in your process either:
If you’re ad-hoc signed then you have no Team ID and thus, if you have library validation enabled, you can only load platform libraries.
If I use ad-hoc and hardened runtime, the Python binary in Python.framework won't load
Yep. That’s exactly the case I outlined above.
You might be able to get around this by disabling library validation via the com.apple.security.cs.disable-library-validation entitlement.
Having said that, I’m gonna stand by my original advice here. If you ad-hoc sign code you will run into numerous weird problems like this.
we can't tell them that they to have a signing identity.
Well you can, but you’re choosing not to. Like all engineering, this is a trade-off. You can either educate your clients that they’ll need a Apple signing identity or you can educate your clients about library validation. I’d rather you do the former, because it solves this problem and numerous other problems. But you’re free to do the latter if you like.
Note that, if this binary gets distributed widely then someone will eventually have to sign it with an Apple signing identity, because both of our standard distribution paths (Mac App Store and direct distribution) require that.
Also, Apple Development signing does not require that you be part of a paid team. It just requires that you have an Apple Account. Xcode can use any Apple Account to sign code under its Personal Team feature. That has significant limitations — see Developer > Support > Choosing a Membership — but most of them are only critical on iOS and its child platforms.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] The exact definition of what that means is complex, but you can think of it as meaning built in to the OS.