Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error on iMac running 10.10.5 #3

Closed
latenitefilms opened this issue Sep 22, 2016 · 5 comments
Closed

Fatal Error on iMac running 10.10.5 #3

latenitefilms opened this issue Sep 22, 2016 · 5 comments

Comments

@latenitefilms
Copy link

I just tried using axuielement on one of our iMac running 10.10.5 and it breaks Hammerspoon with the following error:

-- Loading extension: uielement
*** ERROR: error loading module 'hs._asm.axuielement.internal' from file '/Users/latenitebravo/.hammerspoon/hs/_asm/axuielement/internal.so':
    dlopen(/Users/latenitebravo/.hammerspoon/hs/_asm/axuielement/internal.so, 6): Symbol not found: _CVMetalTextureCacheGetTypeID
  Referenced from: /Users/latenitebravo/.hammerspoon/hs/_asm/axuielement/internal.so (which was built for Mac OS X 10.12)
  Expected in: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
 in /Users/latenitebravo/.hammerspoon/hs/_asm/axuielement/internal.so
stack traceback:
    [C]: in ?
    [C]: in function 'rawrequire'
    ...app/Contents/Resources/extensions/hs/_coresetup/init.lua:449: in function 'require'
    .../latenitebravo/.hammerspoon/hs/_asm/axuielement/init.lua:30: in main chunk
    [C]: in function 'rawrequire'
    ...app/Contents/Resources/extensions/hs/_coresetup/init.lua:449: in function 'require'
    /Users/latenitebravo/.hammerspoon/init.lua:56: in main chunk
    [C]: in function 'xpcall'
    ...app/Contents/Resources/extensions/hs/_coresetup/init.lua:481: in function 'hs._coresetup.setup'
    (...tail calls...)
@asmagill
Copy link
Owner

The code which converts data types from their internal representation to lua was designed to be useful in a larger context, perhaps eventually being added to one of our internal frameworks so it doesn't have to be repeated. However, now that I've played with axuielement for a while, I think I can remove most of the "extra types" since they aren't relevant to Accessibility.

This is a long way of saying that the module currently has code to identify variable types it will never use... and some of them are newer than 10.10... if the conversion code ever gets made into a reusable library, additional code should be added to detect the OS version and work around this... however, the simplest fix, which I can include in some updates I plan to add tonight, is to simply remove the data types that I now know Accessibility never uses.

@latenitefilms
Copy link
Author

Awesome - thank you!!

@latenitefilms
Copy link
Author

I fixed this by commenting out lines 156 and 157 in internal.m:

    //lua_pushstring(L, "CVMetalTexture") ;        lua_seti(L, -2, (lua_Integer)CVMetalTextureGetTypeID()) ;
    //lua_pushstring(L, "CVMetalTextureCache") ;   lua_seti(L, -2, (lua_Integer)CVMetalTextureCacheGetTypeID()) ;

@asmagill
Copy link
Owner

The current version at https://github.com/asmagill/hs._asm.axuielement/ has these extraneous types removed as well, but since I'm still working on the search rewrite, I hadn't really posted about it yet! Guess I should have here, but glad you got it working for you for now!

@latenitefilms
Copy link
Author

No worries at all! Thanks @asmagill!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants