From unknown Sat Jun 14 14:26:47 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#47084 <47084@debbugs.gnu.org> To: bug#47084 <47084@debbugs.gnu.org> Subject: Status: Guile 3.0 - The module-use! 'target' functionality is broken Reply-To: bug#47084 <47084@debbugs.gnu.org> Date: Sat, 14 Jun 2025 21:26:47 +0000 retitle 47084 Guile 3.0 - The module-use! 'target' functionality is broken reassign 47084 guile submitter 47084 David Pirotte severity 47084 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 11 22:17:55 2021 Received: (at submit) by debbugs.gnu.org; 12 Mar 2021 03:17:55 +0000 Received: from localhost ([127.0.0.1]:55754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKYJH-000730-GM for submit@debbugs.gnu.org; Thu, 11 Mar 2021 22:17:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:59784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKYJF-00072t-Aj for submit@debbugs.gnu.org; Thu, 11 Mar 2021 22:17:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKYJF-000654-5h for bug-guile@gnu.org; Thu, 11 Mar 2021 22:17:53 -0500 Received: from maximusconfessor.all2all.org ([79.99.200.102]:50164) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKYJC-0004xf-I4 for bug-guile@gnu.org; Thu, 11 Mar 2021 22:17:52 -0500 Received: from localhost (localhost [127.0.0.1]) by maximusconfessor.all2all.org (Postfix) with ESMTP id AF9BB1BE009D for ; Fri, 12 Mar 2021 04:17:46 +0100 (CET) Received: from maximusconfessor.all2all.org ([127.0.0.1]) by localhost (maximusconfessor.all2all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FWtGKFOa3gYB for ; Fri, 12 Mar 2021 04:17:46 +0100 (CET) Received: from aicha (unknown [179.210.52.91]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 1A1101BE009C for ; Fri, 12 Mar 2021 04:17:45 +0100 (CET) Date: Fri, 12 Mar 2021 00:17:38 -0300 From: David Pirotte To: Subject: Guile 3.0 - The module-use! 'target' functionality is broken Message-ID: <20210312001738.32a82355@aicha> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/q=6osq4q65TRlAZFGTm+8zC"; protocol="application/pgp-signature"; micalg=pgp-sha512 Received-SPF: pass client-ip=79.99.200.102; envelope-from=david@altosw.be; helo=maximusconfessor.all2all.org X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --Sig_/q=6osq4q65TRlAZFGTm+8zC Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello, Guile 3.0 The module-use! 'target' functionality is broken The code of module-use! itself didn't change, and call(s) to the procedure work(s) fine, but the functionality it is supposed to provide is broken. To reproduce, save the following minimalist module somewhere: ;; start here (define-module (a) #:use-module (srfi srfi-1)) (eval-when (expand load eval) (module-use! (module-public-interface (current-module)) (resolve-interface '(srfi srfi-1)))) ;; end here ;; then, fire a 3.0 repl: (add-to-load-path "/your/path") ,use (a) map [ below, my attempts using Guile 3.0.4.3-e076a5, then Guile [ 2.2.7.2-a5875-dirty to compare. Fwiw: (a) G-Golf extensively relies on the module-use! functionality 'in general', and in particular, on its 'dynamic' implementation - that is, the public interface of a module that has been 'module-used' may evolve in time (at the 'essence' of any GI dynamic binding); (b) just like for the minimalist module (a) above, but it will do so 'dynamically', G-Golf needs that the public interface of a module that has been 'module-used' may re-export-and-replace a guile core procedure (generally promoted as a generic function, with the core proc as its default method). Thanks, David GNU Guile 3.0.4.3-e076a5 ... scheme@(guile-user)> (add-to-load-path "/home/david/alto/projects/g-golf/3.= 0") scheme@(guile-user)> ,use (a) ;;; compiling /home/david/alto/projects/g-golf/3.0/a.scm ;;; compiled /home/david/.cache/guile/ccache/3.0-LE-8-4.3/usr/alto/projects= /g-golf/3.0/a.scm.go scheme@(guile-user)> map WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) ;;; : warning: possibly unbound variable `map' WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) ice-9/boot-9.scm:1670:16: In procedure raise-exception: Unbound variable: map Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> GNU Guile 2.2.7.2-a5875-dirty ... scheme@(guile-user)> (add-to-load-path "/home/david/alto/projects/g-golf/3.= 0") scheme@(guile-user)> ,use (a) ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/david/alto/projects/g-golf/3.0/a.scm ;;; compiled /home/david/.cache/guile/ccache/2.2-LE-8-3.A/usr/alto/projects= /g-golf/3.0/a.scm.go scheme@(guile-user)> map $2 =3D # --Sig_/q=6osq4q65TRlAZFGTm+8zC Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAmBK3VIACgkQ83T9k6MF etelRAf/Wm+OrqypHz6bHXJMG4x231PuD0iJuZkbeM6m77ePb7Qq7G7EcVplULVX e9YmErj8LV3Q81a2Brw2qDrFMryrvnPcDyzY7k3ZVtlh6XTg+QfcXw9VGIWpkTbQ 15MjmgCHewurRe7Ngpqud9mD83u+IUI9r6D27yjMQ9n9wFpjXRjBQWuITrTD0U2R hijumBuzVQkLYKo2xef2YbG07AvZMqiCtO80VCvqsGv1Pg8Vrzc0N9g72AOrWBlq RAfi8iPLG9I8H3cNoTRIx4i/6cui1stR0LprPi8N4tinHI4oKX8ywDeXIbd7p+FM GsbXb8h5zllcoKAj3uCNbjBmsOMY8g== =c0Zx -----END PGP SIGNATURE----- --Sig_/q=6osq4q65TRlAZFGTm+8zC-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 00:26:55 2021 Received: (at 47084) by debbugs.gnu.org; 3 May 2021 04:26:55 +0000 Received: from localhost ([127.0.0.1]:45995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldQAY-00072J-R2 for submit@debbugs.gnu.org; Mon, 03 May 2021 00:26:55 -0400 Received: from maximusconfessor.all2all.org ([79.99.200.102]:36556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldQAT-00072D-Ud for 47084@debbugs.gnu.org; Mon, 03 May 2021 00:26:53 -0400 Received: from localhost (localhost [127.0.0.1]) by maximusconfessor.all2all.org (Postfix) with ESMTP id C5E2B1BE0082 for <47084@debbugs.gnu.org>; Mon, 3 May 2021 06:26:48 +0200 (CEST) Received: from maximusconfessor.all2all.org ([127.0.0.1]) by localhost (maximusconfessor.all2all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WfcGueFBdGJl for <47084@debbugs.gnu.org>; Mon, 3 May 2021 06:26:48 +0200 (CEST) Received: from aicha (unknown [179.210.52.91]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 180041BE007F for <47084@debbugs.gnu.org>; Mon, 3 May 2021 06:26:47 +0200 (CEST) Date: Mon, 3 May 2021 01:26:41 -0300 From: David Pirotte To: 47084@debbugs.gnu.org Subject: Re: bug#47084: Guile 3.0 - The module-use! 'target' functionality is broken Message-ID: <20210503012641.38bf8149@aicha> In-Reply-To: <20210312001738.32a82355@aicha> References: <20210312001738.32a82355@aicha> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/IYUQcoFf42bvGZ_KSoQ/t/P"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 47084 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/IYUQcoFf42bvGZ_KSoQ/t/P Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello, > ... > (define-module (a) > #:use-module (srfi srfi-1)) > (eval-when (expand load eval) > (module-use! (module-public-interface (current-module)) > (resolve-interface '(srfi srfi-1)))) > ... Commit 19f38a38fde7da5fbcf29d0ebc4574e993210110 fixes the bug, many thanks. Now, I have a question related to 'new' warnings though - I say 'new' because there are no warnings in 2.2 - for which I don't see how one can resolve those, unless mute them all by calling default-duplicate-binding-handler and remove warn-override-core and warn from the default list. Here is a example, so one can reproduce and maybe give us some hints: ;;; module (a) starts here (define-module (foo) #:use-module (srfi srfi-1)) (eval-when (expand load eval) (module-use! (module-public-interface (current-module)) (resolve-interface '(srfi srfi-1)))) (for-each display '(1 2 3 4)) (newline) ;;; module (foo) ends here ;;; file bar.scm starts here - not a module, just a file (use-modules (foo)) #;(eval-when (expand load eval) (default-duplicate-binding-handler '(replace last))) (for-each display '(5 6 7 8)) (newline) ;; drop the two above module/file somwhere ;;; now, fire geiser and (add-to-load-path "/your/path") (load "/your/path/bar.scm") ;; you should see that there is no warning 'from (foo)', but two ;; warnings WARNING: (guile-user): imported module (a) overrides core binding `for-each' ;; 'from the bar.scm file (one when it compiles, one when it 'runs' ... ;; if you start a new session, then there should be one warning only ... Now, if we uncomment the eval-when in bar.scm and try again, all is fine But i wish the module-use! interface/internals would be enhanced so that it does the same thing for module-use! then what is done simply using #:use-module... and allow us to keep warn-override-core and warn in the default-duplicate-binding-handler list ... not sure i made myself clear, but trying :) David --Sig_/IYUQcoFf42bvGZ_KSoQ/t/P Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAmCPe4EACgkQ83T9k6MF etfs+QgAo+HZNZ1t/yJmVVMXp1KY6ZLAzNNcyGZUDW3v5MJ+SlmcP8ZygwZqujBo su0TmB0TbsfmLaPF54tEamDHS4nibH8rBOB0/XZ1gUzFjXBhoeb8jZyPHrJ3Xsts 49kESpU5tOktphVjC5i/sgBkMGgFc95MhTItc1Ff2JNZxWCEvi6SBAr3GDjvUggr +i2SKUKMJzk/IUmlrZB0u/30CBRMTH2fzcOQ0i73b0EmWoLaLW0kUViP/Py9cyjh B10s+tDyFSc1IY+h4FW29dOHw1zthG4xW48UBJyuI571NbzfjJ4QoISl9YodRTvN B3T+A3g3RvUh9gv1yk5jU2krCIPWUw== =zVa7 -----END PGP SIGNATURE----- --Sig_/IYUQcoFf42bvGZ_KSoQ/t/P-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 00:37:44 2021 Received: (at 47084) by debbugs.gnu.org; 4 May 2021 04:37:44 +0000 Received: from localhost ([127.0.0.1]:50652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldmoa-0003vp-Hv for submit@debbugs.gnu.org; Tue, 04 May 2021 00:37:44 -0400 Received: from maximusconfessor.all2all.org ([79.99.200.102]:50800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldmoY-0003vd-Jp for 47084@debbugs.gnu.org; Tue, 04 May 2021 00:37:43 -0400 Received: from localhost (localhost [127.0.0.1]) by maximusconfessor.all2all.org (Postfix) with ESMTP id E2B411BE008D for <47084@debbugs.gnu.org>; Tue, 4 May 2021 06:37:40 +0200 (CEST) Received: from maximusconfessor.all2all.org ([127.0.0.1]) by localhost (maximusconfessor.all2all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MQuQmWqLXEgI for <47084@debbugs.gnu.org>; Tue, 4 May 2021 06:37:40 +0200 (CEST) Received: from aicha (unknown [179.210.52.91]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 06EFB1BE0082 for <47084@debbugs.gnu.org>; Tue, 4 May 2021 06:37:39 +0200 (CEST) Date: Tue, 4 May 2021 01:37:33 -0300 From: David Pirotte To: 47084@debbugs.gnu.org Subject: Re: bug#47084: Guile 3.0 - The module-use! 'target' functionality is broken Message-ID: <20210504013733.7a430349@aicha> In-Reply-To: <20210503012641.38bf8149@aicha> References: <20210312001738.32a82355@aicha> <20210503012641.38bf8149@aicha> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/XjI/uVs57s9l8RZ11Vn+5o="; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 47084 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/XjI/uVs57s9l8RZ11Vn+5o= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello, > ... > Commit 19f38a38fde7da5fbcf29d0ebc4574e993210110 fixes the > bug, many thanks. > Now, I have a question related to 'new' warnings though - I say 'new' > because there are no warnings in 2.2 - for which I don't see how one > can resolve those, unless mute them all by calling > default-duplicate-binding-handler and remove warn-override-core > and warn from the default list. The proper way to stop these warnings is to add a #:re-export-and-replace clause to the module definition of the module that calls module-use! - I didn't think I had to do this because we didn't have to using 2.2 (nor #:re-export nor #:replace, within the context of module-use! that is, and the #:re-export-and-replace clause is new to 3.0) - like this: ;;; module (a) starts here (define-module (foo) #:use-module (srfi srfi-1)) #:re-export-and-replace (for-each)) (eval-when (expand load eval) (module-use! (module-public-interface (current-module)) (resolve-interface '(srfi srfi-1)))) ;;; module (foo) ends here Now the (bar) module or bar.scm file example file may skip the call to default-duplicate-binding-handler: ;;; file bar.scm starts here (use-modules (foo)) =20 (for-each display '(5 6 7 8)) (newline) ;; file bar.scm stops here=20 ;; drop the two above module/file somwhere ;;; now, fire geiser and (add-to-load-path "/your/path") (load "/your/path/bar.scm") ;; you shouldn't see any warnings anymore... David --Sig_/XjI/uVs57s9l8RZ11Vn+5o= Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAmCQz40ACgkQ83T9k6MF etcpRAgAj/SKV/YeVKJARCAiOTJ0hvEaT4rDUaZG3l/gnVWLdNu6JBbkkEggqdQ3 J+WMI4PfgeNTVwx+uqx6WSX6/10R19v+Qgpkb0EPcXrlBgPj1mybcgUO6kW97t8l X9aAVu3+7/ffxDjw8LMM+yIyhFk3zksDX56vqx6eFJ0aGp6c9ek0ApgtFLsK0txE Y+Fh9Hkk+cIlqPl9Nn0cHkpfJBbxW7A03cV0tO5G0wDz16HzxEV+cIBSlZsIYIQf 0zK9oceptBQPvjeJc3HqfMlkuQ1+M96V+G5eBtpUOOBpLSqqv9JhaRFkBAbFmp7G KTHXZS4bLeaUQDYWPnJCd27KuWQT8g== =Lroi -----END PGP SIGNATURE----- --Sig_/XjI/uVs57s9l8RZ11Vn+5o=--