-
-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems running recompiled extension on M1/Monterey combo #328
Comments
I got feedback on the issue, and it turns out that as far as Apple is concerned, this is a "works as designed": https://developer.apple.com/documentation/security/updating_mac_software. |
So deleting the .so before copying in the new one fixes it? If that's the case, send us a PR and I'll merge and release later today. I read the linked developer.apple.com article but I can't say I understand. We're not signing anything, so I'm a little confused about it. |
That's correct, as far as I see it there are two workarounds:
I was also confused by the whole thing. It's a new thing which is being enforced on M1 macs (and possibly also new in Monterey). The compiler automatically signs the shared library. |
This is a workaround for an issue on new M1 Macs, as outlined in [1]. The basic rundown is: Apple has recently added mandatory signing of binaries and libraries, with associated automatic signing of locally-compiled artifacts. The signature verification uses a static in-kernel inode-based signature cache. Once cached, the signature associated with an inode is not updated. This means that by "copying over" the shared library, the kernel compares the outdated signature (from its static cache) to the new shared library contents. This workaround removes the existing .so, ensuring that a new inode is used for the newly-compiled extension .so. Fixes #328 [1]: https://developer.apple.com/documentation/security/updating_mac_software
I seem to be running into an issue in the M1/Monterey combo which appears to be a bug in macOS.
The short version is: When I change the contents of my extension and recompile,
dylib
refuses to load it and fails withCode Signature Invalid
. This appears to have something to do with the file being "copied over" from/target...
to the.pgx
directory. I have opened an issue on the apple developer forums which goes into a fair amount of detail: https://developer.apple.com/forums/thread/696460With the following (awfully hacky) patch (which just removes the
.so
before copying it in), I am able to work around the issue that I'm seeing:@Hoverbear I'm curious to find out if you run into the same issue when you upgrade to Monterey.
The text was updated successfully, but these errors were encountered: