Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 14886] New: Python ctypes find_library() not working correctly.
@ 2022-07-01  6:58 bugzilla
  2022-07-01 16:55 ` [Buildroot] [Bug 14886] " bugzilla
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bugzilla @ 2022-07-01  6:58 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=14886

            Bug ID: 14886
           Summary: Python ctypes find_library() not working correctly.
           Product: buildroot
           Version: 2022.02.3
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned@buildroot.uclibc.org
          Reporter: pmorici@dev295.com
                CC: buildroot@uclibc.org
  Target Milestone: ---

The find_library() function in the ctypes Python standard library is not
working properly.

  https://docs.python.org/3/library/ctypes.html#finding-shared-libraries

You can reproduce the issue by trying the following in the python shell...

>>> from ctypes.util import find_library
>>> find_library("c")

This should return the string "libc.so.0" but returns nothing, this is the same
for any library name I tried even though you can see the libraries are
installed and "ldconfig -v" lists the libraries.

This has the effect of causing libraries like pyusb to not work properly
because they reply on ctypes & find_library() to find libusb.

Digging a bit deeper on how find_library() works it calls either ldconfig -p,
ld, or gcc.  buildroot doesn't have ld or gcc installed so I assume that means
it is using "ldconfig -p".  ldconfig is part of the uclibc library and uclibc
has caching turned off in its configuration so ldconfig -p just prints a
message says, "Library cache disabled" instead of printing a list of libraries
and their absolute paths.

https://github.com/python/cpython/blob/main/Lib/ctypes/util.py

There is an option in the uclibc menuconfig to enable the cache
(LDSO_CACHE_SUPPORT) but when I did that it didn't seem to change anything. 
Any ideas how to fix this?

I'm using the pc_x86_64_efi_defconfig with Python enabled.  No other changes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-06-15 15:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-01  6:58 [Buildroot] [Bug 14886] New: Python ctypes find_library() not working correctly bugzilla
2022-07-01 16:55 ` [Buildroot] [Bug 14886] " bugzilla
2022-07-11  6:44 ` bugzilla
2022-07-15  0:47 ` bugzilla
2022-07-18 22:06 ` bugzilla
2022-07-20  0:49 ` bugzilla
2022-07-20  0:59 ` bugzilla
2023-03-31 18:41 ` bugzilla
2024-06-15 15:03 ` bugzilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox