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


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

Re: Python C-library import paths

Path csiph.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!bofh.it!news.nic.it!robomod
From Simon McVittie <smcv@debian.org>
Newsgroups linux.debian.maint.python
Subject Re: Python C-library import paths
Date Sat, 02 Apr 2022 17:10:01 +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>
X-Mailbox-Line From debian-python-request@lists.debian.org Sat Apr 2 15:05:12 2022
Old-Return-Path <smcv@debian.org>
X-Amavis-Spam-Status No, score=-112.11 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FOURLA=0.1, LDO_WHITELIST=-5, RCVD_IN_DNSWL_HI=-5, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DKIM_WELCOMELIST=0.001, USER_IN_DKIM_WHITELIST=-100] autolearn=ham autolearn_force=no
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
X-Mailing-List <debian-python@lists.debian.org> archive/latest/19862
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/YkhmFEsV1qUXl+yz@momentum.pseudorandom.co.uk
Approved robomod@news.nic.it
Lines 29
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Cc "M. Zhou" <lumin@debian.org>, Debian DL/AI list <debian-ai@lists.debian.org>
X-Original-Date Sat, 2 Apr 2022 16:04:52 +0100
X-Original-Message-ID <YkhmFEsV1qUXl+yz@momentum.pseudorandom.co.uk>
X-Original-References <20220401013257.GS23856@mail.wookware.org> <33a7e6fb1bd2b913e60ce4e56554acfa3fcb9d0e.camel@debian.org> <20220402115537.GW23856@mail.wookware.org>
Xref csiph.com linux.debian.maint.python:14040

Show key headers only | 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