Howdy, I maintain the EditorConfig plugin for TextMate (https://github.com/Mr0grog/editorconfig-textmate https://github.com/Mr0grog/editorconfig-textmate). I haven’t had much time to work on it recently, but I was trying to update it for the latest TextMate this morning. However, MacOS won’t actually load my bundle inside TextMate. I see this message when TextMate starts:
Failed to load ‘editorconfig-textmate’ (~/Library/Application Support/TextMate/PlugIns/editorconfig-textmate.tmplugin): The bundle “editorconfig-textmate” couldn’t be loaded because it is damaged or missing necessary resources.
I’m fairly certain the cause is that TextMate now uses the hardened runtime (https://github.com/textmate/textmate/commit/412e6798ca206b15cdc8f86a1387835a... https://github.com/textmate/textmate/commit/412e6798ca206b15cdc8f86a1387835a3f4f82e7).
I saw Allan’s message about a similar issue with the Emmet plugin on July 13th: https://lists.macromates.com/textmate/2019-July/041039.html https://lists.macromates.com/textmate/2019-July/041039.html …but enabling the hardened runtime when signing the bundle doesn’t solve the issue for me.
I think the actual problem in this case is that TextMate (not my plug-in) is missing the `com.apple.security.cs.disable-library-validation` entitlement for hardening. Apple’s docs (https://developer.apple.com/documentation/bundleresources/entitlements/com_a... https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation) say:
Typically, the Hardened Runtime’s library validation prevents an app from loading frameworks, plug-ins, or libraries unless they’re either signed by Apple or signed with the same team ID as the app. The macOS dynamic linker (dyld) provides a detailed error message when this happens. Use the Disable Library Validation Entitlement to circumvent this restriction.
Obviously I can’t and shouldn’t sign the plug-in with TextMate’s team ID! So it sounds like this is probably required for third-party plug-ins. Are there other third-party plug-ins that are functioning with the latest version of TextMate? Something else I might be missing here?
Thanks,
Rob Brackett rob@robbrackett.com mailto:rob@robbrackett.com @Mr0grog
Hi again, I’m just following up on this, since I haven’t heard back in a little over a week. Are other third-party plugins (as opposed to command bundles) able to run? If not, can TextMate add the `com.apple.security.cs.disable-library-validation` entitlement, since I think that’s the problem here?
Thanks,
Rob
On Sep 24, 2019, at 12:29 PM, Rob Brackett rob@robbrackett.com wrote:
Howdy, I maintain the EditorConfig plugin for TextMate (https://github.com/Mr0grog/editorconfig-textmate https://github.com/Mr0grog/editorconfig-textmate). I haven’t had much time to work on it recently, but I was trying to update it for the latest TextMate this morning. However, MacOS won’t actually load my bundle inside TextMate. I see this message when TextMate starts:
Failed to load ‘editorconfig-textmate’ (~/Library/Application Support/TextMate/PlugIns/editorconfig-textmate.tmplugin): The bundle “editorconfig-textmate” couldn’t be loaded because it is damaged or missing necessary resources.
I’m fairly certain the cause is that TextMate now uses the hardened runtime (https://github.com/textmate/textmate/commit/412e6798ca206b15cdc8f86a1387835a... https://github.com/textmate/textmate/commit/412e6798ca206b15cdc8f86a1387835a3f4f82e7).
I saw Allan’s message about a similar issue with the Emmet plugin on July 13th: https://lists.macromates.com/textmate/2019-July/041039.html https://lists.macromates.com/textmate/2019-July/041039.html …but enabling the hardened runtime when signing the bundle doesn’t solve the issue for me.
I think the actual problem in this case is that TextMate (not my plug-in) is missing the `com.apple.security.cs.disable-library-validation` entitlement for hardening. Apple’s docs (https://developer.apple.com/documentation/bundleresources/entitlements/com_a... https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation) say:
Typically, the Hardened Runtime’s library validation prevents an app from loading frameworks, plug-ins, or libraries unless they’re either signed by Apple or signed with the same team ID as the app. The macOS dynamic linker (dyld) provides a detailed error message when this happens. Use the Disable Library Validation Entitlement to circumvent this restriction.
Obviously I can’t and shouldn’t sign the plug-in with TextMate’s team ID! So it sounds like this is probably required for third-party plug-ins. Are there other third-party plug-ins that are functioning with the latest version of TextMate? Something else I might be missing here?
Thanks,
Rob Brackett rob@robbrackett.com mailto:rob@robbrackett.com @Mr0grog
On 24 Sep 2019, at 21:29, Rob Brackett wrote:
I think the actual problem in this case is that TextMate (not my plug-in) is missing the `com.apple.security.cs.disable-library-validation` entitlement for hardening. Apple’s docs (https://developer.apple.com/documentation/bundleresources/entitlements/com_a... https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation) say:
I have added `com.apple.security.cs.disable-library-validation` to entitlements for v2.0.1 currently available by holding option when opening the TextMate menu and selecting “Check for Test Build” or option-clicking Check Now in Preferences → Software Update.
Please let me know if this solves the problem.
I tried this out with Emmet. It loads for the first time since rc10 (or so), but using it causes TextMate to crash.
https://api.textmate.org/crashes/422005
Hope that's helpful.
Thanks, Graham
On 7 Oct 2019, at 5:48, Allan Odgaard wrote:
On 24 Sep 2019, at 21:29, Rob Brackett wrote:
I think the actual problem in this case is that TextMate (not my plug-in) is missing the `com.apple.security.cs.disable-library-validation` entitlement for hardening. Apple’s docs (https://developer.apple.com/documentation/bundleresources/entitlements/com_a... https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation) say:
I have added `com.apple.security.cs.disable-library-validation` to entitlements for v2.0.1 currently available by holding option when opening the TextMate menu and selecting “Check for Test Build” or option-clicking Check Now in Preferences → Software Update.
Please let me know if this solves the problem.
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
On 7 Oct 2019, at 17:50, Graham Heath wrote:
I tried this out with Emmet. It loads for the first time since rc10 (or so), but using it causes TextMate to crash.
That crash is in the Emmet plug-in, not a fault of TextMate.
But I take it to mean that third party plug-ins are being loaded :)
Yup, thats how I interpret this too.
FWIW: I haven't been missing this plugin because Emmet's expand feature is available in TextMate without the plugin via Zdenko's bundle: https://github.com/zdenko/emmet2.tmbundle ❤️ . I just figured I could give it a try.
Thanks, Graham
On 7 Oct 2019, at 10:59, Allan Odgaard wrote:
On 7 Oct 2019, at 17:50, Graham Heath wrote:
I tried this out with Emmet. It loads for the first time since rc10 (or so), but using it causes TextMate to crash.
That crash is in the Emmet plug-in, not a fault of TextMate.
But I take it to mean that third party plug-ins are being loaded :)
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
This is working great for me as well — the EditorConfig plugin now loads and runs.
Thanks so much for taking care of this!
-Rob
P.S. Allan, I think a while back, you or some other major contributor mentioned it might be better to try and integrate EditorConfig support directly into TextMate, since plugins like this can be a bit fiddly and it’s hard for third party compiled code to get at the non-dynamic C++ bits like the actual settings struct attached to an OakDocument. I was thinking the right place to start for that would be to add support for the two EditorConfig settings that don’t have an equivalent in TextMate (trim_trailing_whitespace and insert_final_newline) to the settings struct and to OakDocument. Does that seem like a good idea? Should I just submit a pull request to https://github.com/textmate/textmate https://github.com/textmate/textmate?
On Oct 7, 2019, at 9:15 AM, Graham Heath graham.p.heath@gmail.com wrote:
Yup, thats how I interpret this too.
FWIW: I haven't been missing this plugin because Emmet's expand feature is available in TextMate without the plugin via Zdenko's bundle: https://github.com/zdenko/emmet2.tmbundle https://github.com/zdenko/emmet2.tmbundle ❤️ . I just figured I could give it a try.
Thanks, Graham
On 7 Oct 2019, at 10:59, Allan Odgaard wrote:
On 7 Oct 2019, at 17:50, Graham Heath wrote:
I tried this out with Emmet. It loads for the first time since rc10 (or so), but using it causes TextMate to crash.
https://api.textmate.org/crashes/422005 https://api.textmate.org/crashes/422005 That crash is in the Emmet plug-in, not a fault of TextMate.
But I take it to mean that third party plug-ins are being loaded :)
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate https://lists.macromates.com/listinfo/textmate _______________________________________________ TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
On 8 Oct 2019, at 20:55, Rob Brackett wrote:
P.S. Allan, I think a while back, you or some other major contributor mentioned it might be better to try and integrate EditorConfig support directly into TextMate, since plugins like this can be a bit fiddly and it’s hard for third party compiled code to get at the non-dynamic C++ bits like the actual settings struct attached to an OakDocument. I was thinking the right place to start for that would be to add support for the two EditorConfig settings that don’t have an equivalent in TextMate (trim_trailing_whitespace and insert_final_newline) to the settings struct and to OakDocument. Does that seem like a good idea? Should I just submit a pull request to https://github.com/textmate/textmate https://github.com/textmate/textmate?
I am definitely open for native EditorConfig support, but with 2.0 now “final”, I’m expecting some refactoring with one of the goals being to have more of the C++ interfaces moved to Objective-C classes and “inline” the load/save process (it’s currently way to complicated), so if the plug-in currently works, I’d not recommend investing too much time on a PR based on the current code base, as at least I don’t see an obvious place where these features should be added to the current code, but I’ll keep them in mind when I get around to refactoring.