Re: [Pyobjc-dev] framework bindings for OSX 10.11
Brought to you by:
ronaldoussoren
From: Ronald O. <ron...@ma...> - 2015-07-24 14:32:42
|
I have thought about this (or rather, about just patching the SDK headers directly) and this might work, but I don’t know how much crap I’d run into with this. I have to do manual work anyway to verify the extracted information and write test cases, and for now I’ll just do everything by hand. To limit the amount of work I’ve started a local Mercurial repository containing the current SDK headers, I’ll use that to detect changes and update the metadata. To be honest the metadata extractor tools haven’t brought what I’d hoped: I basically end up having to do a lot of work between OSX releases just to keep those tools working and would have had to spent less time if I just had started with manually maintained bindings in the first place. I don’t really like this because I’ll have to do a lot of boring grunt work, but working on the tooling sucks as well. I still hope to have finished the work on the 10.11 bindings by the time 10.11 is released, and hopefully can start doing more fun work afterwards (such as hacking on asyncio support in PyObjC). Ronald > On 23 Jul 2015, at 19:10, Ian McCullough <ip...@po...> wrote: > > Just curious, have you considered making a deep copy of the headers and simply find/replacing all the nonnull stuff out of it, and then using the resulting headers? > > Ian > > > On Thu, Jul 23, 2015 at 9:14 AM, Ronald Oussoren <ron...@ma... <mailto:ron...@ma...>> wrote: > > > On 21 Jul 2015, at 18:31, Ronald Oussoren <ron...@ma... <mailto:ron...@ma...>> wrote: > > > > > >> On 21 Jul 2015, at 17:01, Ronald Oussoren <ron...@ma... <mailto:ron...@ma...>> wrote: > >> > >> Hi, > >> > >> I was stupid enough to start working on the framework bindings for OSX 10.11, and guess what: the tool for generating the metadata doesn’t work with the 10.11 headers due to unexpected breakage in libclang (for some reason the type attribute of some nodes no longer revers to the actual type but some “UNEXPOSED” node instead). The headers for 10.10 work fine with the same compiler… Sigh…. > >> > >> I’ll see if I can work around this problem, but this does mean that generating the 10.11 bindings will take longer than I had hoped. And that’s already way longer than it should be, but I have plans to reduce the amount of work needed. > >> > >> Back to fighting with tools, > > > > I have found why I run into problems, but haven’t found a solution yet. The problem is that there are implicit __nonnull attributes on values (or types) and that attribute type is not exposed through libclang (or maybe there’s just a problem with the python bindings to libclang, but the former seems more likely). > > > > Now just to find a way around this… > > I haven’t found a way around this and have decided not to spent more time fighting libclang for now. For now I’ll just maintain the bindings completely by hand. I’ve done some restructuring on my machine that should make this easier, at least once I’ve done a pass through the beta3 headers for all frameworks that already have bindings. > > This sucks, but I don’t think I’ll find a better solution without hacking on libclang and that’s not something I’m willing to do at the moment (and even then it wouldn’t help, I could only use the result when the resulting patch would be used in the libclang that shipped with Xcode). > > Maybe I should “just” write my own Objective-C parser in Python later on ;-) > > Ronald > > > ------------------------------------------------------------------------------ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... <mailto:Pyo...@li...> > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev <https://lists.sourceforge.net/lists/listinfo/pyobjc-dev> > > ------------------------------------------------------------------------------ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |