Skip to content

[python] ctypes.util.find_library should return full path to the library #7307

@kirelagin

Description

@kirelagin

I’m trying to run a Python project that uses libnfc in nix-shell. The code does

ctypes.util.find_library('nfc')

and for some strange reason this returns just libnfc.so.5. I’m not sure how find_library works, but the docs say:

On Linux, find_library() tries to run external programs (/sbin/ldconfig, gcc, and objdump) to find the library file.

Unfortunately this doesn’t seem to work, even though g++ successfully builds a C++ program that depends on libnfc. Any ideas why this is happening? Why isn’t it able to figure out the path to libnfc? Shouldn’t ctypes.util.find_library be patched in nixpkgs to avoid running weird programs and just check the environment variables?

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: pythonPython is a high-level, general-purpose programming language.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions