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

[Python:0.8.6] Package installation on ARM MacOS results in x86_64 native .so file #161

Closed
carlzogh opened this issue Apr 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@carlzogh
Copy link

carlzogh commented Apr 11, 2024

Describe the bug you encountered:

With pyroscope-io version 0.8.6 installed through poetry, the library fails at runtime with the error:

  File "/.../.venv/lib/python3.12/site-packages/nms_service_commons/profiling/setup.py", line 5, in <module>
    import pyroscope
  File "/.../.venv/lib/python3.12/site-packages/pyroscope/__init__.py", line 6, in <module>
    from pyroscope._native import ffi, lib
  File "/.../.venv/lib/python3.12/site-packages/pyroscope/_native.py", line 7, in <module>
    lib = ffi.dlopen(os.path.join(os.path.dirname(__file__), '_native__lib.cpython-311-darwin.so'), 130)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: cannot load library '/.../.venv/lib/python3.12/site-packages/pyroscope/_native__lib.cpython-311-darwin.so': dlopen(/.../.venv/lib/python3.12/site-packages/pyroscope/_native__lib.cpython-311-darwin.so, 0x0082): tried: '/.../.venv/lib/python3.12/site-packages/pyroscope/_native__lib.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/.../.venv/lib/python3.12/site-packages/pyroscope/_native__lib.cpython-311-darwin.so' (no such file), '/.../.venv/lib/python3.12/site-packages/pyroscope/_native__lib.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))

After further investigation it turns out version 0.8.6 produces a .so file with the wrong architecture for my machine.
I am running on a MacOS M2 (ie. arm64) whereas it seems the pyroscope library is x86_64:

$ lipo -info /.../.venv/lib/python3.12/site-packages/pyroscope/_native__lib.cpython-311-darwin.so
Non-fat file: /.../.venv/lib/python3.12/site-packages/pyroscope/_native__lib.cpython-311-darwin.so is architecture: x86_64

What did you expect to happen instead?

I do not get this error with version 0.8.5, and can confirm its SO library is compiled for arm64:

$ lipo -info /.../.venv/lib/python3.12/site-packages/pyroscope/_native__lib.cpython-39-darwin.so
Non-fat file: /.../.venv/lib/python3.12/site-packages/pyroscope/_native__lib.cpython-39-darwin.so is architecture: arm64

How did you install pyroscope-rs?

poetry add pyroscope


pyroscope-rs version and environment

MacOS 14.4.1 (M2 Pro chip).
pyroscope-io (python) version 0.8.6
Python 3.12.2
Poetry 1.8.2

@carlzogh carlzogh added the bug Something isn't working label Apr 11, 2024
@korniltsev
Copy link
Collaborator

ugh, I messed something up.
I will take a look

@korniltsev
Copy link
Collaborator

should be fixed in 0.8.7

@carlzogh
Copy link
Author

Can confirm this is now fixed - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants