From unknown Sun Jun 15 10:54:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#64723 <64723@debbugs.gnu.org> To: bug#64723 <64723@debbugs.gnu.org> Subject: Status: load-foreign-library has incomplete support for libtool-generated DLLs Reply-To: bug#64723 <64723@debbugs.gnu.org> Date: Sun, 15 Jun 2025 17:54:12 +0000 retitle 64723 load-foreign-library has incomplete support for libtool-gener= ated DLLs reassign 64723 guile submitter 64723 Michael Gran severity 64723 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 19 02:47:38 2023 Received: (at submit) by debbugs.gnu.org; 19 Jul 2023 06:47:38 +0000 Received: from localhost ([127.0.0.1]:54805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM0yH-0003a5-Og for submit@debbugs.gnu.org; Wed, 19 Jul 2023 02:47:37 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM0yD-0003Zp-LS for submit@debbugs.gnu.org; Wed, 19 Jul 2023 02:47:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qM0y5-0002hX-Rz for bug-guile@gnu.org; Wed, 19 Jul 2023 02:47:26 -0400 Received: from sonic306-1.consmr.mail.bf2.yahoo.com ([74.6.132.40]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qM0y1-00009r-R2 for bug-guile@gnu.org; Wed, 19 Jul 2023 02:47:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1689749237; bh=hFG5P2u+WmWUjP2g750/nHstxdX2sw/X5PZ3XUitAUw=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=ihXx8Voz+BEetB/KoA2VHFUK+lC0ekmrLBlPqVQfimMnJZ1hF/EkR64kAmEzMF/5FIHBRftmXgFtNp2zmlQsuQKSZq8Tpe7LKK6fMBCeTtieToOQJv4jwpglH5sE3qZQH34C4fYblz1EB7fTzi9huQUtrOvmZfWlRCnGVkEwZwO6AdIpYdSfZs6QhGwZx4jqpe5ngi4IlEVMyy71XqlJ/8y58opzyaCOs+4iUhmmi8ze9CFe6MHTHBdrxq1xOw2+SvDEH0ZYmrA+Ajn78SgRl3LX6ROKh5EDwF3S7IqsQvPduXm1ICkjg2GkPOTDXf88SmvWgc9JJlITdK1ghj3QYA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1689749237; bh=AP2SZ3d+HthzOJejVloVX30VhGIlPFD2kBu8fEC/cuO=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=YzoPtuo5esUtOLTOLYQELkjLfWWDAiL7kJpdh9Tz7P21yQHVjBJuyp3zqQFVnUa8ZRt7+iN7dP5a5I6D8uOPtKtLEXkqqWl4hnjiE3TnyWGM9af9HV3hHcpJnUwLFDkRZo7RJ0JYh1kp00EHIPkHJRA1cVIUAPfvU2GuBlz4MVaVjIiYuJZiXX+ga4FU0yQpWmtS4iehDNBB7oPPH1DjvKrcDenq6V6zOQ4la8d429ezb8dUv8QNq432URgTlpWg6pzyCVycqHzp+2Jtysd0YdkOuNYdRi6yQyHzc7U3GtNb4Xy7BMgwp/UkahAz94cCHnoBSv5f5EhgWNrZfLpaXg== X-YMail-OSG: acLFJykVM1n.3iPcVMknK9CX7Dncj2nYGyf0GGLL963FRAspok7fj1bvLn8Lnnz 3pA_mKe75_2NqAxJz24lXlKM5yc7o5O.cctCs7E.FrNvgH3BhN7nd6ztYO.lh_DO9Z4rq3amwWHI tjwMjppJedr7jWDLQFESM3RWWI2kZ21yhPgj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sonic-ID: 958c0d8c-0f23-47e5-b41f-0364e25d5caa Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Wed, 19 Jul 2023 06:47:17 +0000 Received: by hermes--production-ne1-77c6dd44c7-hd2m4 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0a8cc59e8f821b31b077a28144e71647; Wed, 19 Jul 2023 06:47:12 +0000 (UTC) From: Michael Gran To: bug-guile@gnu.org Subject: load-foreign-library has incomplete support for libtool-generated DLLs Date: Tue, 18 Jul 2023 23:47:10 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (cygwin) MIME-Version: 1.0 Content-Type: text/plain References: X-Mailer: WebService/1.1.21647 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 530 Received-SPF: pass client-ip=74.6.132.40; envelope-from=spk121@yahoo.com; helo=sonic306-1.consmr.mail.bf2.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.9 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The new non-libltdl foreign library loading algorithm from 3.0.6 fails to cover common cases regarding how libtool names and installs DLL files. Notably, it fails to recognize when libtool has added t [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (spk121[at]yahoo.com) 1.0 FORGED_YAHOO_RCVD 'From' yahoo.com does not match 'Received' headers -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (spk121[at]yahoo.com) -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.9 (/) The new non-libltdl foreign library loading algorithm from 3.0.6 fails to cover common cases regarding how libtool names and installs DLL files. Notably, it fails to recognize when libtool has added the major version number into the filename itself, such as libfoo-1.dll Also, it does not search in binary directories and the PATH for DLL files, where libtool is likely to install DLLs. Also, just as it handles the libfoo.dll -> cygfoo.dll renaming for cygwin, it should handle the libfoo.dll -> msys-foo.dll renaming for MSYS From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 19 02:59:57 2023 Received: (at 64723) by debbugs.gnu.org; 19 Jul 2023 06:59:57 +0000 Received: from localhost ([127.0.0.1]:54818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM1AC-0003y0-0i for submit@debbugs.gnu.org; Wed, 19 Jul 2023 02:59:57 -0400 Received: from sonic309-15.consmr.mail.bf2.yahoo.com ([74.6.129.125]:38676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM1A8-0003xb-4K for 64723@debbugs.gnu.org; Wed, 19 Jul 2023 02:59:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1689749985; bh=vLSDUz43vnJeq6mc0H14FjSTiCSIAS2KK2saoUnM6Fc=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=Nmbg1xKIUOVJERtNdthPar1G9mlW8leXDrUAigMXQbzK+9Jc3I1R+xBWh2cqRa4ra6QZNygnUc1/T24oDf0Hw3yVg6lvYCmlXhdLBJ7ExpoR7SqWeO6w86zogPQl1PaISmErNldhCzkY/B81s8WlswYyWkLsQVAq/t64q9Kbk9pdxFzU8MdK+dOZRYYIYV7GOCQdaRkOSh76goL8+y+KElGZtj3es+aY5ZbsAoyf7jIkaH3DaXzjdoxHa1Eske5pE9u0Dwi++jrbqa0Y0kbMfoOUeFYbA+HUke3gP95Y2nQKJpHXOfCy6w5RB7tsoyX1Hcmr8wQF9vVBMPeAfP5LOQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1689749985; bh=+Ft3H3hww31l3RPHk55GA1PEYTd6SnP0Kevmalea9My=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=BUCIed/op6BQxH1iaL44PTNBIdnjwfGcgfoajrRE6+mkggg9RIzm2qbpKijylw0YjUfQRUpN4H2JRYHzrWPrDy3abR/bkIdveRntYszUZlIcQ5gC+2LUp6eJHKtQY6VY5OrDcCF/oX1eLYdQqPyTHcv+tQJ29tupF5bO/b52jDUSKkB7Jf5agjymArfcQBPwAn5BUis7t3CPDTfY4sN0ZRWEJA2DcpoiOD+6n+3ZbUoY4Mw1IZ1sZJDd4Dcx5kr8NmOHlKRZb1qnWWncTQWE9XvTXXgSjf3ioi/ruqBe6V5Oogtr542zm5VGM0NWykGr+IcF5uKu4WrQfj6Y1iHeIQ== X-YMail-OSG: 1Ewh74UVM1l5hUTiJtMMldJI2SDp9Z_ht0mnaMXndSqb.QShACQgG7oB0bwJSQx RS4iCD6OSSPbDDfRIVzmHjoK5diedXHZY0sYB1L_m8nwCZjabbBzM3Tba4KTVTDlDGD_0YOM7D7. 5QvevBV6nOIDaheNFARtSf159S69JufFAAZP6kfrme84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-4ae9-99e2-bf500eba5353 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.bf2.yahoo.com with HTTP; Wed, 19 Jul 2023 06:59:45 +0000 Received: by hermes--production-ne1-77c6dd44c7-d9gvl (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 8d6a9b6070b141e7944bc132c1644f27; Wed, 19 Jul 2023 06:59:42 +0000 (UTC) From: Michael Gran To: 64723@debbugs.gnu.org Subject: [PATCH] Improve DLL search strategy for load-foreign-library Date: Fri, 2 Jun 2023 16:28:55 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (cygwin) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable References: X-Mailer: WebService/1.1.21647 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 27498 X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The new non-libltdl foreign library loading algorithm from 3.0.6 fails to cover common cases regarding how libtool names and installs DLL files. Notably, it fails to recognize when libtool has added t [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [74.6.129.125 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (spk121[at]yahoo.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (spk121[at]yahoo.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [74.6.129.125 listed in wl.mailspike.net] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 64723 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The new non-libltdl foreign library loading algorithm from 3.0.6 fails to cover common cases regarding how libtool names and installs DLL files. Notably, it fails to recognize when libtool has added t [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [74.6.129.125 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [74.6.129.125 listed in wl.mailspike.net] 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (spk121[at]yahoo.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (spk121[at]yahoo.com) -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager The new non-libltdl foreign library loading algorithm from 3.0.6 fails to cover common cases regarding how libtool names and installs DLL files. Notably, it fails to recognize when libtool has added the major version number into the filename itself, such as libfoo-1.dll Also, it does not search in binary directories and the PATH for DLL files, where libtool is likely to install DLLs. This adds the option to search for dlls with major version numbers in the filename, and modifies the search strategy for DLL-using OSs to check bindir and PATH. For MSYS, libraries are installed with the 'msys-' prefix. So this modifies load-foreign-library to handle that prefix as well. It changes the #:rename-on-cygwin? option to #:host-type-rename? Partially based on a patch by Hannes M=C3=BCller. * NEWS: updated * doc/ref/api-foreign.text: document updates to load-foreign-library and system-dll-path * module/system/foreign-library.scm (is-integer-string?): new utility funct= ion (dll-name-match?): new utility function (find-best-dll-from-matches): new utility function (dll-exists-with-version): new function that implements new dll search lo= gic (file-exists-with-extension): add flag argument to allow new dll search (file-exists-in-path-with-extension): add flag argument to all new dll se= arch (system-dll-path): new parameter (lib->msys): new helper function (load-foreign-library): add new optarg flag #:allow-dll-version-suffix? Pass new flag to library search functions. Implement new search strategy for #:search-system-paths? on DLL systems' replace #:rename-on-cygwin? with #:host-type-rename? Use that option to rename both MSYS and Cygwin libraries. (guile-system-extensions-path): prefer bindir to libdir on DLL systems * test-suite/tests/foreign.test ("dll-name-match?"): new test category ("find-best-dll-from-matches"): new test category ("lib->msys"): new unit tests --- NEWS | 15 +++ doc/ref/api-foreign.texi | 135 ++++++++++++++++---------- module/system/foreign-library.scm | 151 +++++++++++++++++++++++++++--- test-suite/tests/foreign.test | 114 +++++++++++++++++----- 4 files changed, 326 insertions(+), 89 deletions(-) diff --git a/NEWS b/NEWS index 87aefb03f..d05649c42 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,21 @@ definitely unused---this is notably the case for modules= that are only used at macro-expansion time, such as (srfi srfi-26). In those cases, the compiler reports it as "possibly unused". =20 +** improve 'load-foreign-library' handling of DLLs + +The non-libltdl load-foreign-library introduced in 3.0.6 does not handle +some common cases with libtool-generated DLLs. It has been updated +to search for DLLs that have a version number appended to the name +by libtool, such as libfoo-1.dll. + +Also, it has been updated to do library renaming for MSYS. On Cygwin, +when the #:rename-on-cygwin? option is #t, it already had the capability +to search for "libfoo" as "cygfoo.dll". It has been updated to add the +capability to search for "libfoo" as "msys-foo.dll" on MSYS. + +The load-foreign-library option #:rename-on-cygwin? has been changed to +#:host-type-rename?, and handles both Cygwin and MSYS. + * Bug fixes =20 ** (ice-9 suspendable-ports) incorrect UTF-8 decoding diff --git a/doc/ref/api-foreign.texi b/doc/ref/api-foreign.texi index 540fbbaf5..d6ea72f7f 100644 --- a/doc/ref/api-foreign.texi +++ b/doc/ref/api-foreign.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000-2004, 2007-2014, 2016-2017, 2021 +@c Copyright (C) 1996, 1997, 2000-2004, 2007-2014, 2016-2017, 2021, 2023 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. =20 @@ -83,19 +83,24 @@ implemented in the @code{(system foreign-library)} modu= le. [#:extensions=3Dsystem-library-extensions] @ [#:search-ltdl-library-path?=3D#t] @ [#:search-path=3Dsearch-path] @ - [#:search-system-paths?=3D#t] [#:lazy?=3D#t] [#:global=3D#f] - [#:rename-on-cygwin?=3D#t] -Find the shared library denoted by @var{library} (a string or @code{#f}) -and link it into the running Guile application. When everything works -out, return a Scheme object suitable for representing the linked object -file. Otherwise an error is thrown. + [#:search-system-paths?=3D#t] [#:lazy?=3D#t] [#:global=3D#f] @ + [#:host-type-rename?=3D#t] [#:allow-dll-version-suffix?=3D#t] =20 -If @var{library} argument is omitted, it defaults to @code{#f}. If -@code{library} is false, the resulting foreign library gives access to -all symbols available for dynamic linking in the main binary. +This procedure finds the shared library denoted by @var{library} (a +string) and dynamically links it into the running Guile application. On +success, the procedure returns a Scheme object suitable for representing +the linked object file. Otherwise an error is thrown. + +In the common usage, the @var{library} parameter is a filename +with no path and with no filename extension, such as @code{.so}, +@code{.dylib} or @code{.dll}. The procedure will search for the library +in a set of standard locations using the common filename extensions for +the OS. The optional parameters can customize this behavior. =20 -It is not necessary to include any extension such as @code{.so} in -@var{library}. For each system, Guile has a default set of extensions +When @var{library} has directory elements or a filename extension, a +more targeted search is performed. + +For each system, Guile has a default set of extensions that it will try. On GNU systems, the default extension set is just @code{.so}; on Windows, just @code{.dll}; and on Darwin (Mac OS), it is @code{.bundle}, @code{.so}, and @code{.dylib}. Pass @code{#:extensions @@ -113,42 +118,17 @@ environment variables: =20 @table @env @item GUILE_EXTENSIONS_PATH -This is the main environment variable for users to add directories -containing Guile extensions. The default value has no entries. This -environment variable was added in Guile 3.0.6. +This is the environment variable for users to add directories containing +Guile extensions to the search path. The default value has no entries. +This environment variable was added in Guile 3.0.6. @item LTDL_LIBRARY_PATH -Before Guile 3.0.6, Guile loaded foreign libraries using @code{libltdl}, -the dynamic library loader provided by libtool. This loader used -@env{LTDL_LIBRARY_PATH}, and for backwards compatibility we still -support that path. - -However, @code{libltdl} would not only open @code{.so} (or @code{.dll} -and so on) files, but also the @code{.la} files created by libtool. In -installed libraries -- libraries that are in the target directories of -@code{make install} -- @code{.la} files are never needed, to the extent -that most GNU/Linux distributions remove them entirely. It is -sufficient to just load the @code{.so} (or @code{.dll} and so on) files, -which are always located in the same directory as the @code{.la} files. - -But for uninstalled dynamic libraries, like those in a build tree, the -situation is a bit of a mess. If you have a project that uses libtool -to build libraries -- which is the case for Guile, and for most projects -using autotools -- and you build @file{foo.so} in directory @file{D}, -libtool will put @file{foo.la} in @file{D}, but @file{foo.so} gets put -into @file{D/.libs}. - -Users were mostly oblivious to this situation, as @code{libltdl} had -special logic to be able to read the @code{.la} file to know where to -find the @code{.so}, even from an uninstalled build tree, preventing the -existence of @file{.libs} from leaking out to the user. +When @var{search-ltdl-library-path?} is true, this environment variable +can also be used to add directories to the search path. For each +directory given in this environment variable, two directories are added +to the search path: the given directory (for example, @code{D}) and a +@code{.libs} subdirectory (@code{D/.libs}). =20 -We don't use libltdl now, essentially for flexibility and -error-reporting reasons. But, to keep this old use-case working, if -@var{search-ltdl-library-path?} is true, we add each entry of -@code{LTDL_LIBRARY_PATH} to the default extensions load path, -additionally adding the @file{.libs} subdirextories for each entry, in -case there are @file{.so} files there instead of alongside the -@file{.la} files. +For more information on the rationale, see the note below. @item GUILE_SYSTEM_EXTENSIONS_PATH The last path in Guile's search path belongs to Guile itself, and defaults to the libdir and the extensiondir, in that order. For @@ -157,6 +137,9 @@ example, if you install to @file{/opt/guile}, these wou= ld probably be @code{/opt/guile/lib/guile/@value{EFFECTIVE-VERSION}/extensions}, respectively. @xref{Parallel Installations}, for more details on @code{extensionsdir}. + +For DLL-using systems, it searches bindir rather than libdir, so +@file{/opt/guile/bin} in this example. @end table =20 Finally, if no library is found in the search path, and if @var{library} @@ -165,8 +148,9 @@ is not absolute and does not include directory separato= rs, and if own logic for where to locate @var{library}. For example, on GNU, there will be a default set of paths (often @file{/usr/lib} and @file{/lib}, though it depends on the system), and the @code{LD_LIBRARY_PATH} -environment variable can add additional paths. Other operating systems -have other conventions. +environment variable can add additional paths. On DLL-using systems, +the @env{PATH} is searched. Other operating systems have other +conventions. =20 Falling back to the operating system for search is usually not a great thing; it is a recipe for making programs that work on one machine but @@ -179,10 +163,27 @@ used. If @var{global?} is true, symbols defined by t= he loaded library will be available when other modules need to resolve symbols; the default is @code{#f}, which keeps symbols local. =20 -If @var{rename-on-cygwin?} is true (the default) -- on Cygwin hosts only --- the search behavior is modified such that a filename that starts with +If @var{host-type-rename?} is true (the default) library names may be +modified based on the current @code{%host-type}. On Cygwin hosts, +the search behavior is modified such that a filename that starts with ``lib'' will be searched for under the name ``cyg'', as is customary for -Cygwin. +Cygwin. Similarly, for MSYS hosts, ``lib'' becomes ``msys-''. + +If @var{dll-version-suffix?} is true (the default), the search behavior +is modified such that when searching for a DLL, it will also search for +DLLs with version suffixes. For example, a search for +@file{libtiff.dll} will also allow @file{libtiff-1.dll}. When the +unversioned DLL is not found and multiple versioned DLLs exists, it will +return the versioned DLL with the highest version. Note that when +searching, directories take precedence. It does not return the highest +versioned DLL among all search directories collectively; it returns the +highest versioned in the first directory to have the DLL. + +If @var{library} argument is omitted, it defaults to @code{#f}. If +@code{library} is false, the resulting foreign library gives access to +all symbols available for dynamic linking in the currently running +executable. + @end deffn =20 The environment variables mentioned above are parsed when the @@ -206,6 +207,38 @@ Return @code{#t} if @var{obj} is a foreign library, or= @code{#f} otherwise. @end deffn =20 +Before Guile 3.0.6, Guile loaded foreign libraries using @code{libltdl}, +the dynamic library loader provided by libtool. This loader used +@env{LTDL_LIBRARY_PATH}, and for backwards compatibility we still +support that path. + +However, @code{libltdl} would not only open @code{.so} (or @code{.dll} +and so on) files, but also the @code{.la} files created by libtool. In +installed libraries -- libraries that are in the target directories of +@code{make install} -- @code{.la} files are never needed, to the extent +that most GNU/Linux distributions remove them entirely. It is +sufficient to just load the @code{.so} (or @code{.dll} and so on) files, +which are always located in the same directory as the @code{.la} files. + +But for uninstalled dynamic libraries, like those in a build tree, the +situation is a bit of a mess. If you have a project that uses libtool +to build libraries -- which is the case for Guile, and for most projects +using autotools -- and you build @file{foo.so} in directory @file{D}, +libtool will put @file{foo.la} in @file{D}, but @file{foo.so} gets put +into @file{D/.libs}. + +Users were mostly oblivious to this situation, as @code{libltdl} had +special logic to be able to read the @code{.la} file to know where to +find the @code{.so}, even from an uninstalled build tree, preventing the +existence of @file{.libs} from leaking out to the user. + +We don't use libltdl now, essentially for flexibility and +error-reporting reasons. But, to keep this old use-case working, if +@var{search-ltdl-library-path?} is true, we add each entry of +@code{LTDL_LIBRARY_PATH} to the default extensions load path, +additionally adding the @file{.libs} subdirextories for each entry, in +case there are @file{.so} files there instead of alongside the +@file{.la} files. =20 @node Foreign Extensions @subsection Foreign Extensions diff --git a/module/system/foreign-library.scm b/module/system/foreign-libr= ary.scm index dc426385f..d0de93a2d 100644 --- a/module/system/foreign-library.scm +++ b/module/system/foreign-library.scm @@ -26,11 +26,13 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-9) #:use-module (system foreign) + #:use-module ((ice-9 ftw) #:select (scandir)) + #:use-module ((srfi srfi-1) #:select (find)) #:export (guile-extensions-path ltdl-library-path guile-system-extensions-path =20 - lib->cyg + lib->cyg lib->msys load-foreign-library foreign-library? foreign-library-pointer @@ -64,24 +66,96 @@ (or (string-contains head ext) (has-extension? head exts))))) =20 -(define (file-exists-with-extension head exts) - (if (has-extension? head exts) +(define (is-integer-string? str) + (and + (not (string-null? str)) + (let ((n (string-length str))) + (let lp ((i 0)) + (let ((c (string-ref str i))) + (if (or (char? c #\9)) + #f + (if (=3D i (1- n)) + #t + (lp (1+ i))))))))) + +(define (dll-name-match? src tgt) + (let ((srclen (string-length src)) + (tgtlen (string-length tgt))) + (cond + ((or (< srclen tgtlen) + (< tgtlen 5) + (string-ci<> src ".dll" (- srclen 4)) + (string-ci<> tgt ".dll" (- tgtlen 4)) + (string-ci<> src tgt 0 (- tgtlen 4) 0 (- tgtlen 4))) + #f) + (else + (let ((mid (substring src (- tgtlen 4) (- srclen 4)))) + (cond + ((or (string-null? mid) + (and (char=3D? (string-ref mid 0) #\-) + (is-integer-string? (string-drop mid 1)))) + #t) + (else + #f))))))) + +(define (find-best-dll-from-matches dllname lst) + ;; A DLL name without a version suffix is preferred, + ;; like libfoo.dll. But if we must have a version + ;; suffix as in libfoo-5.dll, we want the largest one. + (define (ver>? a b) + (cond + ((> (string-length a) (string-length b)) + #t) + ((< (string-length a) (string-length b)) + #f) + (else + (string-ci>? a b)))) + + (cond + ((null? lst) + #f) + ((=3D (length lst) 1) + (car lst)) + (else + (or + (find (lambda (entry) (string-ci=3D entry dllname)) lst) + ;; The longest string that is alphabetically last + ;; is numerically the highest. + (car (sort lst ver>?)))))) + +(define (dll-exists-with-version head) + ;; Searches for a DLL given a filepath, allowing + ;; for DLLs with version suffixes. + (let* ((fname (if (has-extension? head '(".dll")) + head + (string-append head ".dll"))) + (dir (dirname fname)) + (base (basename fname))) + (let ((matches (scandir dir (lambda (f) (dll-name-match? f base))))) + (if (or (not matches) (null? matches)) + #f + (in-vicinity dir (find-best-dll-from-matches fname matches)))))) + +(define (file-exists-with-extension head extensions versioned-dlls?) + (if (has-extension? head extensions) (and (file-exists? head) head) - (let lp ((exts exts)) + (let lp ((exts extensions)) (match exts - (() #f) + (() (if (and versioned-dlls? (member ".dll" extensions)) + (dll-exists-with-version head) + #f)) ((ext . exts) (let ((head (string-append head ext))) (if (file-exists? head) head (lp exts)))))))) =20 -(define (file-exists-in-path-with-extension basename path exts) +(define (file-exists-in-path-with-extension basename path exts versioned-d= lls?) (match path (() #f) ((dir . path) - (or (file-exists-with-extension (in-vicinity dir basename) exts) - (file-exists-in-path-with-extension basename path exts))))) + (or (file-exists-with-extension (in-vicinity dir basename) exts versi= oned-dlls?) + (file-exists-in-path-with-extension basename path exts versioned-= dlls?))))) =20 (define path-separator (case (system-file-name-convention) @@ -107,9 +181,17 @@ (define guile-system-extensions-path (make-parameter (or (parse-path "GUILE_SYSTEM_EXTENSIONS_PATH") - (list (assq-ref %guile-build-info 'libdir) + (list (if (or (string-contains %host-type "cygwin") + (string-contains %host-type "mingw") + (string-contains %host-type "msys")) + (assq-ref %guile-build-info 'bindir) + (assq-ref %guile-build-info 'libdir)) (assq-ref %guile-build-info 'extensiondir))))) =20 +(define system-dll-path + (make-parameter + (or (parse-path "PATH") '()))) + ;; There are a few messy situations here related to libtool. ;; ;; Guile used to use libltdl, the dynamic library loader provided by @@ -145,6 +227,7 @@ (cons* dir (in-vicinity dir ".libs") (augment-ltdl-library-path path))))) =20 + (define (default-search-path search-ltdl-library-path?) (append (guile-extensions-path) @@ -172,13 +255,33 @@ name." (else name))))) =20 +(define (lib->msys name) + "Convert a standard shared library name to a MSYS shared library +name." + (if (not name) + #f + (let ((start (1+ (or (string-index-right + name + (lambda (c) (or (char=3D? #\\ c) (char=3D? #\/= c)))) + -1)))) + (cond + ((>=3D (+ 3 start) (string-length name)) + name) + ((string=3D name "lib" start (+ start 3)) + (string-append (substring name 0 start) + "msys-" + (substring name (+ start 3)))) + (else + name))))) + (define* (load-foreign-library #:optional filename #:key (extensions system-library-extensions) (search-ltdl-library-path? #t) (search-path (default-search-path search-ltdl-library-path?)) (search-system-paths? #t) - (lazy? #t) (global? #f) (rename-on-cygwin? = #t)) + (lazy? #t) (global? #f) (host-type-rename? = #t) + (allow-dll-version-suffix? #t)) (define (error-not-found) (scm-error 'misc-error "load-foreign-library" "file: ~S, message: ~S" @@ -187,9 +290,18 @@ name." (define flags (logior (if lazy? RTLD_LAZY RTLD_NOW) (if global? RTLD_GLOBAL RTLD_LOCAL))) - (define (dlopen* name) (dlopen name flags)) - (if (and rename-on-cygwin? (string-contains %host-type "cygwin")) + (define (dlopen* name) + (dlopen name flags)) + (define (file-exists-with-ext filename extensions) + (file-exists-with-extension filename extensions allow-dll-version-suff= ix?)) + (define (file-exists-in-path-with-ext filename search-path extensions) + (file-exists-in-path-with-extension + filename search-path extensions allow-dll-version-suffix?)) + (when host-type-rename? + (when (string-contains %host-type "cygwin") (set! filename (lib->cyg filename))) + (when (string-contains %host-type "msys") + (set! filename (lib->msys filename)))) (make-foreign-library filename (cond @@ -199,17 +311,26 @@ name." ((or (absolute-file-name? filename) (string-any file-name-separator? filename)) (cond - ((or (file-exists-with-extension filename extensions) + ((or (file-exists-with-ext filename extensions) (and search-ltdl-library-path? - (file-exists-with-extension + (file-exists-with-ext (in-vicinity (in-vicinity (dirname filename) ".libs") (basename filename)) extensions))) =3D> dlopen*) (else (error-not-found)))) - ((file-exists-in-path-with-extension filename search-path extensions) + ((file-exists-in-path-with-ext filename search-path extensions) =3D> dlopen*) + ((and search-system-paths? + (or (string-contains %host-type "cygwin") + (string-contains %host-type "mingw") + (string-contains %host-type "msys"))) + (let ((fullname (file-exists-in-path-with-ext filename (system-dll-pa= th) '(".dll")))) + (if fullname + (dlopen* fullname) + (error-not-found)))) + (search-system-paths? (if (or (null? extensions) (has-extension? filename extensions)) (dlopen* filename) diff --git a/test-suite/tests/foreign.test b/test-suite/tests/foreign.test index 28d7b5df8..2a6e0e26f 100644 --- a/test-suite/tests/foreign.test +++ b/test-suite/tests/foreign.test @@ -426,36 +426,104 @@ layout)))))) =20 -(with-test-prefix "lib->cyg" - (pass-if "name is #f" - (equal? #f (lib->cyg #f))) +(with-test-prefix "host-type-rename?" + (with-test-prefix "cyg" + (pass-if "name is #f" + (equal? #f (lib->cyg #f))) =20 - (pass-if "name too short" - (string=3D? (lib->cyg "a") "a")) + (pass-if "name too short" + (string=3D? (lib->cyg "a") "a")) =20 - (pass-if "name starts with 'lib'" - (string=3D? (lib->cyg "libfoo.dll") "cygfoo.dll")) + (pass-if "name starts with 'lib'" + (string=3D? (lib->cyg "libfoo.dll") "cygfoo.dll")) =20 - (pass-if "name contains 'lib'" - (string=3D? (lib->cyg "foolib.dll") "foolib.dll")) + (pass-if "name contains 'lib'" + (string=3D? (lib->cyg "foolib.dll") "foolib.dll")) =20 - (pass-if "name doesn't contain 'lib'" - (string=3D? (lib->cyg "foobar.dll") "foobar.dll")) + (pass-if "name doesn't contain 'lib'" + (string=3D? (lib->cyg "foobar.dll") "foobar.dll")) =20 - (pass-if "name in path too short" - (string=3D? (lib->cyg "/lib/a") "/lib/a")) + (pass-if "name in path too short" + (string=3D? (lib->cyg "/lib/a") "/lib/a")) =20 - (pass-if "name in path starts with 'lib'" - (string=3D? (lib->cyg "/lib/libfoo.dll") "/lib/cygfoo.dll")) + (pass-if "name in path starts with 'lib'" + (string=3D? (lib->cyg "/lib/libfoo.dll") "/lib/cygfoo.dll")) =20 - (pass-if "name in path contains 'lib'" - (string=3D? (lib->cyg "/lib/foolib.dll") "/lib/foolib.dll")) + (pass-if "name in path contains 'lib'" + (string=3D? (lib->cyg "/lib/foolib.dll") "/lib/foolib.dll")) =20 - (pass-if "name in path doesn't contain 'lib'" - (string=3D? (lib->cyg "/lib/foobar.dll") "/lib/foobar.dll")) + (pass-if "name in path doesn't contain 'lib'" + (string=3D? (lib->cyg "/lib/foobar.dll") "/lib/foobar.dll")) =20 - (pass-if "name in windows path starts with 'lib'" - (string=3D? (lib->cyg "c:\\lib\\libfoo.dll") "c:\\lib\\cygfoo.dll")) + (pass-if "name in windows path starts with 'lib'" + (string=3D? (lib->cyg "c:\\lib\\libfoo.dll") "c:\\lib\\cygfoo.dll")) =20 - (pass-if "name in windows path doesn't contain 'lib'" - (string=3D? (lib->cyg "c:\\lib\\foobar.dll") "c:\\lib\\foobar.dll"))) + (pass-if "name in windows path doesn't contain 'lib'" + (string=3D? (lib->cyg "c:\\lib\\foobar.dll") "c:\\lib\\foobar.dll"))) + + (with-test-prefix "msys" + + (pass-if "name is #f" + (equal? #f (lib->msys #f))) + + (pass-if "name too short" + (string=3D? (lib->msys "a") "a")) + + (pass-if "name starts with 'lib'" + (string=3D? (lib->msys "libfoo.dll") "msys-foo.dll")) + + (pass-if "name contains 'lib'" + (string=3D? (lib->msys "foolib.dll") "foolib.dll")) + + (pass-if "name doesn't contain 'lib'" + (string=3D? (lib->msys "foobar.dll") "foobar.dll")) + + (pass-if "name in path too short" + (string=3D? (lib->msys "/lib/a") "/lib/a")) + + (pass-if "name in path starts with 'lib'" + (string=3D? (lib->msys "/lib/libfoo.dll") "/lib/msys-foo.dll")) + + (pass-if "name in path contains 'lib'" + (string=3D? (lib->msys "/lib/foolib.dll") "/lib/foolib.dll")) + + (pass-if "name in path doesn't contain 'lib'" + (string=3D? (lib->msys "/lib/foobar.dll") "/lib/foobar.dll")) + + (pass-if "name in windows path starts with 'lib'" + (string=3D? (lib->msys "c:\\lib\\libfoo.dll") "c:\\lib\\msys-foo.dll= ")) + + (pass-if "name in windows path doesn't contain 'lib'" + (string=3D? (lib->msys "c:\\lib\\foobar.dll") "c:\\lib\\foobar.dll")= ))) + + + +(with-test-prefix "dll-name-match?" + (let ((dll-name-match? (@@ (system foreign-library) dll-name-match?))) + (pass-if "libfoo.dll =3D=3D libfoo.dll" + (dll-name-match? "libfoo.dll" "libfoo.dll")) + (pass-if "libfoo-1.dll =3D=3D libfoo.dll" + (dll-name-match? "libfoo-1.dll" "libfoo.dll")) + (pass-if "libfoo-10.dll =3D=3D libfoo.dll" + (dll-name-match? "libfoo-10.dll" "libfoo.dll")) + (pass-if "libfoo-.dll !=3D libfoo.dll" + (not (dll-name-match? "libfoo-.dll" "libfoo.dll"))) + (pass-if "libfoo-a.dll !=3D libfoo.dll" + (not (dll-name-match? "libfoo-a.dll" "libfoo.dll"))) + (pass-if "libfoo-1a.dll !=3D libfoo.dll" + (not (dll-name-match? "libfoo-a.dll" "libfoo.dll"))))) + +(with-test-prefix "find-best-dll-from-matches" + (let ((find-best? (@@ (system foreign-library) find-best-dll-from-matche= s))) + (pass-if-equal "prefer unversioned name" + "libfoo.dll" + (find-best? "libfoo.dll" '("libfoo.dll" "libfoo-1.dll"))) + (pass-if-equal "allow versioned name" + "libfoo-1.dll" + (find-best? "libfoo.dll" '("libfoo-1.dll"))) + (pass-if-equal "larger is better" + "libfoo-2.dll" + (find-best? "libfoo.dll" '("libfoo-1.dll" "libfoo-2.dll"))) + (pass-if-equal "multiple digits ok" + "libfoo-123.dll" + (find-best? "libfoo.dll" '("libfoo-1.dll" "libfoo-123.dll"))))) --=20 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 11:36:52 2023 Received: (at 64723) by debbugs.gnu.org; 7 Sep 2023 15:36:52 +0000 Received: from localhost ([127.0.0.1]:41056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeH3s-0005KL-8v for submit@debbugs.gnu.org; Thu, 07 Sep 2023 11:36:52 -0400 Received: from sonic310-14.consmr.mail.bf2.yahoo.com ([74.6.135.124]:42507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeH3n-0005K5-MS for 64723@debbugs.gnu.org; Thu, 07 Sep 2023 11:36:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1694100989; bh=/Pw3MqP4EhruiFsJqLHEQX2bZRuaZ6R6fhuXwb8L9QE=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=emaGhnJKYr0RGPtdzg4rO6TKm0AfxWEBPk83X4oCX2MRGXGvXGXyi6vV5p/8qpAICLOtuftgMey6wcvZyaLMsT4zhvO+Q8UsK0Dn6qrPUYLYRi0ZU+E9g6IR65aoYwIKHAyCHY5xnl2MsHEUF7XqphJAOa+Fw7OXY+RjbUjGg+yNk60tqWvHOeuMFy8ig+btwBn7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Z4muwLczOP9F IqRMkWqnwhQVn5D.oOB7PKHEGVasWCSXI_5HbC6K1Lr5AYWisIgdPXq1vRI.EGMyUokjdraJRmbU PW6wAxEV59YjykOFtSk3Prt6uvDbOMZv3lO3Ic4ve5gIk9QvdlcjHPQDdkEEAz1P85xBHV3VzN6T wlN9I752jHRuAp9cq1euegHZwSFo_NCAldfc8cOTHy2qV6a2kCXTLHuev8Zf2_NDrKQpS0PF5fOA b5jbSilzf3zzdizuWA3Ko3OTzilkg6d_22skVnX1cKeApWQC.0ZA9P0oiHk75ESYQhC3lTbtqWPs Og2uGhkYkNKo_CF.k79sX29Z6iMennZhFF169zvzBV8A.PN_CUwzd7WDpq6XLi.9Hg8rdojCvTIV ULKYmWR9GjMKkVJNxWxi4MNQy2qIcFyYpRgaQY5XHFPZxjO0f07so.k1u8ODsKYsiPdUX0VemIMp ZbtTGJlV8TJqaiCY4FFsSqj7rmkzwkQqZsgS.ZQbOldBqr8ONWhOfR05RbccAySiGvEnBN9f2.p9 pKGOS_iIzSs22RorGtHZrj1vAZVllio2iHNy_pfLkCFCV1IdVxTLE_5pykCZMtfw58dxH5CJnmAE umJK4nHPf0aCcPx5Qojx7.CM_AVrFeYPMBQAv73sg.NwRABf_4Ju_a6L3DLn7n.nCMLdq1MASWIu eyF7dj8dGXIMN7_fSKIMWhtKrxFoLACZgXwp459MPA6mKBnhWfzPQaQvfDi4YkyM4oVDadJwbZdj 0kRmGaMNeyUiqcyLdTV6pbaXaADTB X-Sonic-MF: X-Sonic-ID: 763f325e-a732-49c3-9c71-1578e3ffa1c6 Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.bf2.yahoo.com with HTTP; Thu, 7 Sep 2023 15:36:29 +0000 Date: Thu, 7 Sep 2023 15:33:55 +0000 (UTC) From: Mike Gran To: "64723@debbugs.gnu.org" <64723@debbugs.gnu.org> Message-ID: <1043899963.3392487.1694100835593@mail.yahoo.com> In-Reply-To: References: Subject: Re: [PATCH] Improve DLL search strategy for load-foreign-library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.21763 YMailNorrin Content-Length: 1219 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64723 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) > The new non-libltdl foreign library loading algorithm from 3.0.6 > fails to cover common cases regarding how libtool names and installs > DLL files.=C2=A0 Notably, it fails to recognize when libtool has added th= e > major version number into the filename itself, such as libfoo-1.dll > Also, it does not search in binary directories and the PATH for DLL > files, where libtool is likely to install DLLs. Hi All- This is the first of a dozen patches to make Win32 minimally viable again. This patch specifically removes a regression introduced in 3.0.6 described above. If I hear no objection, I'm going to rebase and push in a week or two. There are only a couple things in here to which one might find interesting (aka objectionable).=C2=A0 One is the renaming of the "#:rename= -on-cygwin? option of `load-foreign-library` to "#:host-type-rename?" to indicate that it handles both msys and cygwin libraries. The other is the code itself, which could be a lot shorter if I pulled in other modules. I'm never comfortable pulling in modules into other modules in Guile's core itself, for fear of creating spaghetti.=C2=A0 As a consequence= , some of the string handling is comically verbose. Regards, Mike Gran From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 09 01:45:15 2023 Received: (at submit) by debbugs.gnu.org; 9 Sep 2023 05:45:15 +0000 Received: from localhost ([127.0.0.1]:45920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeqmR-0007Fn-JC for submit@debbugs.gnu.org; Sat, 09 Sep 2023 01:45:15 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeqmQ-0007FY-QI for submit@debbugs.gnu.org; Sat, 09 Sep 2023 01:45:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeqm9-00044t-GD for bug-guile@gnu.org; Sat, 09 Sep 2023 01:44:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeqm8-00073U-HS; Sat, 09 Sep 2023 01:44:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=PMxJCGHom6HrwzuUr/BEsnIDTaix57QmsdgQfHLE8gM=; b=UjMqCUV65C5lZnqqbGZP p9lpk6lOVjJdDzotN0L3PYDJIfSUeyrpgXYlV0u/nRqhY6jMxV9ef1TyK/sCdV5knP+62k4I7b64W 30yqOzp+RstB0loIbU9MRRLeyb4oBQGvaEOkeRCOjwB2XJE9Spm1O5BAbOgGxLj8a6wfH36Cx8hzJ 7VgTro/AM967W7Or/O702QJlOLuVtC/8ugeQ1h728EFjdyrvfJNQE4H3jAYZW4ZpRXP71qwAK2g6q mkuGFF/sloBLx3oZgynojDYG+Ezy3Vcl9Fe5/sHyVqaZ5CBFzFRxZtsWDIwU+q5DU2IqMsOWe6BKR Du0pexJeoA75Cg==; From: Janneke Nieuwenhuizen To: Mike Gran via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" Subject: Re: bug#64723: [PATCH] Improve DLL search strategy for load-foreign-library Organization: AvatarAcademy.nl References: <1043899963.3392487.1694100835593@mail.yahoo.com> X-Url: http://AvatarAcademy.nl Date: Sat, 09 Sep 2023 07:44:46 +0200 In-Reply-To: <1043899963.3392487.1694100835593@mail.yahoo.com> (Mike Gran via's message of "Thu, 7 Sep 2023 15:33:55 +0000 (UTC)") Message-ID: <87wmwzq4s1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit Cc: "64723@debbugs.gnu.org" <64723@debbugs.gnu.org>, Mike Gran X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mike Gran via Bug reports for GUILE, GNU's Ubiquitous Extension Language wr= ites: Hello Mike, >> The new non-libltdl foreign library loading algorithm from 3.0.6 >> fails to cover common cases regarding how libtool names and installs >> DLL files.=C2=A0 Notably, it fails to recognize when libtool has added t= he >> major version number into the filename itself, such as libfoo-1.dll >> Also, it does not search in binary directories and the PATH for DLL >> files, where libtool is likely to install DLLs. > > Hi All- > > This is the first of a dozen patches to make Win32 minimally viable > again. This patch specifically removes a regression introduced in 3.0.6 > described above. > > If I hear no objection, I'm going to rebase and push > in a week or two. Very much appreciated! Greetings, Janneke --=20 Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade= my.com