question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.8.0 Python client library for Mac OS Big Sur won't load due to absolute linker paths left over from build environment

See original GitHub issue

Describe the bug The compilation of the Python binary artifact for the 2.8 client library appears to have been performed incorrectly. The client currently tries to dynamically link against libraries that don’t exist, which causes import pulsar to fail.

The library has static (absolute) linker paths baked in which appear to correspond to paths that were only present on the environment on which the current distribution of the binary was originally compiled before being uploaded.

To Reproduce Steps to reproduce the behavior:

  1. On Mac OS Big Sur, create a python environment using either Python 3.8 or Python 3.9 (I’ve reproduced on both). I used pyenv for 3.8, and Homebrew for 3.9.
  2. In that environment, do pip install pulsar-client==2.8.0
  3. Launch python and run import pulsar
  4. See error:
>>> import pulsar
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user/.pyenv/versions/zac37/lib/python3.7/site-packages/pulsar/__init__.py", line 103, in <module>
    import _pulsar
ImportError: dlopen(/Users/user/.pyenv/versions/zac37/lib/python3.7/site-packages/_pulsar.cpython-37m-darwin.so, 2): Library not loaded: /Users/admin/spack/opt/spack/darwin-bigsur-skylake/apple-clang-12.0.0/openssl-1.1.1k-vh6zdk5wa6z2api2aadok7syaaft6b5z/lib/libssl.1.1.dylib
  Referenced from: /Users/user/.pyenv/versions/3.7.10/envs/zac37/lib/python3.7/site-packages/_pulsar.cpython-37m-darwin.so
  Reason: image not found

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • OS: Mac OS Big Sur

Additional context

The error is caused by absolute (rather than relative) linker paths:

 % otool -L /Users/user/.pyenv/versions/zac37/lib/python3.7/site-packages/_pulsar.cpython-37m-darwin.so
/Users/andris.cakuls/.pyenv/versions/zac37/lib/python3.7/site-packages/_pulsar.cpython-37m-darwin.so:
    @rpath/_pulsar.so (compatibility version 0.0.0, current version 0.0.0)
    /Users/admin/spack/opt/spack/darwin-bigsur-skylake/apple-clang-12.0.0/curl-7.76.1-svdal2fl5lmbov7ilaupyceiovahyixw/lib/libcurl.4.dylib (compatibility version 12.0.0, current version 12.0.0)
    /Users/admin/spack/opt/spack/darwin-bigsur-skylake/apple-clang-12.0.0/openssl-1.1.1k-vh6zdk5wa6z2api2aadok7syaaft6b5z/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /Users/admin/spack/opt/spack/darwin-bigsur-skylake/apple-clang-12.0.0/openssl-1.1.1k-vh6zdk5wa6z2api2aadok7syaaft6b5z/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /Users/admin/spack/opt/spack/darwin-bigsur-skylake/apple-clang-12.0.0/zlib-1.2.11-xflsouiaysa3uizi6mjcwhv54aa5m6kd/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
    @rpath/libzstd.1.dylib (compatibility version 1.0.0, current version 1.5.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 905.6.0)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
ca-simone-chiorazzocommented, Jul 30, 2021

We have the same issue with the 2.7.2 version. Any chance to publish a fixed version for this issue?

3reactions
zbentleycommented, Jul 28, 2021

Bump. Not to be annoying, but having the latest client library for the 2nd most popular programming language in the world fail to link/load is probably a blocker for many folks.

If it helps, I’m happy to compile and supply properly linked versions of the library to any Pulsar package maintainers if that would expedite a fix here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GitHub] [pulsar] aahmed-se commented on issue #11203
The library has static (absolute) linker paths baked in which appear ... On Mac OS Big Sur, create a python environment using either...
Read more >
Linking to system python lib fails… | Apple Developer Forums
Code that compiled fine with XCode 12 / Big Sur fails on XCode 13/Monterey with the linker error: "cannot link directly with dylib/framework,...
Read more >
Document and fix Python installation problems on Big Sur
This issue is to track all known issues to doing development of Sentry on Big Sur (Mac's latest OS update). I will update...
Read more >
Python cannot be opened when launching PyCharm CE
The short answer: upgrading to Big Sur may have broken your old Python installation, but your project in PyCharm is still trying to...
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found