From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 06:49:48 2024 Received: (at submit) by debbugs.gnu.org; 15 Sep 2024 10:49:49 +0000 Received: from localhost ([127.0.0.1]:48510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spmpA-0004HI-Dc for submit@debbugs.gnu.org; Sun, 15 Sep 2024 06:49:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:35386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spmp7-0004HA-S8 for submit@debbugs.gnu.org; Sun, 15 Sep 2024 06:49:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spmov-0003xg-Rh for bug-guix@gnu.org; Sun, 15 Sep 2024 06:49:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spmou-0007Zo-HJ for bug-guix@gnu.org; Sun, 15 Sep 2024 06:49:33 -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:Subject:To:From:in-reply-to: references; bh=3k+PbTCmTZ5+p43gqp6WIOEE5pjbqjdClOaK4Efcy2U=; b=CdNJEBYmpFExKr Z74zN2ibHtobgH+K29w9V4UmVWSEzRa9Z3LQZogcAEaZlBz1c3VynLX92IxzViyle6Veqrqz4BG3T 0N5ElVmYXEtG+D1m6lAm7DvHYV12dxJJvKYgs4c5OiFZFKfNgASWoYB1XgDySPoaJyDfQDuYBdanf TO9xmFVBV/1EWyRiZyNlMAW96Ybk1y2VjWrt3GmagymlGhH7LzoZIjeRGYrs0qtF5i3Dk3Zm1ai0X DEAI20z2vOs6/3ROhevqVoQfcz0wKVz6o2LlGU+EGsiMtk6WYxXqi0RRCBHMfvD4GUlk3lqr/YSS9 Oba4WZsLJ8zYGdpgJ0ug==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guix@gnu.org Subject: =?utf-8?Q?=E2=80=98with-imported-modules=E2=80=99?= fails to cope with dangling symlinks X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 30 Fructidor an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Panier 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: Sun, 15 Sep 2024 12:49:30 +0200 Message-ID: <87jzfdchtx.fsf@inria.fr> 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: 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: -3.3 (---) Consider this code, which uses =E2=80=98with-imported-modules=E2=80=99 with= a computed module =E2=80=98foo=E2=80=99 (thereby leading to the creation of a =E2=80= =9Cmodule-import=E2=80=9D derivation, via =E2=80=98imported-files/derivation=E2=80=99): --8<---------------cut here---------------start------------->8--- (use-modules (guix)) (pk (stat:type (lstat (search-path %load-path "guix/base16.scm")))) (let* ((foo (scheme-file "foo.scm" #~(define-module (foo)))) (bar (scheme-file "bar.scm" (with-imported-modules `((guix base16) ((foo) =3D> ,foo)) #~(begin (use-modules (guix base16) (foo)) (pk 'hi!)))))) (with-store store (run-with-store store (mlet %store-monad ((drv (lower-object bar))) (built-derivations (list (pk 'drv drv))))))) --8<---------------cut here---------------end--------------->8--- It works fine in =E2=80=9Cnormal=E2=80=9D conditions: --8<---------------cut here---------------start------------->8--- $ guile imported-modules-dangling-symlink.scm ;;; (regular) ;;; (drv # /gnu/store/px8b5453gspxbjixi33x96hjm558s6gk-bar.scm 7f6f88c84f50>) --8<---------------cut here---------------end--------------->8--- But it fails when running from a profile: --8<---------------cut here---------------start------------->8--- $ guix shell -CWP guile guix -- guile imported-modules-dangling-symlink.scm ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/ludo/src/guix-debugging/imported-modules-dangling-symli= nk.scm ;;; compiled /home/ludo/.cache/guile/ccache/3.0-LE-8-4.7/home/ludo/src/guix= -debugging/imported-modules-dangling-symlink.scm.go ;;; (symlink) ;;; (drv # /gnu/store/a1sz94kb0h1n0k238w49bw4zdrrhml6h-bar.scm 7fce7f287640>) building path(s) `/gnu/store/qmxv9mavj48jmqb3x4ayq2a2q948kd40-module-import= -compiled' [ 1/ 4] Loading './foo.scm'... Backtrace: 6 (primitive-load "/gnu/store/9c5vjhqsjxkg5fvaxhxz14w6ms3?") In ice-9/eval.scm: 619:8 5 (_ #f) In srfi/srfi-1.scm: 460:18 4 (fold # ?) 460:18 3 (fold # ?) In ice-9/eval.scm: 245:16 2 (_ #(#(#) # ?)) In ice-9/boot-9.scm: 1982:24 1 (_ _) In unknown file: 0 (stat "./guix/base16.scm" #) ERROR: In procedure stat: In procedure stat: No such file or directory: "./guix/base16.scm" builder for `/gnu/store/f3w43lq1wfq35dym2r48sav22x4l88dh-module-import-comp= iled.drv' failed with exit code 1 cannot build derivation `/gnu/store/8r2vh6x599i82gf9rphfxldaiyr67glq-bar.sc= m.drv': 1 dependencies couldn't be built Backtrace: In ice-9/boot-9.scm: 1755:12 11 (with-exception-handler _ _ #:unwind? _ # _) In unknown file: 10 (apply-smob/0 #) In ice-9/boot-9.scm: 724:2 9 (call-with-prompt _ _ #) In ice-9/eval.scm: 619:8 8 (_ #(#(#))) In ice-9/boot-9.scm: 2858:4 7 (save-module-excursion _) 4408:12 6 (_) 1755:12 5 (with-exception-handler _ _ #:unwind? _ # _) In guix/store.scm: 689:37 4 (thunk) 2210:25 3 (run-with-store # ?) 2082:38 2 (_ #) 1449:15 1 (_ # _ _) In ice-9/boot-9.scm: 1676:22 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1676:22: In procedure raise-exception: ERROR: 1. &store-protocol-error: message: "build of `/gnu/store/8r2vh6x599i82gf9rphfxldaiyr67glq-bar.s= cm.drv' failed" status: 100 --8<---------------cut here---------------end--------------->8--- The key difference is that, in the profile, =E2=80=98guix/base16.scm=E2=80= =99 is a symlink and the import machinery ends up inserting a dangling symlink in the store: --8<---------------cut here---------------start------------->8--- $ guix gc --references /gnu/store/f3w43lq1wfq35dym2r48sav22x4l88dh-module-i= mport-compiled.drv /gnu/store/3w29f4qjbap3awsi7yngnp2l1zvb5gbc-module-import.drv /gnu/store/4ah6s53jjfmcqnly3mdgh8zpkk0jyz28-guile-3.0.9.drv /gnu/store/9c5vjhqsjxkg5fvaxhxz14w6ms317wsg-compile-modules /gnu/store/c1qxdflcdb2hv4rjglap3qb5jfqhs72r-build-utils.scm $ guix gc --references /gnu/store/3w29f4qjbap3awsi7yngnp2l1zvb5gbc-module-i= mport.drv /gnu/store/4ah6s53jjfmcqnly3mdgh8zpkk0jyz28-guile-3.0.9.drv /gnu/store/c1qxdflcdb2hv4rjglap3qb5jfqhs72r-build-utils.scm /gnu/store/g0660kdr7n20927cxx2pmmr9dyj4l4q4-foo.scm.drv /gnu/store/mg756z8cykpz9szdk71c5zchyymyl2br-module-import-builder /gnu/store/nkz7k36n9i7qwvwk7ayyd9sq4ssdghxh-base16.scm $ ls -l /gnu/store/nkz7k36n9i7qwvwk7ayyd9sq4ssdghxh-base16.scm lrwxrwxrwx 1 root root 102 Jan 1 1970 /gnu/store/nkz7k36n9i7qwvwk7ayyd9sq= 4ssdghxh-base16.scm -> /gnu/store/jk9pi1qk158zdmnh4q3nzp3l53cvzhnk-guix-1.4= .0-24.9a2ddcc/share/guile/site/3.0/guix/base16.scm $ guix gc --references /gnu/store/nkz7k36n9i7qwvwk7ayyd9sq4ssdghxh-base16.s= cm | grep base16 $ echo $? 1 --8<---------------cut here---------------end--------------->8--- Note that the symlink is valid when you have a full view of the store, but it=E2=80=99s dangling inside the build environment because that /gnu/store/nkz7k36n9i7qwvwk7ayyd9sq4ssdghxh-base16.scm item doesn=E2=80=99t= have a reference to its target file, as shown by =E2=80=98guix gc --references= =E2=80=99. There=E2=80=99s no such problem on regular imports as created by =E2=80=98imported-files=E2=80=99. This is sorta similar to the issue discussed in . Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 18:26:28 2024 Received: (at 73275-done) by debbugs.gnu.org; 15 Sep 2024 22:26:28 +0000 Received: from localhost ([127.0.0.1]:50699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spxhM-00011F-7V for submit@debbugs.gnu.org; Sun, 15 Sep 2024 18:26:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spxhK-000112-E4 for 73275-done@debbugs.gnu.org; Sun, 15 Sep 2024 18:26:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spxh2-0003ZL-Mp for 73275-done@debbugs.gnu.org; Sun, 15 Sep 2024 18:26:08 -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=w+Kf29mzWmx1ZB6tyVyq2ojR4wgmC83kiRHaQ79smRs=; b=V0bI3BRzCqzHdIPoMm31 qpoIFuyT6TBQbq8yrarXW5V/nkJM4b/z0+uW6FGQgBcAga/yOpBUIHH7ZsUziaXmY2au1v25vgqZ3 5mWFQVoWysj+Ikmar0dinWXihyUzo72RSqGHZRDDLaJZC8yXT+rGUwkxqctNLLOjLi07aJmh8kMoI cfnNR+kUVr9nTis9I8ZLDxbA82wbHxUgHwhQojMBjVC82ytnUQYpMnMQnbU4m6VK4NrmfCfEvuVDQ p8m2AeW9nE3eyqnwU0gPoG3WfWliydV6N9Hk4dFk2b62j6osdYKJZrbB2P/v6fsXdOLvJ1SG53+gl vRoQZG6jFJiJsQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 73275-done@debbugs.gnu.org Subject: Re: bug#73275: =?utf-8?Q?=E2=80=98with-imported-modules=E2=80=99?= fails to cope with dangling symlinks In-Reply-To: <87jzfdchtx.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Sun, 15 Sep 2024 12:49:30 +0200") References: <87jzfdchtx.fsf@inria.fr> Date: Mon, 16 Sep 2024 00:26:05 +0200 Message-ID: <87ttega70i.fsf@gnu.org> 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: 73275-done 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: -3.3 (---) Ludovic Court=C3=A8s skribis: > $ guix shell -CWP guile guix -- guile imported-modules-dangling-symlink.s= cm > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /home/ludo/src/guix-debugging/imported-modules-dangling-sym= link.scm > ;;; compiled /home/ludo/.cache/guile/ccache/3.0-LE-8-4.7/home/ludo/src/gu= ix-debugging/imported-modules-dangling-symlink.scm.go > > ;;; (symlink) > > ;;; (drv # /gnu/store/a1sz94kb0h1n0k238w49bw4zdrrhml6h-bar.scm 7fce7f287640>) > building path(s) `/gnu/store/qmxv9mavj48jmqb3x4ayq2a2q948kd40-module-impo= rt-compiled' > [ 1/ 4] Loading './foo.scm'... > Backtrace: > 6 (primitive-load "/gnu/store/9c5vjhqsjxkg5fvaxhxz14w6ms3?") > In ice-9/eval.scm: > 619:8 5 (_ #f) > In srfi/srfi-1.scm: > 460:18 4 (fold # ?) > 460:18 3 (fold # ?) > In ice-9/eval.scm: > 245:16 2 (_ #(#(#) # ?)) > In ice-9/boot-9.scm: > 1982:24 1 (_ _) > In unknown file: > 0 (stat "./guix/base16.scm" #) > > ERROR: In procedure stat: > In procedure stat: No such file or directory: "./guix/base16.scm" > builder for `/gnu/store/f3w43lq1wfq35dym2r48sav22x4l88dh-module-import-co= mpiled.drv' failed with exit code 1 Fixed in a7bb45b39d7d698e0868c2b3ac9097b70ef9d401. The trick is that =E2=80=98imported-files/derivation=E2=80=99 should copy f= iles instead of symlinking them. As noted in the commit log, I believe this was the original intent but due to a typo it did not work that way. Ludo=E2=80=99. From unknown Sun Jun 15 08:48:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 14 Oct 2024 11:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator