Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #14040

Re: Python C-library import paths

From Simon McVittie <smcv@debian.org>
Newsgroups linux.debian.maint.python
Subject Re: Python C-library import paths
Date 2022-04-02 17:10 +0200
Message-ID <E7Ny1-5WOa-9@gated-at.bofh.it> (permalink)
References <E7eqB-5z0H-3@gated-at.bofh.it> <E7hot-5BdF-1@gated-at.bofh.it> <E7KA9-5UFs-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, 02 Apr 2022 at 12:55:37 +0100, Wookey wrote:
> On 2022-04-01 00:30 -0400, M. Zhou wrote:
> > They have written
> > their own ffi loader, so I think it is an upstream bug. The upstream
> > should detect and add multiarch directory to the paths.
>
> A correct implemntation really should use the full ldconfig set of search paths.

I think what they should actually be doing on Linux (at least in distro
packages) is taking a step back from all these attempts to reproduce
the system's search path for public shared libraries, and instead doing
this in https://github.com/apache/tvm/blob/main/python/tvm/_ffi/base.py:

    ctypes.CDLL('libtvm.so.0')

which will (ask glibc to) do the correct path search, in something like
99% less code.

Maybe all this complexity is needed on Windows or in a "relocatable"
package, but for a distro package it's completely unnecessary and
sometimes harmful.

> I also don't think it should use the $PATH paths for finding
> libraries (but maybe upstream have some reason for doing that)

I suspect the reason is: on Windows, PATH is the equivalent of Linux PATH,
but it also has a dual role as the equivalent of Linux LD_LIBRARY_PATH.

    smcv

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Python C-library import paths Wookey <wookey@wookware.org> - 2022-04-01 03:40 +0200
  Re: Python C-library import paths "M. Zhou" <lumin@debian.org> - 2022-04-01 06:50 +0200
    Re: Python C-library import paths Wookey <wookey@wookware.org> - 2022-04-02 14:00 +0200
      Re: Python C-library import paths Simon McVittie <smcv@debian.org> - 2022-04-02 17:10 +0200
        Re: Python C-library import paths Wookey <wookey@wookware.org> - 2022-04-03 04:40 +0200

csiph-web