"Unable to install Python NSLog handler" error without the com.apple.security.cs.disable-library-validation entitlement #1868
Replies: 2 comments
-
Exactly the right approach. If it's clearly a bug, log a ticket; if you've got a clearly defined use case for a new feature, open a ticket; if in doubt; open a discussion.
The error indicates that the ctypes library (which is part of the CPython standard library) either hasn't been signed, has been signed with an ad-hoc certificate, or has been signed with a certificate that is inconsistent with the certificate used to sign the application binary. If you're doing a straightforward An interesting "proof of concept" would be to disable the flag, then running
The reason for this is that the mechanism that Briefcase uses to make stdout/stderr appear in the system log involves using This package isn't mandatory for a Briefcase-packaged app, but it is very useful, especially if you have any debug information going to the console. If you want to silence the warning about missing logging, you can install any library that provides an
It seems like the issue is that adhoc signing requires the extra option; but it's an unnecessary option once full signing is in place (unless, of course, you're doing something else that is "unsafe" from Apple's perspective). This means:
We've deliberately defaulted to adhoc signing for the build/run process because it's much easier for first-time users, so we'd want to preserve that as a default for build/run; but otherwise the mechanics for selecting a signing identity are in place already. One additional feature that might improve the UX around this would be to be able to save the default signing identity - so
Like I've said elsewhere, Mac App Store publication is something we'd like to support, but we don't currently test in any capacity. Resolving this sort of issue would seem to be highly desirable (if not absolutely required) for fully supporting the App Store. |
Beta Was this translation helpful? Give feedback.
-
ended up doing this at some point and yeah the app ran just fine. |
Beta Was this translation helpful? Give feedback.
-
i'm working on a
macos Xcode
app and i just ran into an unexpected (to me) situation w/r/tctypes
and thecom.apple.security.cs.disable-library-validation
entitlement. i don't think it's a bug per se and i also didn't want to clutter up #1861 even more with this question / comment so i figured a "Discussion" made more sense (let me know if i'm mistaken).so i have successfully built and manually re-signed my app without
com.apple.security.cs.disable-library-validation
for a few days now. everything had been looking good (and still does)... but then i tried to get the app going withbriefcase run
and it immediately crashed out with the messageUnable to install Python NSLog handler
.some quick testing revealed that in the usual environment - i don't usually run my app with
briefcase run
- the app still worked fine. a little more digging lead me to the actual stack trace:So my conclusion is that the only reason my app still works is because i manually copy the
.app
produced bybriefcase build
somewhere else and redo all the code signing manually, which includes re-signing_ctypes.cpython-312-darwin.so
with my own certificate... which is fine, but i had a few comments that are almost but not quite questions.NSLog
. Some comments over on Allow configuration of custom build params for macos Xcode builds in pyproject.toml #1861 made me think that it was really Toga and the GUI system that were the parts of the briefcase suite that needed these entitlements and in fact the reason i even was experimenting with removing them was because my app has no GUI element.com.apple.security.cs.disable-library-validation
as the default build couldn'tbriefcase build
just do what i did and re-sign it so thatbriefcase run
can work? Maybebriefcase package
already does this later in the release process and i just don't know about it.really the only reason i bring it up is because my gut says that Apple will be highly skeptical of approving an app for the app store with the
com.apple.security.cs.disable-library-validation
entitlement and if it's reasonably straightforward forbriefcase build
to build apps (even just CLI apps) without it might be worth doing? just my $0.02.Beta Was this translation helpful? Give feedback.
All reactions