From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: lloda Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] foreign-library: fix darwin detection Date: Thu, 2 Sep 2021 09:22:37 +0200 Message-ID: <4ABFEBBF-1935-42A1-AFCA-ED6CA156DD3E@sarc.name> References: <20210902052755.9898-1-aconchillo@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_E03325F0-BF6A-4CBF-AAB3-B9EAF5696B25" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32017"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel To: =?utf-8?Q?Aleix_Conchillo_Flaqu=C3=A9?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Thu Sep 02 09:23:07 2021 Return-path: Envelope-to: guile-devel@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 1mLh3y-0008CC-VA for guile-devel@m.gmane-mx.org; Thu, 02 Sep 2021 09:23:07 +0200 Original-Received: from localhost ([::1]:35006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLh3x-0002iq-1j for guile-devel@m.gmane-mx.org; Thu, 02 Sep 2021 03:23:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLh3j-0002iL-DP for guile-devel@gnu.org; Thu, 02 Sep 2021 03:22:51 -0400 Original-Received: from mta-12-4.privateemail.com ([198.54.127.107]:23594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLh3h-0000pM-B5 for guile-devel@gnu.org; Thu, 02 Sep 2021 03:22:51 -0400 Original-Received: from mta-12.privateemail.com (localhost [127.0.0.1]) by mta-12.privateemail.com (Postfix) with ESMTP id DD90A18001A3; Thu, 2 Sep 2021 03:22:40 -0400 (EDT) Original-Received: from [192.168.1.105] (unknown [10.20.151.219]) by mta-12.privateemail.com (Postfix) with ESMTPA id 0D9AD18001A0; Thu, 2 Sep 2021 03:22:39 -0400 (EDT) In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Virus-Scanned: ClamAV using ClamSMTP Received-SPF: pass client-ip=198.54.127.107; envelope-from=lloda@sarc.name; helo=MTA-12-4.privateemail.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20835 Archived-At: --Apple-Mail=_E03325F0-BF6A-4CBF-AAB3-B9EAF5696B25 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Patch is applied in 1f100a4f20c3a6e57922fb26fce212997e2a03cb, thanks. However I cannot build Guile on macos at the moment bc of an error in = lib/basename-lgpl.h, this seems caused by the last gnulib update :-\ > On 2 Sep 2021, at 07:38, Aleix Conchillo Flaqu=C3=A9 = wrote: >=20 > Without this change dynamic libraries in macOS are not loaded > properly. This has happened since 3.0.6. >=20 > scheme@(guile-user)> %host-type > $1 =3D "x86_64-apple-darwin20.5.0" >=20 > -------------------------------- >=20 > scheme@(guile-user)> (use-modules (git)) > While compiling expression: > In procedure git_libgit2_init: Function not implemented >=20 > -------------------------------- >=20 > scheme@(guile-user)> (use-modules (system foreign)) > scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2") > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > In procedure load-foreign-library: file: "/usr/local/lib/libgit2", > message: "file not found" >=20 > Entering a new prompt. Type `,bt' for a backtrace or `,q' to = continue. > scheme@(guile-user) [1]> >=20 > -------------------------------- >=20 > After this fix: >=20 > scheme@(guile-user)> (use-modules (system foreign)) > scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2") > $2 =3D #< filename: "/usr/local/lib/libgit2" handle: > #> >=20 > On Wed, Sep 1, 2021 at 10:28 PM Aleix Conchillo Flaqu=C3=A9 > wrote: >>=20 >> * module/system/foreign-library.scm (system-library-extensions): fix >> darwin host detection. darwin host types have "-darwin" but not >> "-darwin-". >> --- >> module/system/foreign-library.scm | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> diff --git a/module/system/foreign-library.scm = b/module/system/foreign-library.scm >> index d53e293ef..dc426385f 100644 >> --- a/module/system/foreign-library.scm >> +++ b/module/system/foreign-library.scm >> @@ -48,7 +48,7 @@ >>=20 >> (define system-library-extensions >> (cond >> - ((string-contains %host-type "-darwin-") >> + ((string-contains %host-type "-darwin") >> '(".bundle" ".so" ".dylib")) >> ((or (string-contains %host-type "cygwin") >> (string-contains %host-type "mingw") >> -- >> 2.33.0 >>=20 >=20 --Apple-Mail=_E03325F0-BF6A-4CBF-AAB3-B9EAF5696B25 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Patch is applied in 1f100a4f20c3a6e57922fb26fce212997e2a03cb, = thanks.

However I cannot build = Guile on macos at the moment bc of an error in lib/basename-lgpl.h, this = seems caused by the last gnulib update :-\


On 2 Sep = 2021, at 07:38, Aleix Conchillo Flaqu=C3=A9 <aconchillo@gmail.com> wrote:

Without this change dynamic libraries in macOS are not = loaded
properly. This has happened since 3.0.6.

scheme@(guile-user)> %host-type
$1 =3D "x86_64-apple-darwin20.5.0"

--------------------------------

scheme@(guile-user)> (use-modules (git))
While= compiling expression:
In procedure git_libgit2_init: = Function not implemented

--------------------------------

scheme@(guile-user)> (use-modules (system foreign))
scheme@(guile-user)> (dynamic-link = "/usr/local/lib/libgit2")
ice-9/boot-9.scm:1685:16: In = procedure raise-exception:
In procedure = load-foreign-library: file: "/usr/local/lib/libgit2",
message: "file not found"

Entering= a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>

--------------------------------

After this fix:

scheme@(guile-user)> (use-modules (system foreign))
scheme@(guile-user)> (dynamic-link = "/usr/local/lib/libgit2")
$2 =3D = #<<foreign-library> filename: "/usr/local/lib/libgit2" = handle:
#<pointer 0x7ffed3104ac0>>

On Wed, Sep 1, 2021 at 10:28 PM Aleix = Conchillo Flaqu=C3=A9
<aconchillo@gmail.com> wrote:

* = module/system/foreign-library.scm (system-library-extensions): fix
darwin host detection. darwin host types have "-darwin" but = not
"-darwin-".
---
= module/system/foreign-library.scm | 2 +-
1 file changed, = 1 insertion(+), 1 deletion(-)

diff --git = a/module/system/foreign-library.scm = b/module/system/foreign-library.scm
index = d53e293ef..dc426385f 100644
--- = a/module/system/foreign-library.scm
+++ = b/module/system/foreign-library.scm
@@ -48,7 +48,7 @@

(define system-library-extensions
  (cond
- =   ((string-contains %host-type "-darwin-")
+ =   ((string-contains %host-type "-darwin")
=     '(".bundle" ".so" ".dylib"))
=    ((or (string-contains %host-type "cygwin")
=         (string-contains = %host-type "mingw")
--
2.33.0



= --Apple-Mail=_E03325F0-BF6A-4CBF-AAB3-B9EAF5696B25--