From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?S=C3=B6ren?= Tempel Newsgroups: gmane.lisp.guile.bugs Subject: bug#49232: load-foreign-library does not find versioned .so files Date: Sat, 26 Jun 2021 13:37:31 +0200 Message-ID: <23TGNISPS9PPL.2YOENNQD9V56X@8pit.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34033"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (berkeley-unix) To: 49232@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Jun 26 14:08:21 2021 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lx76i-0008ei-U9 for guile-bugs@m.gmane-mx.org; Sat, 26 Jun 2021 14:08:21 +0200 Original-Received: from localhost ([::1]:60570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lx76g-0006ye-Qd for guile-bugs@m.gmane-mx.org; Sat, 26 Jun 2021 08:08:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lx76S-0006yD-Rv for bug-guile@gnu.org; Sat, 26 Jun 2021 08:08:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lx76Q-0003Np-6O for bug-guile@gnu.org; Sat, 26 Jun 2021 08:08:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lx76Q-0000Db-0P for bug-guile@gnu.org; Sat, 26 Jun 2021 08:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?S=C3=B6ren?= Tempel Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 26 Jun 2021 12:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49232 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1624709281830 (code B ref -1); Sat, 26 Jun 2021 12:08:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Jun 2021 12:08:01 +0000 Original-Received: from localhost ([127.0.0.1]:47202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lx76M-0000DI-8x for submit@debbugs.gnu.org; Sat, 26 Jun 2021 08:08:01 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:37486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lx6dD-0007tc-Pb for submit@debbugs.gnu.org; Sat, 26 Jun 2021 07:37:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lx6dD-00067B-Hn for bug-guile@gnu.org; Sat, 26 Jun 2021 07:37:51 -0400 Original-Received: from magnesium.8pit.net ([45.76.88.171]:11643) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lx6dA-0001jL-TZ for bug-guile@gnu.org; Sat, 26 Jun 2021 07:37:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=Bxq74njpCu GYAzNJicheYgeiVfWYEsEwp8YpR4lQpko=; h=from:subject:to:date; d=soeren-tempel.net; b=I+IMl4KHdCJum59ZsMmlA8L9dMyfpIWD1yRqHhzDGhwvbwg Gplq8UGJz3Xr/zVymBYxWe85vs17cWJaeREypZjQJ4nIysry5xeFgNL70a5QDBY5Nv6hNe pksLoeWY1xQKmCaRCDz4XbNU98N6JHGfWozucsmr152S3lwGDBnUEM= Original-Received: from localhost (p200300f5Ff11cC00FEB73078e72fd50B.dip0.t-ipconnect.de [2003:f5:ff11:cc00:feb7:3078:e72f:d50b]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 1d810ebd (TLSv1.3:AEAD-AES256-GCM-SHA384:256:YES) for ; Sat, 26 Jun 2021 13:37:40 +0200 (CEST) Received-SPF: pass client-ip=45.76.88.171; envelope-from=soeren@soeren-tempel.net; helo=magnesium.8pit.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 26 Jun 2021 08:07:56 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10129 Archived-At: Hello, Many Linux distributions (e.g. Alpine Linux and Debian) split packages into multiple subpackages. For instance, library development headers are usually separated from .so files since the former are commonly not needed as a run-time dependency. As part of this split, only versioned sonames are commonly provided by library packages (e.g. libexample.so.4.2.0), the symbolic link to the current .so (e.g. libexample.so -> libexample.so.4.2.0) is provided in a separate development subpackage for every library. This is done to ensure that the unversioned .so symbolic link is only used during compilation, for loading purposes a versioned .so name should always be used. This eases rebuilding packages on ABI changes (i.e. soname version bumps). Many scripting languages, e.g. python, implement a fuzzy search in their FFI library to also match .so files with version numbers [1]. Unfortunately, guile's load-foreign-library does not do so. That is, (load-foreign-library "libexample") will only match libexample.so but not libexample.so.4.2.0. As a consequence, guile packages using FFI will always require a run-time dependency on development subpackages (including headers), only for the .so symbolic link, which is very inconvenient for us at Alpine [2]. Would it be possible to modify load-foreign-library to also match .so file names with a version postfix (like python does for instance)? Please CC me, I am not subscribed to the list. Greetings, S=C3=B6ren [1]: https://docs.python.org/3/library/ctypes.html?highlight=3Dfind_library= #ctypes.util.find_library [2]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/12783