Skip to content

Fix for '_enumerateFacets' in 10.15+ #62

@jslegendre

Description

@jslegendre

Turns out CoreUI.framework has its own implementation of the BOM* functions which are NOT exported.

% nm -a /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI | grep BOM  
...
00007fff4228e697 t _BOMTreeIteratorFree
00007fff4228dcf1 t _BOMTreeIteratorIsAtEnd
00007fff4228dd45 t _BOMTreeIteratorKey
00007fff42290791 t _BOMTreeIteratorKeySize
00007fff4228d819 t _BOMTreeIteratorNew
...

In order to get _enumerateFacets working, we only need the CoreUI variants of BOMTreeIteratorNew and BOMTreeIteratorFree.

With these functions being not visible to the linker or dlsym, they have to be resolved manually during runtime. I was able to do this with my libSymRez project like so:

symrez_t sr_coreui = symrez_new("CoreUI");
BOMTreeIteratorRef (*CUIBOMTreeIteratorNew)(BOMTreeRef, int, int, int) = sr_resolve_symbol(sr_coreui, "_BOMTreeIteratorNew");
void (*CUIBOMTreeIteratorFree)(BOMTreeIteratorRef) = sr_resolve_symbol(sr_coreui, "_BOMTreeIteratorFree");

Then replace the functions:

--  BOMTreeIteratorRef iterator = BOMTreeIteratorNew(facet_tree, 0, 0, 0);
++ BOMTreeIteratorRef iterator = CUIBOMTreeIteratorNew(facet_tree, 0, 0, 0);

...

--  BOMTreeIteratorFree(iterator);
++ CUIBOMTreeIteratorFree(iterator);

And we are back in business. It would probably be best to replace all BOM related functions with their CoreUI counterparts but this gets us going.

No idea why _enumerateColors works but _enumerateFacets doesn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions