Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@busybox.net
To: buildroot@uclibc.org
Subject: [Buildroot] [Bug 14886] New: Python ctypes find_library() not working correctly.
Date: Fri, 01 Jul 2022 06:58:53 +0000	[thread overview]
Message-ID: <bug-14886-163@https.bugs.busybox.net/> (raw)

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

             reply	other threads:[~2022-07-01  6:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01  6:58 bugzilla [this message]
2022-07-01 16:55 ` [Buildroot] [Bug 14886] Python ctypes find_library() not working correctly 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-14886-163@https.bugs.busybox.net/ \
    --to=bugzilla@busybox.net \
    --cc=buildroot@uclibc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox