GNU bug report logs - #74532
with-extensions does not add native extensions to the load path

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Tomas Volf <~@wolfsden.cz>; dated Mon, 25 Nov 2024 17:51:01 UTC; Maintainer for guix is bug-guix@HIDDEN.
Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 74532-done <at> debbugs.gnu.org:


Received: (at 74532-done) by debbugs.gnu.org; 1 Apr 2025 07:49:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 01 03:49:38 2025
Received: from localhost ([127.0.0.1]:44962 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzWNO-0005Dy-IV
	for submit <at> debbugs.gnu.org; Tue, 01 Apr 2025 03:49:38 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:60392)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1tzWNL-0005Dc-0O
 for 74532-done <at> debbugs.gnu.org; Tue, 01 Apr 2025 03:49:35 -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 <ludo@HIDDEN>)
 id 1tzWNB-00033l-0A; Tue, 01 Apr 2025 03:49:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=wN1C1zlm4oLeMXgiztgKoMLJ6/t1vtgyyNPLhpbhsUE=; b=T9lktM+o+53AooZCuPDF
 /9w0TyNmMKTNB8afT9/7DQ577sq0o8yelm27KDUHIKC44OteSwDWP/5QOWTFAcnIQW9Yib/VljS9Z
 +Z9TE/2Ln3yaqG/qIpt33XiBGf330K3rAUSmJnnBhB3MVXwMjvBZ7/1oMEO8fnq59cZe81PO/eXWK
 QpF1uo7ocVyCY64mPKxRv7V0YTFsd1pl/3/vPbVpbl+L3KNME/xcck8+YB1X5yfl55ZgUzeEqEjFZ
 +8Isb1mUrz1/glONbCzSd2DC9pZwywlVh2UEP2olaYisHFNugkAqpJ+FNMUyD09hFQt3K7/zQ69xk
 rlM+fclwyZSg9g==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Timo Wilken <guix@HIDDEN>
Subject: Re: bug#74532: with-extensions does not add native extensions to
 the load path
In-Reply-To: <20250325182142.8645-5-guix@HIDDEN> (Timo Wilken's message
 of "Tue, 25 Mar 2025 19:12:53 +0100")
References: <87frj1mne5.fsf@HIDDEN> <875xk9vyhq.fsf@HIDDEN>
 <20250325182142.8645-1-guix@HIDDEN>
 <20250325182142.8645-5-guix@HIDDEN>
Date: Tue, 01 Apr 2025 09:49:15 +0200
Message-ID: <87ldskgw3o.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74532-done
Cc: Tomas Volf <~@wolfsden.cz>, Z572 <zhengjunjie@HIDDEN>,
 74532-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Timo Wilken <guix@HIDDEN> skribis:

> * gnu/packages/guile-xyz.scm (guile-yamlpp) [arguments] <phases>:
>   Add 'set-extension-file-name and move 'check after 'install.
>
> Change-Id: I49a7199b4e0fe4053822374bae59c6e1d0b7ead0

Applied, thanks!




Notification sent to Tomas Volf <~@wolfsden.cz>:
bug acknowledged by developer. Full text available.
Reply sent to Ludovic Courtès <ludo@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 25 Mar 2025 18:24:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 25 14:24:01 2025
Received: from localhost ([127.0.0.1]:39962 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tx8wT-0002Sq-Ce
	for submit <at> debbugs.gnu.org; Tue, 25 Mar 2025 14:24:01 -0400
Received: from mx1.mythic-beasts.com ([2a00:1098:0:86:1000:0:2:1]:53515)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <guix@HIDDEN>) id 1tx8wQ-0002Sc-Km
 for 74532 <at> debbugs.gnu.org; Tue, 25 Mar 2025 14:23:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=twilken.net
 ; s=mythic-beasts-k1; h=Date:Subject:To:From;
 bh=j6uP3xRetfp3EJMuoMP5Bfhhj1p8un3uD2p4AIgew+s=; b=cH0Ny8HCABqtTGd1/ffyv0+YTD
 Ci16QFo5bAQgIMX+LqqMXPkKqqgJUzOnsdaOSAxP2swPYHuP33ZNf+osNHcdrXSNwX+Z4AE2AXw4j
 NWqmOqDfQYrZ6kpvpWl5jcxZm7FE1ezCoe5QlvgBP3ph6TfnrHUc9iIU8geQmXhYYxvxyQ44ZyqYw
 DBCa9XlhntRQp3Jndq4FXZ0vdqNjT+LMHoN6ATNBdWTD0zX+Z46yZ0Hymse2vmVUTMouUNQJM2gEL
 iMibfLcIvc/h76qc0vtCKjQAuR+BrvvwTWy3/NyviFgmRfommLcp39f91BjJ3Ryg+4MvLYcuWz3zw
 oy/dclSQ==;
Received: by mailhub-cam-d.mythic-beasts.com with esmtpa (Exim 4.94.2)
 (envelope-from <guix@HIDDEN>)
 id 1tx8wJ-00DUc2-RE; Tue, 25 Mar 2025 18:23:52 +0000
From: Timo Wilken <guix@HIDDEN>
To: Tomas Volf <~@wolfsden.cz>,
 =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
Subject: [PATCH v2] gnu: guile-yamlpp: Allow usage with `with-extensions'
Date: Tue, 25 Mar 2025 19:12:53 +0100
Message-ID: <20250325182142.8645-5-guix@HIDDEN>
X-Mailer: git-send-email 2.49.0
In-Reply-To: <20250325182142.8645-1-guix@HIDDEN>
References: <87frj1mne5.fsf@HIDDEN> <875xk9vyhq.fsf@HIDDEN>
 <20250325182142.8645-1-guix@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Tomas Volf <~@wolfsden.cz>, Ludovic Courtès <ludo@HIDDEN>, Z572 <zhengjunjie@HIDDEN>, Timo Wilken <guix@HIDDEN>
Content-Transfer-Encoding: 8bit
X-BlackCat-Spam-Score: 49
X-Spam-Status: No, score=4.9
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74532
Cc: Z572 <zhengjunjie@HIDDEN>, 74532 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/guile-xyz.scm (guile-yamlpp) [arguments] <phases>:
  Add 'set-extension-file-name and move 'check after 'install.

Change-Id: I49a7199b4e0fe4053822374bae59c6e1d0b7ead0
---
 gnu/packages/guile-xyz.scm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index f0277f430ec..cabc3101320 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -2020,6 +2020,23 @@ (define-public guile-yamlpp
        (sha256
         (base32 "0ik69y0vddg0myp0zdbkmklma0qkkrqzwlqwkij1zirklz6hl1ss"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       ,#~(modify-phases %standard-phases
+            ;; In order to let Guile find the compiled library when used with
+            ;; Guix' `with-extension', hardcode the final path to the library.
+            ;; See <https://issues.guix.gnu.org/74532>.
+            (add-after 'unpack 'set-extension-file-name
+              (lambda* (#:key outputs #:allow-other-keys)
+                (substitute* "scm/yamlpp.scm"
+                  (("\\(load-extension \"libguile-yamlpp\"(.*)\\)" _ init)
+                   (format #f "(load-extension \"~a/lib/guile/3.0/libguile-yamlpp\"~a)"
+                           (assoc-ref outputs "out") init)))))
+            ;; Move 'check after installation, so that the foreign library is
+            ;; present where we expect it (as we hardcode its path above).
+            (delete 'check)
+            (add-after 'install 'check
+              (assoc-ref %standard-phases 'check)))))
     (native-inputs (list autoconf automake libtool pkg-config))
     (inputs (list guile-3.0 yaml-cpp))
     (native-search-paths
-- 
2.49.0





Information forwarded to ~@wolfsden.cz, ludo@HIDDEN, zhengjunjie@HIDDEN, guix@HIDDEN, bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 25 Mar 2025 18:22:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 25 14:22:46 2025
Received: from localhost ([127.0.0.1]:39953 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tx8vG-0002QC-34
	for submit <at> debbugs.gnu.org; Tue, 25 Mar 2025 14:22:46 -0400
Received: from mx1.mythic-beasts.com ([2a00:1098:0:86:1000:0:2:1]:53585)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <guix@HIDDEN>) id 1tx8vD-0002Pu-CP
 for 74532 <at> debbugs.gnu.org; Tue, 25 Mar 2025 14:22:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=twilken.net
 ; s=mythic-beasts-k1; h=Date:Subject:To:From;
 bh=vf2lXC9DvDPFzeZExGrqWoRi+7UogT33i+xFThePPyI=; b=SSiMZQsnV4grtgEVbi9KyHOimF
 768DHlFufXkh//p41osvatNu8dWC4foM9ItUbpYCDVi7INJwHcEb/MeCJGO6/jwCDNkAoOAJAOO9J
 QLvW18KgCBvZjst2N2Bvr4KCvFFiJ7UQCpil0RLuI1dWzGZBV5sBYoUWVxWxLBcf8mxAUIwjY13EA
 5Gl/YGEPjEyWguxrUu4MxY1pp79TNLaYqL3WmoYy7mAqKfb2QZUfBceHW2HLIALhq5AVp1N/x8In5
 LYgAo4vCmwNuOFvKdFwEN30Ja0zBERlCdg8+veqvUpXMjJOjOjx6Gnrl37CsC255188boKmQX+2Ke
 HECRgvyg==;
Received: by mailhub-cam-d.mythic-beasts.com with esmtpa (Exim 4.94.2)
 (envelope-from <guix@HIDDEN>)
 id 1tx8v6-00DUc2-AJ; Tue, 25 Mar 2025 18:22:36 +0000
From: Timo Wilken <guix@HIDDEN>
To: Tomas Volf <~@wolfsden.cz>,
 =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#74532: [PATCH] gnu: guile-yamlpp: Allow usage with
 `with-extensions'
Date: Tue, 25 Mar 2025 19:12:49 +0100
Message-ID: <20250325182142.8645-1-guix@HIDDEN>
X-Mailer: git-send-email 2.49.0
In-Reply-To: <87frj1mne5.fsf@HIDDEN> <875xk9vyhq.fsf@HIDDEN>
References: <87frj1mne5.fsf@HIDDEN> <875xk9vyhq.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: Tomas Volf <~@wolfsden.cz>, Ludovic Courtès <ludo@HIDDEN>, Z572 <zhengjunjie@HIDDEN>, Timo Wilken <guix@HIDDEN>
Content-Transfer-Encoding: 8bit
X-BlackCat-Spam-Score: 9
X-Spam-Status: No, score=0.9
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74532
Cc: Z572 <zhengjunjie@HIDDEN>, 74532 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Tomas, hi Ludo', hi Z572,

On Tue 25 Mar 2025 at 11:10 am CET, Ludovic Courtès wrote:
> Tomas Volf <~@wolfsden.cz> skribis:
>> Timo Wilken <guix@HIDDEN> writes:
>> I am not sure it is optimal to hide *all* errors from load-extension.
>> Maybe check if file exists and then try to load-extension it without the
>> false-if-exception?

I think the v2 patch makes this moot -- see below.

> Or just unconditionally load from the absolute file name?  I don’t see
> what the ‘or’ buys us.

That only works if I move 'check after 'install -- else it fails with an error
in `load-foreign-library', saying the file doesn't exist.

The v2 patch does that, and works for me (as in, it compiles and I can use the
resulting package in `with-extensions').

Feedback is very welcome!

Cheers,
Timo




Information forwarded to ~@wolfsden.cz, ludo@HIDDEN, zhengjunjie@HIDDEN, guix@HIDDEN, bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 25 Mar 2025 10:10:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 25 06:10:38 2025
Received: from localhost ([127.0.0.1]:36358 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tx1F0-00040u-2U
	for submit <at> debbugs.gnu.org; Tue, 25 Mar 2025 06:10:38 -0400
Received: from hera.aquilenet.fr ([185.233.100.1]:41414)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1tx1Ew-00040e-Td
 for 74532 <at> debbugs.gnu.org; Tue, 25 Mar 2025 06:10:35 -0400
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 3D6A0373;
 Tue, 25 Mar 2025 11:10:28 +0100 (CET)
Authentication-Results: hera.aquilenet.fr;
	none
X-Virus-Scanned: Debian amavis at hera.aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP
 id GuA60N8bUVa9; Tue, 25 Mar 2025 11:10:27 +0100 (CET)
Received: from ribbon (unknown [193.50.110.142])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 2E7D6657;
 Tue, 25 Mar 2025 11:10:27 +0100 (CET)
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Tomas Volf <~@wolfsden.cz>
Subject: Re: bug#74532: [PATCH] gnu: guile-yamlpp: Allow usage with
 `with-extensions'
In-Reply-To: <875xk9vyhq.fsf@HIDDEN> (Tomas Volf's message of "Sun, 16
 Mar 2025 15:30:57 +0100")
References: <871pyzdwzi.fsf@HIDDEN>
 <20250315211008.8563-3-guix@HIDDEN> <875xk9vyhq.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Quintidi 5 Germinal an 233 de la =?utf-8?Q?R=C3=A9vo?=
 =?utf-8?Q?lution=2C?= jour de la Poule
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 25 Mar 2025 11:10:26 +0100
Message-ID: <87frj1mne5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Rspamd-Queue-Id: 3D6A0373
X-Spamd-Result: default: False [4.89 / 15.00]; SPAM_FLAG(5.00)[];
 BAYES_HAM(-3.00)[99.99%]; NEURAL_SPAM(2.99)[0.998];
 MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+];
 RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[];
 ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
 TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[];
 RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[];
 RCPT_COUNT_THREE(0.00)[4]; MID_RHS_MATCH_FROM(0.00)[]
X-Spam-Level: ****
X-Rspamd-Action: no action
X-Spamd-Bar: ++++
X-Rspamd-Server: hera
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 74532
Cc: Z572 <zhengjunjie@HIDDEN>, 74532 <at> debbugs.gnu.org,
 Timo Wilken <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi,

Tomas Volf <~@wolfsden.cz> skribis:

> Timo Wilken <guix@HIDDEN> writes:

[...]

>> +                   (format #f "(or (false-if-exception (load-extension =
\"~a/lib/guile/3.0/libguile-yamlpp\"~a)) ~a)"
>> +                           (assoc-ref outputs "out") init all))))))))
>
> I am not sure it is optimal to hide *all* errors from load-extension.
> Maybe check if file exists and then try to load-extension it without the
> false-if-exception?

Or just unconditionally load from the absolute file name?  I don=E2=80=99t =
see
what the =E2=80=98or=E2=80=99 buys us.

Thanks,
Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 16 Mar 2025 14:31:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 16 10:31:45 2025
Received: from localhost ([127.0.0.1]:50246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ttp1k-0007Cj-72
	for submit <at> debbugs.gnu.org; Sun, 16 Mar 2025 10:31:45 -0400
Received: from wolfsden.cz ([37.205.8.62]:51924)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1ttp1g-00078H-An
 for 74532 <at> debbugs.gnu.org; Sun, 16 Mar 2025 10:31:41 -0400
Received: by wolfsden.cz (Postfix, from userid 104)
 id 3A44E37A38F; Sun, 16 Mar 2025 14:31:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1742135499; bh=s4g+1eFkWM6lH3T9DLUde1vlk+SXg4IQO34tfFAxzyY=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=wiVlyGRrPSyEER29TDQBLLwUk/gobPADq6F4ZUozhNM5nm7drO+SMpzLoLnOuxx4/
 WiSUGuWCvERQHVcjM5HsJi/wjl1GnuACS+tgQ+/letXEUdhEXHT5/Hk4JoRNw5vnfE
 yHoHlL+1uqdYKlQEJqp9qLDCQA+57vyRAwJ2UWgnO24Q9ipzJoLtqAx1gdLXo63EPH
 Xnqyb33nC8ZsJnrmBK5xcC4S9mUaNv9XyM0hExtJDJ0QxhddBI95gUVWYtKMQIluDS
 a3ofIoDD8mgiUes5MRlxBi+3jqxHH2KZWLgaIbsUHTXqSr/LyW7hZNOuWrTFacQms0
 gloq4xxEPcfXPAwMtzVJ59GzsHM8J3WTzjccBpbfx9DPmebw8ubcSNMzZf71jx10Gc
 N/r+szxe9pa7hdbQB+MgYF58CW80FLTcwvaZHt3BXwRrCIxP9p1K/UfGQ1+ORU8zJp
 7X0E9moGeu0kd2zTy6rRRMns5wLLD9BqMGhGd9/Yckw/43gZbyKwh6RAALQV7D4cP+
 nVIbVzPGr4UssM2/Dn1itBVOSDWwB549vdlKvVDYTmb0Kipj7C3j1xL5OrNl9OkHT3
 unQ0W0Pfq3t77vp2ZyBVhCFuUdBzj/KOFR4Vscd4rAW8tHmCSLFu/0D9KUNfjR7Vvq
 UCsvWj0DxeWK58xVRDM/Bpdk=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED
 autolearn=unavailable autolearn_force=no version=3.4.6
Received: from localhost (unknown [128.0.188.242])
 by wolfsden.cz (Postfix) with ESMTPSA id BC562379BAE;
 Sun, 16 Mar 2025 14:31:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1742135498; bh=s4g+1eFkWM6lH3T9DLUde1vlk+SXg4IQO34tfFAxzyY=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=GRhVR/7rDU93O2RLDBf3jPRTFQxCo5L16nK7IzXI5QdpU8jMo3Tqsk2nixgF/oPHB
 6TU4dlpszWOFMinp9uuLAF2NLxTzZ7nmup6hT83qDxGMV1fmRkDM6bIPbyVLF/S7Xw
 X8LTIo846Me48Fm610vVhFG+RuOy3jUjFYvn5bTZ0ELw3MKZi86exGbdSYUCGtsHF4
 4FAuRZsW9uNyJfH4wfTMWYgD8OY35kV1QHOxe2u9SHltlxXz/4Ob9xknyl8HKJxUy0
 f14VMM62fCJhXmTIcvm0b7qYhsvKhpEsFc42bo5bSX2cPQRvHzA/kN3nZYKyk30adm
 iag9FlHtM1FEVtSVEHchBM0ET6kw9lc5pwwt9NTut9DXEd0sRKPLS2Jm/2iWZEQ/Wt
 /46vkGkMJV9uNhmAO7Ga0HGM/rHDZLq/ufajXm78f4KbGgGl+SMADNx4mXqL+tXoIK
 VTEBci+4H856yTb2fHAqsmiFHUd/caGiujayt7RDzJANVZ9xLPNsd+nb3hwGmZEm5v
 nTASZ3DC6ZTpfj+Hlc9AMEjSEup/NPzTnr473Yovm29SrIwpQIFsgPBuWS5VB6dvLu
 I2XzNsjlBksqpeJnE32pt5Wvp0kUrRBTyPozlSQKD7Za5XOJKNcmbMS8c3AXU4S/88
 FbTW/zIpi8hTbCKUpXP/oYPU=
From: Tomas Volf <~@wolfsden.cz>
To: "Timo Wilken" <guix@HIDDEN>
Subject: Re: with-extensions does not add native extensions to the load path
In-Reply-To: <D8H58BCN9SEV.T8XB1KHBJZSR@HIDDEN> (Timo Wilken's message of
 "Sat, 15 Mar 2025 22:04:53 +0100")
References: <D8H58BCN9SEV.T8XB1KHBJZSR@HIDDEN>
Date: Sun, 16 Mar 2025 15:31:38 +0100
Message-ID: <871puxvygl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74532
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Z572 <zhengjunjie@HIDDEN>, 74532 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"Timo Wilken" <guix@HIDDEN> writes:

> It still feels wrong to do this on a per-package basis (shouldn't
> `with-extension' take care of setting up the path?), but hey ho.

I definitely agree here...

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.




Information forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 16 Mar 2025 14:31:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 16 10:31:11 2025
Received: from localhost ([127.0.0.1]:50241 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ttp1C-0006p6-KP
	for submit <at> debbugs.gnu.org; Sun, 16 Mar 2025 10:31:11 -0400
Received: from wolfsden.cz ([37.205.8.62]:45978)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1ttp12-0006fI-5F
 for 74532 <at> debbugs.gnu.org; Sun, 16 Mar 2025 10:31:06 -0400
Received: by wolfsden.cz (Postfix, from userid 104)
 id E0D7A37A28D; Sun, 16 Mar 2025 14:30:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1742135457; bh=8UAD04oJzyca5fc878TcY7vBwtJmyXAs5rQR7s4+T5I=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=T5gtUpP2DJsL5gKdpd0c0MyS5lQjsTdZJH4v7foQnJ+HlBHoC1EOFkKBe38eAy5bm
 5QnyOLkVGRNtXxONHLrXL6I6VklToRpicZrX0SPV11/7B7nPP8t3Dj1nAgDLpAXeRo
 FUmZSNSE+iHbrm2wJgfslvS0FecbdcAbSA9LsrFiQZAYg+rsEZkbLRGgv5/eZob+iZ
 ZYYR1th5/WYQYXouONOxOzAFbD2Y7322fxiw3ZH0tIhnbCvn+W8PIF3jPuzqm/d8H7
 JdFiVJSS2PwRfK8mNFYOOBnMMTpk3e49FkGIqYi1w0TGKMOMvQaRfrNpibSqNMRhEL
 tWk2JeRnhcR9vTUoVo00dGqdhiZ6GgzkOxDtvucUA5yeOFVNSrB/hPvfnaOJomD4dj
 HXzf60EVqRO+3cqieLzWau3WAGsgHmGSW1ytdlupTQVPi1s7ySW6J1LM/V2yrUxb3p
 jOFgJlmPER2B7wOUQLBUiSCto0xGpOJuv6roG0e3XZhRf6UfCiQRSir31+bLUSKl6w
 Y2L0v3a2HP6zh42aO4ZY+oYMGPYKBLzgQ+LQgdYLKVqhRSEdWUSy4dkj5Crsvx2sHV
 YwTRu9+95t1ov98b6kRNtkwy5dGgGtKDwaNyndrLB0fSOfdvjUPWqVOyyF3cifCtDz
 YJ52QNU+2cBuYSqo9QjfYwn0=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED
 autolearn=ham autolearn_force=no version=3.4.6
Received: from localhost (unknown [128.0.188.242])
 by wolfsden.cz (Postfix) with ESMTPSA id 7C5A837A90B;
 Sun, 16 Mar 2025 14:30:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1742135457; bh=8UAD04oJzyca5fc878TcY7vBwtJmyXAs5rQR7s4+T5I=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=T5gtUpP2DJsL5gKdpd0c0MyS5lQjsTdZJH4v7foQnJ+HlBHoC1EOFkKBe38eAy5bm
 5QnyOLkVGRNtXxONHLrXL6I6VklToRpicZrX0SPV11/7B7nPP8t3Dj1nAgDLpAXeRo
 FUmZSNSE+iHbrm2wJgfslvS0FecbdcAbSA9LsrFiQZAYg+rsEZkbLRGgv5/eZob+iZ
 ZYYR1th5/WYQYXouONOxOzAFbD2Y7322fxiw3ZH0tIhnbCvn+W8PIF3jPuzqm/d8H7
 JdFiVJSS2PwRfK8mNFYOOBnMMTpk3e49FkGIqYi1w0TGKMOMvQaRfrNpibSqNMRhEL
 tWk2JeRnhcR9vTUoVo00dGqdhiZ6GgzkOxDtvucUA5yeOFVNSrB/hPvfnaOJomD4dj
 HXzf60EVqRO+3cqieLzWau3WAGsgHmGSW1ytdlupTQVPi1s7ySW6J1LM/V2yrUxb3p
 jOFgJlmPER2B7wOUQLBUiSCto0xGpOJuv6roG0e3XZhRf6UfCiQRSir31+bLUSKl6w
 Y2L0v3a2HP6zh42aO4ZY+oYMGPYKBLzgQ+LQgdYLKVqhRSEdWUSy4dkj5Crsvx2sHV
 YwTRu9+95t1ov98b6kRNtkwy5dGgGtKDwaNyndrLB0fSOfdvjUPWqVOyyF3cifCtDz
 YJ52QNU+2cBuYSqo9QjfYwn0=
From: Tomas Volf <~@wolfsden.cz>
To: Timo Wilken <guix@HIDDEN>
Subject: Re: bug#74532: [PATCH] gnu: guile-yamlpp: Allow usage with
 `with-extensions'
In-Reply-To: <20250315211008.8563-3-guix@HIDDEN> (Timo Wilken's message
 of "Sat, 15 Mar 2025 22:10:09 +0100")
References: <871pyzdwzi.fsf@HIDDEN>
 <20250315211008.8563-3-guix@HIDDEN>
Date: Sun, 16 Mar 2025 15:30:57 +0100
Message-ID: <875xk9vyhq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74532
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Z572 <zhengjunjie@HIDDEN>, 74532 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi!

Timo Wilken <guix@HIDDEN> writes:

> * gnu/packages/guile-xyz.scm (guile-yamlpp) [arguments] <phases>:
>   Add 'set-extension-file-name.
>
> Change-Id: I49a7199b4e0fe4053822374bae59c6e1d0b7ead0
> ---
>  gnu/packages/guile-xyz.scm | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
> index 30c8e847996..f43e06a3a7f 100644
> --- a/gnu/packages/guile-xyz.scm
> +++ b/gnu/packages/guile-xyz.scm
> @@ -1997,6 +1997,19 @@ (define-public guile-yamlpp
>         (sha256
>          (base32 "0ik69y0vddg0myp0zdbkmklma0qkkrqzwlqwkij1zirklz6hl1ss"))=
))
>      (build-system gnu-build-system)
> +    (arguments
> +     `(#:phases
> +       ,#~(modify-phases %standard-phases
> +            ;; In order to let Guile find the compiled library when used=
 with
> +            ;; Guix' `with-extension', hardcode the final path to the li=
brary.
> +            ;; The fallback is needed for tests (i.e. before the 'instal=
l phase).
> +            ;; See <https://issues.guix.gnu.org/74532>.
> +            (add-after 'unpack 'set-extension-file-name
> +              (lambda* (#:key outputs #:allow-other-keys)
> +                (substitute* "scm/yamlpp.scm"
> +                  (("\\(load-extension \"libguile-yamlpp\"(.*)\\)" all i=
nit)
> +                   (format #f "(or (false-if-exception (load-extension \=
"~a/lib/guile/3.0/libguile-yamlpp\"~a)) ~a)"
> +                           (assoc-ref outputs "out") init all))))))))

I am not sure it is optimal to hide *all* errors from load-extension.
Maybe check if file exists and then try to load-extension it without the
false-if-exception?

(Sure there is a TOCTTOU problem, but I think that can be ignored in
this case.)

>      (native-inputs (list autoconf automake libtool pkg-config))
>      (inputs (list guile-3.0 yaml-cpp))
>      (native-search-paths

=2D-=20
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmfW4KEOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wanPCw/8CyAu4QsdDOvZEdErHJ8Plv3GKmMHG1FTLkwR
9XiEeeoqxJ999vzmIrWesbpnqbdwCAnLANpJE5f/nKITF12PB0WoH5PRqr4cLlz7
bhh/IdiAIixTmVWhB5K0DhZUSHxBT6bNpC75E3zRKRYQME+TCfQU7aRkMLldlYev
Ksmt4v4Ivao/ylvCU2KnYz4STgiyAwzgfc6vRAQqAgjwVV2HqnE9JfCeSzK6ZguF
T3Ixb1uVuo7/rUo9h8Uk4jWj+NjBnra4xhzG6y8UnLYnDCSkCmnlo0/PSy0AM0cy
6iojDvtPhNDS7ax8Z3TDEANpcLLDMB7cWk9etihfBbbMiYzLKEBe0pqBLWq16LMM
k2fVOJ1uEFz0MMCytqeLIcx07mroW1il1pEc2CyP7UEhXZXJV8rUGorfy2qW3UuM
1Y4HPN5q2vapohxiRHMEWejBYxqqf7Jrby9kejweJATZu9kBN0Acsq8NekMUQcbw
paWnsXayrzMci6iG7iOHtwA+d2X1fZM3WWFfyRS5g8a+DcQVyHy2b2t8qUZM05Ga
yg1OBkelv1PWdap7ragl9Irj1C7B9DXcuXPssrP35pkVV66wsHhVHYJjtHhcZhXO
w+CPIT/78x42m47lwZEoG1LSNcwKGLjQIkixcxp+sbzUyxR+EEEY7DSL1YdJ4pqh
zYUQ+UM=
=pN7n
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 15 Mar 2025 21:11:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 15 17:11:11 2025
Received: from localhost ([127.0.0.1]:43766 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ttYml-0001Nk-AY
	for submit <at> debbugs.gnu.org; Sat, 15 Mar 2025 17:11:11 -0400
Received: from mx2.mythic-beasts.com ([2a00:1098:0:82:1000:0:2:1]:35745)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <guix@HIDDEN>) id 1ttYmh-0001Ml-MS
 for 74532 <at> debbugs.gnu.org; Sat, 15 Mar 2025 17:11:08 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=twilken.net
 ; s=mythic-beasts-k1; h=Date:Subject:To:From;
 bh=/n+CA7xUiA6KLYX3447tteN1v7WzvKjfzsMszC2jrco=; b=5JI4DmJjhNHjRJC9Pky4nHJXzS
 xEBO1HB7d1AhVD7qWGm7kox9c/PvzsqaaRwD+KXCOhR9jWt5DxZfFpLLAs2igO7cRwq1nuv09wDsQ
 sXpBEB2fps7Qp4B6MH1yjLq8VLIERdgnWLcxTb2gKroFzKuhgu0HA+03rcyuJldb5ClL3+aOZkTyo
 TYToCJEieUi1vjQGb8yn+mOJp1bk2tRvBqKHEyHRW2USfDpFVunqMIvFKICGQefvrR1yf9LQ9KWmW
 DpD/ZsT97tJavGK0roktHpOMRbwAQft6Fm+dciOiBfk5F5+EIPrq+jnFVSgR45VRYYWWbfeQiOZA4
 LW8MKLQw==;
Received: by mailhub-hex-d.mythic-beasts.com with esmtpa (Exim 4.94.2)
 (envelope-from <guix@HIDDEN>) id 1ttYma-00ACGu-DC
 for 74532 <at> debbugs.gnu.org; Sat, 15 Mar 2025 21:11:00 +0000
From: Timo Wilken <guix@HIDDEN>
To: 74532 <at> debbugs.gnu.org
Subject: [PATCH] gnu: guile-yamlpp: Allow usage with `with-extensions'
Date: Sat, 15 Mar 2025 22:10:09 +0100
Message-ID: <20250315211008.8563-3-guix@HIDDEN>
X-Mailer: git-send-email 2.48.1
MIME-Version: 1.0
X-Debbugs-Cc: Tomas Volf <~@wolfsden.cz>, Ludovic Courtès <ludo@HIDDEN>, Z572 <zhengjunjie@HIDDEN>
Content-Transfer-Encoding: 8bit
X-BlackCat-Spam-Score: 49
X-Spam-Status: No, score=4.9
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74532
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/guile-xyz.scm (guile-yamlpp) [arguments] <phases>:
  Add 'set-extension-file-name.

Change-Id: I49a7199b4e0fe4053822374bae59c6e1d0b7ead0
---
 gnu/packages/guile-xyz.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 30c8e847996..f43e06a3a7f 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1997,6 +1997,19 @@ (define-public guile-yamlpp
        (sha256
         (base32 "0ik69y0vddg0myp0zdbkmklma0qkkrqzwlqwkij1zirklz6hl1ss"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       ,#~(modify-phases %standard-phases
+            ;; In order to let Guile find the compiled library when used with
+            ;; Guix' `with-extension', hardcode the final path to the library.
+            ;; The fallback is needed for tests (i.e. before the 'install phase).
+            ;; See <https://issues.guix.gnu.org/74532>.
+            (add-after 'unpack 'set-extension-file-name
+              (lambda* (#:key outputs #:allow-other-keys)
+                (substitute* "scm/yamlpp.scm"
+                  (("\\(load-extension \"libguile-yamlpp\"(.*)\\)" all init)
+                   (format #f "(or (false-if-exception (load-extension \"~a/lib/guile/3.0/libguile-yamlpp\"~a)) ~a)"
+                           (assoc-ref outputs "out") init all))))))))
     (native-inputs (list autoconf automake libtool pkg-config))
     (inputs (list guile-3.0 yaml-cpp))
     (native-search-paths
-- 
2.48.1





Information forwarded to ~@wolfsden.cz, ludo@HIDDEN, zhengjunjie@HIDDEN, bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 15 Mar 2025 21:05:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 15 17:05:37 2025
Received: from localhost ([127.0.0.1]:43758 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ttYhN-0000lQ-EW
	for submit <at> debbugs.gnu.org; Sat, 15 Mar 2025 17:05:37 -0400
Received: from mx2.mythic-beasts.com ([2a00:1098:0:82:1000:0:2:1]:54115)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <timo@HIDDEN>) id 1ttYhI-0000ka-SJ
 for 74532 <at> debbugs.gnu.org; Sat, 15 Mar 2025 17:05:34 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=twilken.net
 ; s=mythic-beasts-k1; h=To:From:Subject:Date;
 bh=nGGfzpt4R1hz6pG/9PTQb16jgZUINKW5oUgrEDQaqYM=; b=FMSzjfDkHk29Z8R+3p5yvHdWaX
 YEtcJueA/ma5hm7a9d2638MI5UmT9YelPrzOePGmuLt0jadqf7//Xuq6faVenvwNwRjrN6lIGOoJE
 jLZ8cqLcn+p6dDoY42P1ZukG6Dr3lH0E8F2UF28kYiDQysqtzABHXMGMett0MzZE7z4F8zqQGXnRW
 iX4v+2oiGF2EfvAbKNhyRhE6ESf5ER1xEIXVt27PzvSwoQi2jhTF1ko0PwLFTiQx3htfQiRikzo2Y
 4Nyj1sWQ13XPPE14ClBQnuFnQqJL0L10thmNBbSX5LZ2wcEDppkuRXv8Lfhv1WqxWFnXlG1VmvLCu
 UBStGbrA==;
Received: by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2)
 (envelope-from <timo@HIDDEN>)
 id 1ttYhC-00AB5N-9S; Sat, 15 Mar 2025 21:05:26 +0000
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Sat, 15 Mar 2025 22:04:53 +0100
Message-Id: <D8H58BCN9SEV.T8XB1KHBJZSR@HIDDEN>
Subject: Re: with-extensions does not add native extensions to the load path
From: "Timo Wilken" <guix@HIDDEN>
To: <74532 <at> debbugs.gnu.org>
In-Reply-To: <87bjxapg79.fsf@HIDDEN>
X-BlackCat-Spam-Score: 7
X-Spam-Status: No, score=0.7
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74532
Cc: Tomas Volf <~@wolfsden.cz>, Z572 <zhengjunjie@HIDDEN>,
 =?utf-8?q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Since I ran into this problem with guile-yamlpp today, I went ahead and
implemented Z572's suggestion.

It still feels wrong to do this on a per-package basis (shouldn't
`with-extension' take care of setting up the path?), but hey ho.

I needed the fallback (as suggested by Z572), else tests would fail (as
predicted by Tomas).

Like this, the whole chain works for me; in my case:

(computed-file "test"
  (with-extensions (list guile-yamlpp)
    #~(use-modules (yamlpp))))

Patch incoming.

Cheers,
Timo




Information forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 17 Dec 2024 13:55:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 17 08:55:41 2024
Received: from localhost ([127.0.0.1]:58154 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tNY33-0000tr-Dy
	for submit <at> debbugs.gnu.org; Tue, 17 Dec 2024 08:55:41 -0500
Received: from eggs.gnu.org ([209.51.188.92]:45288)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1tNY2y-0000tU-5r
 for 74532 <at> debbugs.gnu.org; Tue, 17 Dec 2024 08:55:39 -0500
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 <ludo@HIDDEN>)
 id 1tNY2r-0007fp-EX; Tue, 17 Dec 2024 08:55:29 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=L1SjFebVNuJpKjx3Qhwb8OKAHVrTyEAfNWXHexsHWb4=; b=FmC3AiVdSmBEcG/juDNG
 XPLUQ+3dgey1rynK3JspMzqz+OHbQsqFrqrNaP1cIDSBesfI3sXwXl/C77xXe4HrGryesBLZYDUtq
 0HKAJUCI1t5pQvGW33+ycj2s3Do49y9/CwoZSceXuwYU9vzbpu2sA0f4dPHlkGONP/xwjCMSZlHqV
 WfuSC97JcHHWTnIWfAEixB6dFcS7lrHDAhpWBXdx/dtmqIL4oO8esOkcwwkovmeLguJK3dzC4ogF7
 FDud8cyOgDLvxBRREnKNOBKcxX0zTFQfjitB8tq8xu56XNKUl/FM5ZYlQsvHyguPfas69QPKFh5cA
 WDEgOXb0nn/k9g==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Tomas Volf <~@wolfsden.cz>
Subject: Re: bug#74532: with-extensions does not add native extensions to
 the load path
In-Reply-To: <87o71flehy.fsf@HIDDEN> (Tomas Volf's message of "Fri, 13
 Dec 2024 17:44:09 +0100")
References: <871pyzdwzi.fsf@HIDDEN> <877c8n94kl.fsf@HIDDEN>
 <87plm93b7p.fsf@HIDDEN> <87y10x4g2w.fsf@HIDDEN>
 <87o71flehy.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Septidi 27 Frimaire an 233 de la =?utf-8?Q?R=C3=A9vo?=
 =?utf-8?Q?lution=2C?= jour du =?utf-8?Q?Li=C3=A8ge?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 17 Dec 2024 14:55:06 +0100
Message-ID: <87bjxapg79.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74532
Cc: Z572 <zhengjunjie@HIDDEN>, 74532 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Tomas Volf <~@wolfsden.cz> skribis:

> Z572 <zhengjunjie@HIDDEN> writes:
>
>>> How it that usually done?  I cannot do that *before* build, because then
>>> tests would not run (the library is not yet installed into the absolute
>>> path), and I cannot do it after, because I would need to rebuild the .go
>>> files after patching the source code.
>>
>> you can use substitute* to adjust source.
>> e.g.
>>
>> (or (false-if-exception (load-extension "/path/to/lib-some-object-file.s=
o"))
>>     (load-extension "lib-some-object-file.so"))
>>
>
> Thank you for the suggestion.  I am not sure I like the
> false-if-exception part, but temporary adjustment of the (@ (system
> foreign-library) guile-extensions-path) should do the trick as well.

I think you can just do:

  (load-extension "/path/to/lib-some-object-file.so")

but you need to (1) do that in a post-install phase, and (2) re-run
=E2=80=98make=E2=80=99 before =E2=80=98make install=E2=80=99 if necessary.

See =E2=80=98guile-gdbm-ffi=E2=80=99 as one example.

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 13 Dec 2024 16:44:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 13 11:44:15 2024
Received: from localhost ([127.0.0.1]:43938 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tM8lz-00082E-DE
	for submit <at> debbugs.gnu.org; Fri, 13 Dec 2024 11:44:15 -0500
Received: from wolfsden.cz ([37.205.8.62]:58122)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <~@wolfsden.cz>) id 1tM8lw-000824-4F
 for 74532 <at> debbugs.gnu.org; Fri, 13 Dec 2024 11:44:13 -0500
Received: by wolfsden.cz (Postfix, from userid 104)
 id 8A5D835EF6A; Fri, 13 Dec 2024 16:44:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1734108250; bh=OBErH/hLvhSGeyN7JynmjULdZxJq96RU+4JD4leloJU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=C7dVpe2OiO6VjQMvYjkUM+qWkA/+Pw6wXUHvXaqflCHl8ZA6IdcdaAe12qQ6X/czD
 WLzSXhSZgXCXBhdNvBujUMSQGdqyJQSjKmzXmqavUJvP4Oo5utEFVkNKmPS/QUtyVA
 uL1+sMEVY27z4ecxnHKJqzFVgbtyVTHsmj3wJo9NoWN2ZDfKY6B7jdWhGuJxA9hILT
 HBDR7suqJYrwxbhTlnN+Ut4Uz8m3LR05w10PZSoazujRJlcttn6vURadziXt+1Kl/X
 X/0oA6bBP4XUPFV+DCXp8uCRz3eqnk7do4t9R7LRZ0iTQwKo5oME/FBR9gqqW2iz9v
 9hYtTrTIXcM+TWbB0kH/Kv0lg7isGMWixFvlwJjzI1e0e/i69YkZ6qrIwLjHghj5Nc
 auwfZgViVgQb/DR+d6UzyvpWKDa0c9G27nXTvVd3e8fyQYh1VyMOu6WYIhn2eph91P
 voh6vpdNG+heEFfrsW5A7+FuQHi+hp2nncBl4Fwg5VTUe0X2WoApTgatkdi7ipNGtq
 M9UN7KIgTOs6H3NA+9ZEcoQufma/ziAPW4uuszOkGm50ebdyxVGeLfYPflcCqZ+aFH
 4aCOpbCPrihFCtEGIFJ06nI0eXpFPdXEzxa7IudBIuBpdw/5/V1/VtGcl7b1w0b44a
 U3MBzWqDfAQjuqAjcx2Lq/s0=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED
 autolearn=ham autolearn_force=no version=3.4.6
Received: from localhost (unknown [128.0.188.242])
 by wolfsden.cz (Postfix) with ESMTPSA id B31F236058F;
 Fri, 13 Dec 2024 16:44:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1734108249; bh=OBErH/hLvhSGeyN7JynmjULdZxJq96RU+4JD4leloJU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=GoBRCEC1Kxr1hNRjVabqBzoLTH0/V3mar94Xw27kxax98+J/ox1JKGvCrE+RC3xmV
 zicA4VajMuhd4j+thGK33MeBkmbEIvpoIzR1XGJedutyV5a1/fbElFoOcqwFf66EU9
 MshMbhHsl0dm4tKaA0lzHFFli2cAQ6KnU8Xs0tgPXcPaVGpGE6TUDBTO/DQnWyU5wg
 FwUCWXKvppym+raGLQuZvmuNuh+L1F+KlLil4y80GFgpyFth04V6nUAQIiaPsyE87w
 VeGcu8kpvI8ZNdiso+oI3CqozbkQFwRc3KIOkKNkONwYRqX1l0vJGUdYI6luyzLMKx
 xpcofWDDCdYXu0RPFjqNl/zPWhdVDxY31bh2AJuZ9FJ4vJURQnNVe3TcRErCOA0qz5
 D6m1BMX7JNhHLJt0idVNOJHk6dMJxoLNiJ+I77bxG3cQXTW/HEcPPl2BzhCVLiqCC8
 gTYzMQDU4sJ5N4IdIvFBiGp1O+x+6sNlzNM3C7tPTJYzxBoXodCH9h/jfyF75uci0v
 80Rygh39W5hp4t7FWzQRkpfB4crsfj93niGbgdJONjrEFc8ARuOf7G/sNMwSEImrVk
 IeeoEeFKTIBVmthR9AW1YEQmrKLvtHLGdMYB7p5l19pLW7ZDntoL2ILAi+oOkkCwX7
 UlLP6IBXJ6OFzQiIGCnVoxoE=
From: Tomas Volf <~@wolfsden.cz>
To: Z572 <zhengjunjie@HIDDEN>
Subject: Re: bug#74532: with-extensions does not add native extensions to
 the load path
In-Reply-To: <87y10x4g2w.fsf@HIDDEN> (zhengjunjie@HIDDEN's message
 of "Tue, 03 Dec 2024 11:10:15 +0800")
References: <871pyzdwzi.fsf@HIDDEN> <877c8n94kl.fsf@HIDDEN>
 <87plm93b7p.fsf@HIDDEN> <87y10x4g2w.fsf@HIDDEN>
Date: Fri, 13 Dec 2024 17:44:09 +0100
Message-ID: <87o71flehy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74532
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 74532 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable


Hello,

Z572 <zhengjunjie@HIDDEN> writes:

>> How it that usually done?  I cannot do that *before* build, because then
>> tests would not run (the library is not yet installed into the absolute
>> path), and I cannot do it after, because I would need to rebuild the .go
>> files after patching the source code.
>
> you can use substitute* to adjust source.
> e.g.
>
> (or (false-if-exception (load-extension "/path/to/lib-some-object-file.so=
"))
>     (load-extension "lib-some-object-file.so"))
>

Thank you for the suggestion.  I am not sure I like the
false-if-exception part, but temporary adjustment of the (@ (system
foreign-library) guile-extensions-path) should do the trick as well.

One thing I am curious about, I can see you have put the load from
absolute path as the first alternative.  But if it fails, it still falls
back to lookup based on the guile-extensions-path.  I wonder whether
putting it at the end of the list would not be better, that way you
could still replace the library in the spirit of LD_PRELOAD by setting
the appropriate environment variable.  And if reproducibility is the
priority, then even the `or' might not make sense.

Any thoughts on that?

Thanks,
Tomas

=2D-=20
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmdcZFkOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wakTlg/9FoMOQ/oOx1tN0mrl3wwcTbbZh5MRX9XF5+v0
En5BCvWWuysmkC9nxS2YhS9GlEXV4qEc5pkfL8QbvcvcL2PYsxB/uIY5q+dJXVDl
5f+Be6e71ptlEz6Hk9/IWpPgj9/t+EixFfA4Q/XIsoxsy4b9KGrIlDJDQiX2R+h+
YM90uymr9gXj9lDZsn8J4gFEaQaVxLr6V7mCIRGVL2oobEVOPGnKwswAVarfhx6a
AdPGU3VCRezbn3D6NtFi2hrUXSfwpPNQ86VltBu6yS+2rBaYwI6f/fExJV+IZoDu
rekFf80wU9BEMwNJCNJPy5FvkAbqTNRRQ8ox9LnuDhlPTvFvYp9wjV7YVUqT1+1p
go/YUUyGu9Pko2WbW0oe0WbhEqWkFhMW39GteJ0P7C22KT9m/IY7E2kEp0+0rJ6B
bi1rZ862bvVQ0VQ8bIuVksCd5ZV5CsAnND4Y0gCv3QW/Uw2P7OjpG5g+puHOmwCH
tkuxB4kV+Qrpr+mY1sL6EQZqDWsdHzN0B1VKTI3MdGYnvUCoHibJcoYIhVe0aiWi
nIX+cyACJ8qNgluB9VM+9TqCLvnDuyJ0Lall+VZrfrybXoXAAlt+Snylm4iBPvb9
KrE7vzLEIGEMz3hvX3m/nG+qNI6vcdOL7MrE+JnWpwjMCwmMrxzeTsbshcbl3DmU
L4q8mgc=
=Jjva
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 3 Dec 2024 03:10:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 02 22:10:34 2024
Received: from localhost ([127.0.0.1]:57448 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tIJJ4-0000yZ-AP
	for submit <at> debbugs.gnu.org; Mon, 02 Dec 2024 22:10:34 -0500
Received: from smtp81.cstnet.cn ([159.226.251.81]:35182 helo=cstnet.cn)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zhengjunjie@HIDDEN>) id 1tIJJ1-0000yK-Lo
 for 74532 <at> debbugs.gnu.org; Mon, 02 Dec 2024 22:10:32 -0500
Received: from m (unknown [107.174.64.25])
 by APP-03 (Coremail) with SMTP id rQCowAAnyO2adk5nyqpXBw--.29072S2;
 Tue, 03 Dec 2024 11:10:22 +0800 (CST)
From: Z572 <zhengjunjie@HIDDEN>
To: Tomas Volf <~@wolfsden.cz>
Subject: Re: bug#74532: with-extensions does not add native extensions to
 the load path
In-Reply-To: <87plm93b7p.fsf@HIDDEN> (Tomas Volf's message of "Tue, 03
 Dec 2024 00:40:42 +0100")
References: <871pyzdwzi.fsf@HIDDEN> <877c8n94kl.fsf@HIDDEN>
 <87plm93b7p.fsf@HIDDEN>
User-Agent: mu4e 1.12.7; emacs 30.0.92
Date: Tue, 03 Dec 2024 11:10:15 +0800
Message-ID: <87y10x4g2w.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-CM-TRANSID: rQCowAAnyO2adk5nyqpXBw--.29072S2
X-Coremail-Antispam: 1UD129KBjvJXoWxCw43CF47GFWxZrWxKry7Awb_yoW5tr17pF
 WfK3WUKFWDJw1rCw1q9w17tr1akr18tF43GrnYgw4jka9xZryS9rWxtr4F9a4xCw4rWrW7
 ua1v934DXasrZ3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
 9KBjDU0xBIdaVrnRJUUUvCb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2
 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw
 A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xII
 jxv20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwV
 C2z280aVCY1x0267AKxVW8Jr0_Cr1UM2vj62AExVA0xI801c8C04v26x02cVCv0xWle2I2
 62IYc4CY6c8Ij28IcVAaY2xG8wASzI0EjI02j7AqF2xKxwAqx4xG64xvF2IEw4CE5I8CrV
 C2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE
 7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbV
 WUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF
 67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42
 IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF
 0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2Kf
 nxnUUI43ZEXa7IUeqFAtUUUUU==
X-Originating-IP: [107.174.64.25]
X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74532
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 74532 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Tomas Volf <~@wolfsden.cz> writes:

> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
>
>> Hi,
>>
>> Tomas Volf <~@wolfsden.cz> skribis:
>>
>>> The documentation for `with-extensions' says:
>>>
>>>> In the same vein, sometimes you want to import not just pure-Scheme
>>>> modules, but also =E2=80=9Cextensions=E2=80=9D such as Guile bindings =
to C libraries
>>>> or other =E2=80=9Cfull-blown=E2=80=9D packages.
>>
>> It=E2=80=99s not just bindings but also pure Scheme libraries like Guile=
-JSON.
>
> True, and for those it works well.  However the text documentation
> explicitly mentions "bindings to C libraries" as one of the use
> cases. :)
>
>>
>>> However it does not actually add those C libraries into
>>> (guile-extensions-path), which means that trying to actually use a
>>> library imported this way will lead to an error.
>>
>> [...]
>>
>>>    190:25  1 (load-foreign-library _ #:extensions _ #:search-ltdl-libra=
ry-path? _ # _ # _ # =E2=80=A6)
>>> In unknown file:
>>>            0 (dlopen "libguile-yamlpp.so" 1)
>>>
>>> ERROR: In procedure dlopen:
>>> In procedure dlopen: file "libguile-yamlpp.so", message "libguile-yamlp=
p.so: cannot open shared object file: No such file or directory"
>>
>> Usually, packages like these (guile-gnutls, guile-git, guile-ssh, etc.)
>> have their .so absolute file name hard-coded, which sidesteps this
>> problem entirely.  I recommend doing that for guile-yamlpp as well.
>
> How it that usually done?  I cannot do that *before* build, because then
> tests would not run (the library is not yet installed into the absolute
> path), and I cannot do it after, because I would need to rebuild the .go
> files after patching the source code.

you can use substitute* to adjust source.
e.g.

(or (false-if-exception (load-extension "/path/to/lib-some-object-file.so"))
    (load-extension "lib-some-object-file.so"))

>
> Assuming I have a guile library that creates a new .so library during
> the build, and the .so library must be loadable by the other modules in
> the library during the build (and for the tests), how should I approach
> that?
>
> I am pretty sure I cannot just patch the source code, since the library
> would not be installed into the absolute path yet during the build.
>
> Honestly, setting GUILE_EXTENSIONS_PATH via pre-inst-env seemed like
> fairly elegant solution.
>
>>
>> That said, it would probably make sense to arrange for =E2=80=98with-ext=
ensions=E2=80=99
>> to set GUILE_EXTENSIONS_PATH.
>
> That would be great.  My current work-around is
>
>   (with-extensions (list guile-wolfsden)
>     (program-file
>      "audio-cycle-sinks"
>      #~(begin
>          ;; Bug 74532: Native extensions are not added to the load path.
>          (eval-when (expand load eval)
>            (let ((ext-path (@ (system foreign-library) guile-extensions-p=
ath)))
>              ;; Just a temporary hack, we can live with duplicates in the=
 path.
>              (ext-path (cons #$(file-append guile-wolfsden
>                                             "/lib/guile/3.0/extensions")
>                              (ext-path)))))
>          ...)))
>
> which is anything but elegant.
>
>>
>> Ludo=E2=80=99.
>>
>> PS: Your MUA sets =E2=80=9CMail-Followup-To: bug-guix@HIDDEN=E2=80=9D, =
which is kinda
>>     annoying because that=E2=80=99s the wrong address when replying to a=
 bug.
>>     :-)
>
> Thanks for letting me know, I was not aware of that.  After reading
> (message)Mailing Lists bit more carefully, adjusting the Posting Styles
> and sending a bug fix to the Emacs' bug tracker, I believe it should not
> happen anymore.  Sorry for the annoyance.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmdOdpcACgkQO1qpk+Gi
3/AJGw/8C1lFfLawGVgkxxSC9wDqqvLnhmkTuNgE088XfbvBWbL1T22yUT++X7rI
mqy8gDUf5m9Sjb3IWH31ghAcc6UN4yZNURWX/gktWQ++1X7tgic8HU+KHI4kp2YZ
bMSplp70yD91aAfqI/8kzqVaaaLIx2aq1x3HaD+Sq1nnZE4K7gbcXnAxSx9L8c8X
R0Xcn76R52IlhbZSjHtNcpGYKgldnS+DG70oQB2+yZBFo6WbIQGI2ZKoYfYp/Fin
LtUgU1b/MNSx3LNZU/p2e3HdvPzVFkk/0wh/0S3fBLRbVu/6eBysqKUAwAEe1KOi
t6irzc6AC+rkyd60Ua/uk2ejEAEiS8kV9tlNXvnmtQx6YBM0Y77TuzQTzz0qfui6
2FZROhmuPkAC2odSR5aoLjmXjALqKm6JzERzN57EDI5saLH7qpqg3HeECm7KnOQ4
sqpuzuFyQ8U2SJxLzdBIsJ6H5OvVWh4HexwDY18LRzvBpyjSPwLV4m/cqxbvTshI
Lz25LrF8CjtvTIsqI20OvF18oCBgbIWvRyJFmpQ5RQFW7Af55kBtyukGmXGzygpJ
xLDY1ZwricaVwmD1Srrq0F2W17fAgB9osFTgUR0ukV7WeMqAVWhn1jl4YW+7VvCq
GAoGErgqJ8Ljt35naE/gFl7fmCU7+1OvyqlZecZlWLU59P7YOC4=
=EYhI
-----END PGP SIGNATURE-----
--=-=-=--





Information forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 2 Dec 2024 23:40:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 02 18:40:49 2024
Received: from localhost ([127.0.0.1]:56985 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tIG24-0007Da-Oi
	for submit <at> debbugs.gnu.org; Mon, 02 Dec 2024 18:40:49 -0500
Received: from wolfsden.cz ([37.205.8.62]:50242)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <~@wolfsden.cz>) id 1tIG21-0007DQ-Ls
 for 74532 <at> debbugs.gnu.org; Mon, 02 Dec 2024 18:40:47 -0500
Received: by wolfsden.cz (Postfix, from userid 104)
 id 0CF1632753D; Mon,  2 Dec 2024 23:40:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1733182844; bh=vAgQGs0zKMTk5fPKporeFhRGmKtU9k7MU2laz+0j6V4=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=MLjIez7OHcvTcmJUOlxu+ue2OYJr9l7i86q0HY3uFPdTg8SH4NVmES+G0kAur+RvL
 MSVjtcfClYPJGqfvv0CqVlGvpTpGNXkfmJBNF40b8CBZc3By9PvYZsIvACdqW3zS6A
 ekVLYuGsdf5VptPCPBSu3/fueAm2VInlV+5gMjMrnGQWvclvy3Ykwg7aT63Mqmnm23
 gqszKCaRMFHvMiW6zbUbyj2dfMQ5BX2WyDLsDzu91iSe1Bw19DR14lq4kfmV+UA1T4
 w2R6xvxBppfg6h0c3AInhmWDCwiiQSxWI8lZSPsQ0OBVAeTO2xbijQZvRi9BdA7zea
 qpg/iz71tK884alTiGMk8nnc2frOiNsmAf3OyeshU2AhaixkCFakfs7FKpWkZoGBia
 w7xISeM6bgFCNSnXcXHCv5Vuq95H6ixLuLe1VbEoq7Of0XJF/iGM5ywjHrrdQlQA5Q
 V6fQt8kdEf1IHzv5YIvBz17XgZMQ4SwZkhmx2+j5u2ZT9IiTYn28Cje2BAk/Sv4Vym
 4gd2PDl2hWwj6ppDF5XROaEd6bMdwp1JmuQ/F386Qgsx0VE++d+UzG9KXiCPOMCQyj
 Urane+0njFjZ3hoaiCGAUhDnZ618WZCDAwZnoXvdadLG/whHs3I4Ok4IjqBu+5tFmq
 dwTOVNeR2Wc5rByfm+oBr1vw=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED
 autolearn=ham autolearn_force=no version=3.4.6
Received: from localhost (unknown [128.0.188.242])
 by wolfsden.cz (Postfix) with ESMTPSA id 197ED338391;
 Mon,  2 Dec 2024 23:40:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1733182843; bh=vAgQGs0zKMTk5fPKporeFhRGmKtU9k7MU2laz+0j6V4=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=PQcS5kW9JkWZl4o//PR8nx9U8Ph9BOKvt+hDi9K3sAqZZ/VD0U/3G8QBStPv47wIg
 DmOJxZ0Rs0Mq8OuWMCBeMOev3Z7Z3wniD9pc3VfkJr+QTo7izjyrJeFu94nSWoM4oh
 3DBGALeZtiq94UzkPsxh77zoZKCjv52XczaufXXVMSLiheRBfXUEIdwPhHi6g5t9XY
 RxWxMMJoHSiMA0nUpe6RnWqriOEJKMoYYIIhcrVyTofU7suRxglLYtaP3iccb2qksz
 ocVRwsTBwAGYUXP5MX2ETuOx9Nvxh6hkHojePJU8IwGD5ye45pJBTz3Pn6SRZ4udha
 VN4johD/xAytxqhRc6pgFVMK0zlkpG8BVUjaIYYiHqvSyYRkK+HWwAE2SB5iHawXMA
 RUQuGgEL3hvba9az/6s3hGt0TK0CtRasUjd44VZ8esjqrXioztZxlfarh/sxVZ7asw
 usBUyb4gP4fLfZbKLWqzauWe7qSGx/QfRtsGmlweFyx6cKL0fzOy9GsDWQhFScCYZ7
 6yt1bTBLlD75EFEy9h4cHbrUnn/BlkVFo0dKNo6vqdV9+NQjWTz/9U+Btm7glJ7zZO
 x8Artrh+ABABYnzM84Vbx8z70115vX0GCQJ251q0u1Ij9c1i6te+mhVmzUko43yJra
 z7FFuGNS6hd/b+DW/gyWGCOQ=
From: Tomas Volf <~@wolfsden.cz>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#74532: with-extensions does not add native extensions to
 the load path
In-Reply-To: <877c8n94kl.fsf@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?=
 =?utf-8?Q?s?= message of "Thu, 28 Nov 2024 08:54:02 +0100")
References: <871pyzdwzi.fsf@HIDDEN> <877c8n94kl.fsf@HIDDEN>
Date: Tue, 03 Dec 2024 00:40:42 +0100
Message-ID: <87plm93b7p.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74532
Cc: 74532 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Hi,
>
> Tomas Volf <~@wolfsden.cz> skribis:
>
>> The documentation for `with-extensions' says:
>>
>>> In the same vein, sometimes you want to import not just pure-Scheme
>>> modules, but also =E2=80=9Cextensions=E2=80=9D such as Guile bindings t=
o C libraries
>>> or other =E2=80=9Cfull-blown=E2=80=9D packages.
>
> It=E2=80=99s not just bindings but also pure Scheme libraries like Guile-=
JSON.

True, and for those it works well.  However the text documentation
explicitly mentions "bindings to C libraries" as one of the use
cases. :)

>
>> However it does not actually add those C libraries into
>> (guile-extensions-path), which means that trying to actually use a
>> library imported this way will lead to an error.
>
> [...]
>
>>    190:25  1 (load-foreign-library _ #:extensions _ #:search-ltdl-librar=
y-path? _ # _ # _ # =E2=80=A6)
>> In unknown file:
>>            0 (dlopen "libguile-yamlpp.so" 1)
>>
>> ERROR: In procedure dlopen:
>> In procedure dlopen: file "libguile-yamlpp.so", message "libguile-yamlpp=
.so: cannot open shared object file: No such file or directory"
>
> Usually, packages like these (guile-gnutls, guile-git, guile-ssh, etc.)
> have their .so absolute file name hard-coded, which sidesteps this
> problem entirely.  I recommend doing that for guile-yamlpp as well.

How it that usually done?  I cannot do that *before* build, because then
tests would not run (the library is not yet installed into the absolute
path), and I cannot do it after, because I would need to rebuild the .go
files after patching the source code.

Assuming I have a guile library that creates a new .so library during
the build, and the .so library must be loadable by the other modules in
the library during the build (and for the tests), how should I approach
that?

I am pretty sure I cannot just patch the source code, since the library
would not be installed into the absolute path yet during the build.

Honestly, setting GUILE_EXTENSIONS_PATH via pre-inst-env seemed like
fairly elegant solution.

>
> That said, it would probably make sense to arrange for =E2=80=98with-exte=
nsions=E2=80=99
> to set GUILE_EXTENSIONS_PATH.

That would be great.  My current work-around is

  (with-extensions (list guile-wolfsden)
    (program-file
     "audio-cycle-sinks"
     #~(begin
         ;; Bug 74532: Native extensions are not added to the load path.
         (eval-when (expand load eval)
           (let ((ext-path (@ (system foreign-library) guile-extensions-pat=
h)))
             ;; Just a temporary hack, we can live with duplicates in the p=
ath.
             (ext-path (cons #$(file-append guile-wolfsden
                                            "/lib/guile/3.0/extensions")
                             (ext-path)))))
         ...)))

which is anything but elegant.

>
> Ludo=E2=80=99.
>
> PS: Your MUA sets =E2=80=9CMail-Followup-To: bug-guix@HIDDEN=E2=80=9D, w=
hich is kinda
>     annoying because that=E2=80=99s the wrong address when replying to a =
bug.
>     :-)

Thanks for letting me know, I was not aware of that.  After reading
(message)Mailing Lists bit more carefully, adjusting the Posting Styles
and sending a bug fix to the Emacs' bug tracker, I believe it should not
happen anymore.  Sorry for the annoyance.

=2D-=20
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmdORXoOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/walAqhAAjpE/KuhL/q5vv67k0zndvpQD3ExmofQYZTuq
NOTaYd6Y/1YfqChTbslTBU4W1J3NdJ7P1N/q0X8DhLg6mxYkakri2WJSGTP4H0nF
lo+RbDyas7aaIu9DrnlM4LzqWARbXFrbP5wMUhXBif9JsfO/AtRXZECUlQrYCYLo
t5nO354y0dhb4M0kRXnxbq6ray2HRWzar0SLDkRJIu9ChsJePta1z1IZbW1GpHhS
U9em2Tx84QTnM7S51wLPKGczgAiNc3vQZhxPX6R9ZuO4989Fl4zLuaaGKo34QY11
I5kuCuAO4sOoel562Rj2KXIJ0Bb/n9hXKHuhXrch+5hPobi7Yn4Eb96QW216KccW
JaZwy5fbqpG96jZm27PWuBDRUq+wz2rbb5PTkiSKj4ev+nbPelIEf7ULsilLk0vZ
6h0mEu/XHYpbbIEZls1vAUqP1pxjeF1VFDHWa/TL/HG/QGlakNWnHIPYbIAdXK3m
Gfymj8MfajZoiSNYans/ZQAb4QmxkoTfZEl6+AKzcgyrLjx6MqZQinCiWJyO/eQD
M5Nxj5jkJIvIe41tH541fb6In9t5+8rXF5DeWVgg9Tpd0Y1ep9Fiakx5sVBtI/F3
KCxtXsS52DuAGGfDTo0A8UAcyvqpZt3Ii0MAejM4Hbie764XKuJoRat9a+OtHFjC
OHP0wj4=
=RJ63
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at 74532 <at> debbugs.gnu.org:


Received: (at 74532) by debbugs.gnu.org; 28 Nov 2024 07:54:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 28 02:54:20 2024
Received: from localhost ([127.0.0.1]:36414 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tGZLw-0001XB-CP
	for submit <at> debbugs.gnu.org; Thu, 28 Nov 2024 02:54:20 -0500
Received: from eggs.gnu.org ([209.51.188.92]:54782)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1tGZLu-0001Ww-3v
 for 74532 <at> debbugs.gnu.org; Thu, 28 Nov 2024 02:54:18 -0500
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 <ludo@HIDDEN>) id 1tGZLh-0002Q4-3a
 for 74532 <at> debbugs.gnu.org; Thu, 28 Nov 2024 02:54:10 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=4jBGaUthjax/yPVJZJE4SsZiKqmOTzkduDAdxF288eE=; b=MNeQvmNudlL+469dQl3y
 dOjp2rqK7nQjy263B2cfd5U8yU5LxvbtSv7xm+C4lg3hPpy63PuIpqfyZcPY0GQGgx2A/CI373qzi
 9Tr40mbiM15Pl05hplHpZOoIXDnr1DSZy9kUZJIL7YyU+wevh+8RHd1SMVKeZUp9kWP9KGFNCeBgi
 3yyTmoHThfxfRPa+qCDB6q+OV5QMbxwJcZs6vFrgEi531U3TgmKHSJi2K66nJv/w4ZfSsAYN2AU60
 fJYO08PnosGffkUQeUGA/AgaG08Vk6WHCzNCH4lsvpMt2j7WDLVaLbxePcDXVRhk1zxH9Nt+hCYbV
 tHHRXegIfKnFWA==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: 74532 <at> debbugs.gnu.org
Subject: Re: bug#74532: with-extensions does not add native extensions to
 the load path
In-Reply-To: <871pyzdwzi.fsf@HIDDEN> (Tomas Volf's message of "Mon, 25
 Nov 2024 18:49:53 +0100")
References: <871pyzdwzi.fsf@HIDDEN>
Date: Thu, 28 Nov 2024 08:54:02 +0100
Message-ID: <877c8n94kl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74532
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Tomas Volf <~@wolfsden.cz> skribis:

> The documentation for `with-extensions' says:
>
>> In the same vein, sometimes you want to import not just pure-Scheme
>> modules, but also =E2=80=9Cextensions=E2=80=9D such as Guile bindings to=
 C libraries
>> or other =E2=80=9Cfull-blown=E2=80=9D packages.

It=E2=80=99s not just bindings but also pure Scheme libraries like Guile-JS=
ON.

> However it does not actually add those C libraries into
> (guile-extensions-path), which means that trying to actually use a
> library imported this way will lead to an error.

[...]

>    190:25  1 (load-foreign-library _ #:extensions _ #:search-ltdl-library=
-path? _ # _ # _ # =E2=80=A6)
> In unknown file:
>            0 (dlopen "libguile-yamlpp.so" 1)
>
> ERROR: In procedure dlopen:
> In procedure dlopen: file "libguile-yamlpp.so", message "libguile-yamlpp.=
so: cannot open shared object file: No such file or directory"

Usually, packages like these (guile-gnutls, guile-git, guile-ssh, etc.)
have their .so absolute file name hard-coded, which sidesteps this
problem entirely.  I recommend doing that for guile-yamlpp as well.

That said, it would probably make sense to arrange for =E2=80=98with-extens=
ions=E2=80=99
to set GUILE_EXTENSIONS_PATH.

Ludo=E2=80=99.

PS: Your MUA sets =E2=80=9CMail-Followup-To: bug-guix@HIDDEN=E2=80=9D, whi=
ch is kinda
    annoying because that=E2=80=99s the wrong address when replying to a bu=
g.
    :-)




Information forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Nov 2024 17:50:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 25 12:50:14 2024
Received: from localhost ([127.0.0.1]:40296 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tFdDy-0003ka-4V
	for submit <at> debbugs.gnu.org; Mon, 25 Nov 2024 12:50:14 -0500
Received: from lists.gnu.org ([209.51.188.17]:52510)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <~@wolfsden.cz>) id 1tFdDv-0003kD-6p
 for submit <at> debbugs.gnu.org; Mon, 25 Nov 2024 12:50:11 -0500
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 <~@wolfsden.cz>) id 1tFdDu-0000CZ-KB
 for bug-guix@HIDDEN; Mon, 25 Nov 2024 12:50:10 -0500
Received: from wolfsden.cz ([37.205.8.62])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1tFdDi-0001PJ-Iw
 for bug-guix@HIDDEN; Mon, 25 Nov 2024 12:50:09 -0500
Received: by wolfsden.cz (Postfix, from userid 104)
 id 79B853467DF; Mon, 25 Nov 2024 17:49:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1732556995; bh=ByJBpuLnKTKq4mNVCnrr/OgMj+7hXTrDO2ncdbFHk04=;
 h=From:To:Subject:Date;
 b=B9JrJSaZ3YTWNH2eYFNUdA9kz+hDZFuIPcaS2zxvZpMY7XqigU9/c0TQgZTSBRvqf
 871Gx/RUmACRKyrw4Z4qMp6khDRwXPahSytsk/Cyni63qOLt/KwpPwGyi6ZquCRWpr
 ph9gfzslRCJJ2N9gUGILyzAkQUfo0xjLq+9nvcj4lClgOxvSdMCXCiLIzQDZEn19zW
 S+esnHPdaeEaO3SlRwcZQ40j1hgmJXyJkHGvksLDf7yNFY3pD0TQjyGSrHSJCnGo0z
 Y+TnOndgwbb01NBfB4Giy2bYMqwfYbEEfa4KNrMtj335a+5sSWOWU8q6VKgxRI3cf2
 DfaicKVAhcgt7ZvEdjblyMG/LVNviSZUpSCs5LVgso+O9E5XC0O6kyEF+i4GH8WsTz
 +x3Zz9co+WM5VhLDEL0274mmE7BlhMqOaWpHSiV3k9mI7KxV++94tv9hdOfNzwjYrs
 3ZvvL+1KQgci5Iz6MVmEycPbrisE+RcXj4R3U/qwc+ixIJAW7ua+IKwHVEJNHqcuDc
 vI8DJORHmLcxq+2On87NweFrIIDFMxAiVSlMVC8GvG2G1+rNWIQl39uU0FPuTklB2R
 AmGiBnhSxOzgPYONsjGeomsVvuvRRQikS1iFxhGIzhxIKHKKyLTBMx/acGLurH+y4a
 SHY6igpKjZXuqV4KZOlOCOA0=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED
 autolearn=ham autolearn_force=no version=3.4.6
Received: from localhost (unknown [128.0.188.242])
 by wolfsden.cz (Postfix) with ESMTPSA id A2A09346440
 for <bug-guix@HIDDEN>; Mon, 25 Nov 2024 17:49:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1732556994; bh=ByJBpuLnKTKq4mNVCnrr/OgMj+7hXTrDO2ncdbFHk04=;
 h=From:To:Subject:Date;
 b=sesBPau+tCfun3daC1nL+AiQS5eCEKh5Bd/bXVXPriOgYqQ7mL9sjT/JtCIijxVKI
 zPJatuHm0NbYN5JUCKfx93puAMnlrGbmpAf4mccwk/hZW2XPy/Gz3UIMa8WhqGyeVB
 Pv7mZ74xWnw14046LRuj59AuQGhscVf61eEQfGsA9yqBp2llYLXOUeYjZTtr3qalav
 ffskplkHOwiaHb02+02munM+D7yqnct6+Y2jf6KF6aRHqm4WAIUOLFKe/JbpHXoiIv
 w6BlZ+HIiN3Jdtd6ASnPe8dayOdUYGogDinisszA64JD8c+1g63wWRse8A0ag1Jpa4
 b++ip5q5REFv31/5qq8z4G90Ek/Nr+936wTORCyt1LkQ0LS3fAyBcLDbj6sdNSpuOd
 FtEG+Eh1fYksCgLrkBgjrWdbrV25FZ5WVkOc95pfFwudMtRyGl6nCwgsFF47zZ4fUN
 V7nmZPyb57xtNR8bbQIbjL5F8ETlKbm0PSzFX4nzsrqus6HPEajYMCUXgKo28cvJJA
 8NYdk1PZVdVzwHddFLybKYoLeG83h+y98OJjP4GrA82fscK82+ujzlYIDZ7auNwpvn
 NzTz6ShMb6HRrpLcn9a3ymQ3BXgCUjQNykjHa8CrE5UoYNyFmmWIhAG/o1YAX0ITMh
 mdbNIECLji82jI8L0MLizHE4=
From: Tomas Volf <~@wolfsden.cz>
To: bug-guix@HIDDEN
Subject: with-extensions does not add native extensions to the load path
Mail-Followup-To: bug-guix@HIDDEN
Date: Mon, 25 Nov 2024 18:49:53 +0100
Message-ID: <871pyzdwzi.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz;
 helo=wolfsden.cz
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,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


The documentation for `with-extensions' says:

> In the same vein, sometimes you want to import not just pure-Scheme
> modules, but also =E2=80=9Cextensions=E2=80=9D such as Guile bindings to =
C libraries
> or other =E2=80=9Cfull-blown=E2=80=9D packages.

However it does not actually add those C libraries into
(guile-extensions-path), which means that trying to actually use a
library imported this way will lead to an error.

I guess `load-path-expression' in (guix gexp) needs to also append to
the `guile-extensions-path' based on the search-paths of the imported
packages?

Reproduction is simple.  Make sure you *do not* have guile-yamlpp
installed in your profile.  Then build the `test' into a store item.

=2D-8<---------------cut here---------------start------------->8---
(use-modules (gnu packages guile-xyz))
(define test
  (with-extensions (list guile-yamlpp)
    (program-file "test" #~(use-modules (yamlpp)))))
=2D-8<---------------cut here---------------end--------------->8---

And try to run it:

=2D-8<---------------cut here---------------start------------->8---
$ /gnu/store/nq0sahcnph5sxms4irq4inv2hq2hfbzr-test
Backtrace:
          19 (primitive-load "/gnu/store/nq0sahcnph5sxms4irq4inv2hq2hfbzr-t=
est")
In ice-9/eval.scm:
   721:20 18 (primitive-eval _)
In ice-9/psyntax.scm:
  1229:36 17 (expand-top-sequence _ _ _ #f _ _ _)
  1221:19 16 (parse _ (("placeholder" placeholder)) ((top) #(ribcage () () =
())) _ e (eval) #)
   259:10 15 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) (hygi=
ene guile-user))
In ice-9/boot-9.scm:
  3935:20 14 (process-use-modules _)
   222:17 13 (map1 (((yamlpp))))
  3936:31 12 (_ ((yamlpp)))
  3327:17 11 (resolve-interface (yamlpp) #:select _ #:hide _ #:prefix _ #:r=
enamer _ # _)
In ice-9/threads.scm:
    390:8 10 (_ _)
In ice-9/boot-9.scm:
  3253:13  9 (_)
In ice-9/threads.scm:
    390:8  8 (_ _)
In ice-9/boot-9.scm:
  3544:20  7 (_)
   2836:4  6 (save-module-excursion _)
  3564:26  5 (_)
In unknown file:
           4 (primitive-load-path "yamlpp" #<procedure 7f405e4fd560 at ice-=
9/boot-9.scm:35=E2=80=A6>)
In yamlpp.scm:
     65:1  3 (_)
In unknown file:
           2 (load-extension "libguile-yamlpp" "init")
In system/foreign-library.scm:
   190:25  1 (load-foreign-library _ #:extensions _ #:search-ltdl-library-p=
ath? _ # _ # _ # =E2=80=A6)
In unknown file:
           0 (dlopen "libguile-yamlpp.so" 1)

ERROR: In procedure dlopen:
In procedure dlopen: file "libguile-yamlpp.so", message "libguile-yamlpp.so=
: cannot open shared object file: No such file or directory"
=2D-8<---------------cut here---------------end--------------->8---

Have a nice day,
Tomas

=2D-=20
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmdEuMEOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wanAZQ//X6YPkDpbrYK/OljWuxU70D6EC9+jQTkv1I4V
3mofSAWGP/D2PTFr5A+2lyLDKmzu68HqP+KNiRSjXBFwxr5hot50ZDNKPZdNc4My
elkVUgUmYYVzO33Zyu+nZYsXjZO4B7JzylMOsJ0QbxCSI3aOF9NPeP6h7TN+ReJi
B22XDz+gXOMJNFYBsUMSAK/ZvSyejenr8yTLQ1/EO+IVHV+dC8qeHSlMGPX2rm90
fCA0YHPlK5pEql4osigorvevsihONEyfKENCIZ0p2gg2MWsHAEHNteqy2KGFrwjB
WC9rQgtbekwvHJcEf1FSL7W/CQRCUc6Zrn1of4D0WQ1hoOS2HTyre9Peny8j453G
AYFDZw6Iq4KZG7Som4R0ME7sQNGoMpV1Il5JJcPEr2TFF2xpm4tGLPWBYKrBSa1M
FLU2vBzbI9GC0L3f3pKEojPI47eY3OjMp5nRYALr32S5xXOn/TrJQMMyXIUX0M7G
aip8e9l5UK0r76AgDaaou7Vqpx622JIVn8PvOZ5RfOsiJ0tXWGW6ZG2VV6Iv2/KY
hl+Ozars2cZXk/JAVgbA2HZ/9oi3CloFFfO6pKLkXfVo5Jl/Me2dcI2rPOeKAtnw
vC5UqsEjErXfjpI1CKtqaww5JoZM52dslbk8RzczbyUJN5HhNkuOG2sSXKI47kYb
A45WS50=
=LC0N
-----END PGP SIGNATURE-----
--=-=-=--




Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#74532; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 1 Apr 2025 20:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.