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

pip package lacks support for apple M1/arm64e #20

Open
psifertex opened this issue Mar 14, 2022 · 3 comments
Open

pip package lacks support for apple M1/arm64e #20

psifertex opened this issue Mar 14, 2022 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@psifertex
Copy link

  File "go.py", line 1, in <module>
    import pygore
  File "/Users/jwiens/Library/Python/3.8/lib/python/site-packages/pygore/__init__.py", line 5, in <module>
    from .lib import CompilerVersion, Function, Method, Package, GoFile,\
  File "/Users/jwiens/Library/Python/3.8/lib/python/site-packages/pygore/lib.py", line 5, in <module>
    import pygore.internal as internal
  File "/Users/jwiens/Library/Python/3.8/lib/python/site-packages/pygore/internal.py", line 21, in <module>
    lib = cdll.LoadLibrary(os.path.dirname(__file__) + '/' + libFile)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/jwiens/Library/Python/3.8/lib/python/site-packages/pygore/libgore.dylib, 0x0006): tried: '/Users/jwiens/Library/Python/3.8/lib/python/site-packages/pygore/libgore.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/libgore.dylib' (no such file), '/usr/lib/libgore.dylib' (no such file)```

Can always build it manually so not a show-stopper but figured I'd file this to track it for now. Best solution would be to build as a fat mach-o with support for both architectures. 
@psifertex psifertex changed the title pip lacks support for apple M1/arm64e pip package lacks support for apple M1/arm64e Mar 14, 2022
@TcM1911
Copy link
Member

TcM1911 commented May 14, 2022

This will have to be addressed in libgore first to compile an arm64 dylib. I don't think the Go toolchain can build a fat Mach-O file so probably need some logic to detect which architecture it is and load the right dylib. I don't have an M1 to test it on and Github Action doesn't support it either.

@ApexHack3r
Copy link

@TcM1911 - I have encountered the same issue these changes to the makefile should resolve it, didn't test it on amd64 mac.

@TcM1911
Copy link
Member

TcM1911 commented Feb 14, 2023

Looks like a good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants