-
Notifications
You must be signed in to change notification settings - Fork 54
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
macOS dyld unable to find Python dylib for cc_binary with embedded interpreter #76
Comments
Could you just clarify whether the "embedded" interpreter means the interpreter from the hermetic toolchain (as installed by rules_python) or the system interpreter? If the latter, how are you configuring the toolchain? (Ping, @rickeylev.) |
BTW, this shouldn't be necessary given the use of pybind11_bazel version 2.11.1.bzl.3. |
I'm not sure. I'm using whatever comes by default with the homebrew bazel install. As you can see in the example reproduction project, there's no toolchain customization whatsoever at the project level.
If I comment that line, I get:
|
Interestingly, Homebrew Bazel forces Homebrew Python. I'm unsure whether that could interfere with the hermetic toolchain that rules_python installs. Would it be feasible for you to retry this build using "normal" Bazel just to rule out that possibility?
Mea culpa, I hadn't twigged that the |
Just uninstalled the
|
Insofar as even Homebrew Bazelisk would presumably be downloading a "normal" Bazel binary, I believe that answers that. :( Do you know whether an equivalent "hello, world" without using pybind11 fails in the same way? If so, the problem is likely to be on the rules_python side. I really don't understand why its hermetic toolchain doesn't Just Work™ here... |
FYI, as per #77 (comment), there may indeed be a subtle bug in rules_python. The presence of |
FYI, these paths come from the To be more precise: That path is the LC_LOAD_DYLIB entry for I'm not sure whether this is a Bazel bug, and Bazel should fix up this path after the build/during linking, or if the Python toolchain macro should run a path fixup script (it seems |
Minimal reproduction example in https://github.com/martinblech/pybind11_test
When I run the
pybind11_test
target, I getLibrary not loaded: /install/lib/libpython3.11.dylib
. It seems like the binary was linked using an incorrect dylib path. Full error message below:The text was updated successfully, but these errors were encountered: