native icon indicating copy to clipboard operation
native copied to clipboard

Objective-C ffigen should test against all Apple APIs

Open brianquinlan opened this issue 1 year ago • 2 comments

There should be an integration test that runs ffigen against all of Apple's headers and verifies that the resulting generated file passes analysis.

Bonus points for spot-checking that some complex classes, protocols, etc. are usable.

brianquinlan avatar May 30 '24 22:05 brianquinlan

There are 4383 headers across 255 frameworks in my Apple SDKs directory (matching /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/*.framework/Headers/**.h). When I try to generate bindings for all of them, it runs for 35min then crashes with no useful info (not sure if it's a legit bug, or if my laptop just ran out of memory or something).

So instead of pulling in all these headers as a glob, I'm going to add one framework at a time until something breaks.

liamappelbe avatar Jun 03 '24 23:06 liamappelbe

There's one more bug that needs to be fixed before this can land: #1220

liamappelbe avatar Jul 03 '24 23:07 liamappelbe

Tried running this test on the github CI bots in https://github.com/dart-lang/native/pull/1554. Unfortunately they don't really have enough memory to run this test without thrashing (see https://github.com/dart-lang/sdk/issues/56247). So what should be a 30sec analysis times out after 30min.

I added a randomized filter that removes 90% of the bindings, and that allows the test to complete.

liamappelbe avatar Sep 12 '24 04:09 liamappelbe