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

Library in system-wide base libraries not found by executable from python venv #42

Closed
hcsch opened this issue Feb 17, 2023 · 1 comment

Comments

@hcsch
Copy link

hcsch commented Feb 17, 2023

I was hoping to try out nix-ld to fix my issue of the numexpr 2.8.4 python package not finding libstdc++.so.6 (imported by tables 3.7.0, which is imported by a flask 1.1.4 app), but it seems nix-ld can't fix that issue either at the moment. NIX_LD_LIBRARY_PATH is set correctly to /run/current-system/sw/share/nix-ld/lib, and that also contains libstdc++.so.6, but I guess the relevant program is not using the correct linker or something else is going wrong.

LD_DEBUG=libs gets me:

     -- more ld_debug=libs find/search/init stuff --
     16974: find library=libstdc++.so.6 [0]; searching
     16974:  search cache=/nix/store/9xfad3b5z4y00mzmk2wnn4900q0qmxns-glibc-2.35-224/etc/ld.so.cache
     16974:  search path=/nix/store/9xfad3b5z4y00mzmk2wnn4900q0qmxns-glibc-2.35-224/lib     (system search path)
     16974:   trying file=/nix/store/9xfad3b5z4y00mzmk2wnn4900q0qmxns-glibc-2.35-224/lib/libstdc++.so.6
     -- python backtrace to the import of numexpr.interpreter --
     ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory
     -- more ld_debug=libs fini stuff --

Since /run/current-system/sw/share/nix-ld/lib is nowhere to be found in those logs, this makes me believe that the paths in NIX_LD_LIBRARY_PATH are just being ignored, possibly due to the wrong linker being used.

I'm running flask run in a nix shell nixpkgs#python39 with a venv setup with that python, with dependencies installed via pip.

I'll try to fumble together a small example to reproduce this in the coming days, but maybe if this is an obvious mistake on my part, someone could already point it out to me.

Edit: I almost forgot to mention that the program runs just fine if I set LD_LIBRARY_PATH=/run/current-system/sw/share/nix-ld/lib, except that this breaks other stuff like fish and what not, so I can only set it as I start flask run

@bors bors bot closed this as completed in 23b7eeb Feb 17, 2023
@hcsch
Copy link
Author

hcsch commented Feb 17, 2023

Thanks for adding some explanatory docs for this. I searched around rather unsuccessfully before opening the issue and this will probably be a good resource now. ^^

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

1 participant