luapower / objc

Objective-C & Cocoa Bridge
http://luapower.com/objc
25 stars 7 forks source link

make objc work on OSX 10.13 #5

Open capr opened 6 years ago

capr commented 6 years ago

LuaCocoa page says:

macOS 10.13 (High Sierra) introduced new bugs which broke their BridgeSupport format. They broke the format for compound structs (such as NSRect), nil terminated variadic methods & functions (e.g. NSArray arrayWithObjects), and removed the data in BridgeSupport which lists all the dependent libraries/frameworks for a given framework (which brnow will require you to explicitly LuaCocoa.import() all the frameworks you indirectly need).

I filed 3 bugs with Apple. If you depend on BridgeSupport for any of your projects, please file duplicates with Apple Radar and list these bug numbers in your bug reports. (Apple does count the number of bug reports and has influence over prioritization.)

5844688 10.13 broke BridgeSupport for compound struct definitions

35844763 10.13 broke BridgeSupport and compatibility with existing apps for variadic nil terminated methods/functions

35844832 10.13 broke BridgeSupport format for listing dependency framework information

capr commented 6 years ago

PS: Don't bother googling for those bug id numbers... this hipster BS company keeps all bug reports private.

stuta commented 6 years ago

Are there any Lua tools that use Swift instead of Objective-C?

stuta commented 6 years ago

Any news on this?

capr commented 5 years ago

More info here: https://latenightsw.com/high-sierra-applescriptobjc-bugs/

d4tocchini commented 5 years ago

of the demos i tried, all err'd mostly smelling of this objc issue (using bundle downloaded from site). is there a known workaround? if this is known state of things, considering macos is moving several versions beyond 10.12 I think an appropriate WIP flag should accompany any indication of mac support on the website or repos.

Hats off on this project, was a huge blow realizing no bueno mac 10.13+. any ideas on how to squash this issue? someway to proxy the objc bridgesupport with manual ffi-native methods?

capr commented 5 years ago

@d4tocchini In this case I think it's OSX 10.13 that should have a WIP flag :) Seriously though, unless someone has the time to implement the needed workarounds in the bridgesupport parser (which btw shou;dn't be that hard except people generally just don't want to mess in other people's code so they'd rather just wait for me to do it), just make ffi-friendly C-API wrappers in ObjC for the functions you need. A third solution would be to create a special mode in the objc binding that ignores bridgesupport files completely, it will still work albeit some type information will be missing. Note that ObjC already has a RTTI API, bridgesupport files are just a horrible kludge that augments that with more info (informal protocols, etc) that you can probably live without.

d4tocchini commented 5 years ago

haha, yeah ffi c wrappers FTW

capr commented 3 years ago

I modified objc to look for luapower/*.bridgesupport files first. I published all /System/Library/.../*.bridgesupport files from an OSX 10.12.6 to https://github.com/luapower/bridgesupport so all you gotta do is mgit clone bridgesupport to make it work. on OSX 10.13+. That is, as much as those APIs are backwards compatible (I have no idea) you'll be fine.

capr commented 3 years ago

For practical pusposes this issue is fixed but I'll keep it open since fixing the parser to work with broken bridgesupport files is still a better fix (no bridgesupport files to deploy or bundle).

stuta commented 3 years ago

I can confirm that in Mojave 10.14.6 most tests seems to work. I'll test BigSur later. Thanks!