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?Aleix_Conchillo_Flaqu=C3=A9?= Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] foreign-library: fix darwin detection Date: Wed, 1 Sep 2021 23:53:12 -0700 Message-ID: References: <20210902052755.9898-1-aconchillo@gmail.com> 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="7807"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Thu Sep 02 08:53:49 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 1mLgbd-0001sA-Db for guile-devel@m.gmane-mx.org; Thu, 02 Sep 2021 08:53:49 +0200 Original-Received: from localhost ([::1]:46700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLgbb-0004q8-Fs for guile-devel@m.gmane-mx.org; Thu, 02 Sep 2021 02:53:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLgbG-0004pv-Sm for guile-devel@gnu.org; Thu, 02 Sep 2021 02:53:27 -0400 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:42506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLgbF-0001he-D4 for guile-devel@gnu.org; Thu, 02 Sep 2021 02:53:26 -0400 Original-Received: by mail-pj1-x102f.google.com with SMTP id w19-20020a17090aaf9300b00191e6d10a19so764036pjq.1 for ; Wed, 01 Sep 2021 23:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=h7+5HqlbUhg2jBa+EenIdQ0tfUvDF/2dkvA0coz2tL4=; b=CksMkj4EugdkZznYmsKXNlKtbtfkdOxcbLTgI2UjhYblUMUJ0gLPZfZTyBdfXg/2lg rfwdeug9h+uoFMVwpCm3kr8RGyrzaLD9CV/bhg7h0mtStP+DjnrpqxoehUi4Z25R4GEk QcJ6RunqaMeYsWxqYHn2EjXdkVrWUVgvWWFBvSUTpLoy3Cishbebkm4WfPmFj/PhSbBR dFOHEjjvB09jhzFle1a3ixwXPg6sTozNC80dxTOgTL7C/mcalHLqKyo42Ue4YDZbrroN ZbuzVGeUMVU4Esa9vK4mQGezJVyFSN7Qbhsb+ivhc9gSQV+Omk/B+OgeCMnGtn3DgIdy 0Wzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=h7+5HqlbUhg2jBa+EenIdQ0tfUvDF/2dkvA0coz2tL4=; b=DSpN1MKFaavJyJ7zGHWMuJm2VH3qZ2C8ZeHeMHAoewahrUNrqZLbqs+sgLIbjeAoHW uveuvVbXIsfZ8xETPV+CP9MvCl4oCRdZm1ASHCqiX0/eLXEUICKVqFiX3KdVClhGeJpp MJSVZ7GYjCMClJE1ioA3HKK3IhLXUEgir3kRe/MoOtPjrtVy2NpiDtx7OhA+SvpyM8jQ qwYZn6OsDAoSy0eOfgDsLnmNNPaXsSNxi2uZtBLi+KptfR9geH6FMLdlFZXi4CnkaWFA tn/E10v5KADgLxiNDY/u3oob96ZcJpx2TCddroVzWYpqBSRZVranS8NRw1NGA7W4KUso xkaw== X-Gm-Message-State: AOAM533dEiZtp45upGrUfXSlCbwY+1DQx7yWwjqPUjHDFBJwHbVB6ute hX86gl5jMk/ahJAgdC9nnPSqqZmGw1H3DP3KMEatZPL6rzusJQ== X-Google-Smtp-Source: ABdhPJyKLB1jyMa/QRCN+O0VEhK/GmqDa+DPy4PrH6XOYGNuYyKQUdLx0lm3cAvZ0Qz/k30cmUOd7ZGtU54ROG45eUk= X-Received: by 2002:a17:902:7c15:b029:12c:78ec:bb61 with SMTP id x21-20020a1709027c15b029012c78ecbb61mr1645676pll.61.1630565603344; Wed, 01 Sep 2021 23:53:23 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=aconchillo@gmail.com; helo=mail-pj1-x102f.google.com 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, FREEMAIL_FROM=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:20834 Archived-At: And there are also more errors, for example in guile-gcrypt: dyld: lazy symbol binding failed: Symbol not found: __gcry_check_version Referenced from: /usr/local/lib/libgcrypt.dylib Expected in: flat namespace dyld: Symbol not found: __gcry_check_version Referenced from: /usr/local/lib/libgcrypt.dylib Expected in: flat namespace This is because it's trying to find the symbol __gcry_check_version but it doesn't take into account that in gcrypt symbols are prefixed with an underscore. I'm trying to understand why this is and how to fix it. Aleix On Wed, Sep 1, 2021 at 10:38 PM Aleix Conchillo Flaqu=C3=A9 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 #< filename: "/usr/local/lib/libgit2" handle: > #> > > On Wed, Sep 1, 2021 at 10:28 PM Aleix Conchillo Flaqu=C3=A9 > 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 > >