From unknown Thu Sep 11 07:55:01 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#41028 <41028@debbugs.gnu.org> To: bug#41028 <41028@debbugs.gnu.org> Subject: Status: Today's Guile 3 'core-updates' cannot pull yesterday's 2.2 master Reply-To: bug#41028 <41028@debbugs.gnu.org> Date: Thu, 11 Sep 2025 14:55:01 +0000 retitle 41028 Today's Guile 3 'core-updates' cannot pull yesterday's 2.2 ma= ster reassign 41028 guix submitter 41028 Christopher Baines severity 41028 important thanks From debbugs-submit-bounces@debbugs.gnu.org Sat May 02 11:48:01 2020 Received: (at submit) by debbugs.gnu.org; 2 May 2020 15:48:01 +0000 Received: from localhost ([127.0.0.1]:53727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUuMy-0004X3-OV for submit@debbugs.gnu.org; Sat, 02 May 2020 11:48:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:38760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUuMw-0004Wt-Ab for submit@debbugs.gnu.org; Sat, 02 May 2020 11:47:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUuMv-0002xI-OO for bug-guix@gnu.org; Sat, 02 May 2020 11:47:58 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUuMu-0000d9-Kk for bug-guix@gnu.org; Sat, 02 May 2020 11:47:57 -0400 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]:56375) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUuMu-0000cq-6v for bug-guix@gnu.org; Sat, 02 May 2020 11:47:56 -0400 Received: from localhost (unknown [46.237.174.129]) by mira.cbaines.net (Postfix) with ESMTPSA id 3F9A827BBE1 for ; Sat, 2 May 2020 16:47:54 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id f3f8f022 for ; Sat, 2 May 2020 15:47:51 +0000 (UTC) User-agent: mu4e 1.2.0; emacs 26.3 From: Christopher Baines To: bug-guix@gnu.org Subject: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread Date: Sat, 02 May 2020 16:47:49 +0100 Message-ID: <87h7wymj8a.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 10:44:43 X-ACL-Warn: Detected OS = ??? X-Received-From: 2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27 X-Spam-Score: -1.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: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Noticed this when testing guix system build with core-updates. Here's a small example which reproduces the issue: (use-modules (guix channels) (guix inferior)) (define channels (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "e02c2f85b36ce1c733bd908a210ce1182bdd2560")))) (define inferior (inferior-for-channels channels)) (first (lookup-inferior-packages inferior "linux-libre" "5.2.21")) If you save that as a file then attempt to build it: =E2=86=92 guix build -f test.scm=20 Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.or= g/git/guix.git'... Backtrace: 4 (primitive-load "/gnu/store/8mv5bpjgxg9c369xnbb5rf1kv9r?") In ice-9/eval.scm: 619:8 3 (_ #(#(#(#(#(#(#(#(#(#(#(?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) 182:19 2 (proc #(#(#(#(#(#(#(#(#(#(# ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) 142:16 1 (compile-top-call # ?) In unknown file: 0 (%resolve-variable (7 . call-with-new-thread) #) ERROR: In procedure %resolve-variable: Unbound variable: call-with-new-thread guix build: error: You found a bug: the program '/gnu/store/8mv5bpjgxg9c369= xnbb5rf1kv9r6z5hw-compute-guix-derivation' failed to compute the derivation for Guix (version: "e02c2f85b36ce1c733bd90= 8a210ce1182bdd2560"; system: "x86_64-linux"; host version: "a8cb1e72ef351330d1521833c1b270dcc0da593f"; pull-version: 1). Please report it by email to . --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl6tliVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfE1g/9H69j+hNwEfbN/lS3gA5ErpkPvI85iRIyKwEDLKSu6PcjalvwsXdnSM4l 9JC6kTFJiWpBGnXnYTiwLP8D/LGo6XBNyqVw0nbtsB8MQlR1DxMOo4aHroOMzAFv POoSdVvVuDK+tNY/XePiI8fk67hZ7wWor83WUueL355d3vSVZvmyWQia1z2tx6DW k8Pb5rmCY+/KX3kxh7T2LTLUAZcnP78zUKiJVujnzYgci9++cmbsfe2svj0juwgg 1Aqu+zKx+kfjMaHHEfak/a9DGwh0K13u+Qf80d5kIb8+lFkPCbZDcIcjT4AG2dQ3 GZcXSCNnOjJQBH9jtCikvNgUOA5b47nwuAxSb9APVlTdSWwiJZk7JcnIBFhm8Koz mPOFIILKirErKkPlBsDX/eiOnL/jkcNzfCpfcjMQn5lcVry6thXVwnW9992KnCLM E1CuH/oo9emLLfmVDW4PrFBHma0zJ6cjw4mmP4t8P20JXuhPWMPVqMoTaxy2UGj6 1kJQ9tH+vBoI5KuOYFZkXzz4JMqPkUDJWyDmJx/XtSZBGpXutXz56+yNO/djK1N3 4H+D7/DUciigdznofDVwefqfSi7j3F3zJcrwz40H1eb8C8Wmn2WxPkDdMUjQt5G1 bQxMQ27JEdTWzjE8VmxWdaZR81pl45WAg3DTVpBmNr8qYpnD6y0= =AyHo -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 05 15:34:49 2020 Received: (at control) by debbugs.gnu.org; 5 May 2020 19:34:49 +0000 Received: from localhost ([127.0.0.1]:37606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jW3L7-0004vw-9G for submit@debbugs.gnu.org; Tue, 05 May 2020 15:34:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jW3L6-0004vR-2X for control@debbugs.gnu.org; Tue, 05 May 2020 15:34:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34393) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jW3L0-0001Ss-RW for control@debbugs.gnu.org; Tue, 05 May 2020 15:34:42 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=58384 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jW3Kz-0003l4-Ok for control@debbugs.gnu.org; Tue, 05 May 2020 15:34:42 -0400 Date: Tue, 05 May 2020 21:34:40 +0200 Message-Id: <87368ekwfj.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #41028 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) severity 41028 important quit From debbugs-submit-bounces@debbugs.gnu.org Tue May 05 17:24:39 2020 Received: (at 41028) by debbugs.gnu.org; 5 May 2020 21:24:39 +0000 Received: from localhost ([127.0.0.1]:37739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jW53J-0001UA-3o for submit@debbugs.gnu.org; Tue, 05 May 2020 17:24:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jW53H-0001Tr-CE for 41028@debbugs.gnu.org; Tue, 05 May 2020 17:24:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36759) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jW53C-0006n7-3k; Tue, 05 May 2020 17:24:26 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=58774 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jW53A-0000Jb-G4; Tue, 05 May 2020 17:24:25 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Subject: Re: bug#41028: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread References: <87h7wymj8a.fsf@cbaines.net> Date: Tue, 05 May 2020 23:24:22 +0200 In-Reply-To: <87h7wymj8a.fsf@cbaines.net> (Christopher Baines's message of "Sat, 02 May 2020 16:47:49 +0100") Message-ID: <87r1vyjcs9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41028 Cc: 41028@debbugs.gnu.org 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 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey! Christopher Baines skribis: > =E2=86=92 guix build -f test.scm=20 > Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.= org/git/guix.git'... > Backtrace: > 4 (primitive-load "/gnu/store/8mv5bpjgxg9c369xnbb5rf1kv9r?") > In ice-9/eval.scm: > 619:8 3 (_ #(#(#(#(#(#(#(#(#(#(#(?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) > 182:19 2 (proc #(#(#(#(#(#(#(#(#(#(# ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) > 142:16 1 (compile-top-call # ?) > In unknown file: > 0 (%resolve-variable (7 . call-with-new-thread) #) > > ERROR: In procedure %resolve-variable: > Unbound variable: call-with-new-thread > guix build: error: You found a bug: the program '/gnu/store/8mv5bpjgxg9c3= 69xnbb5rf1kv9r6z5hw-compute-guix-derivation' > failed to compute the derivation for Guix (version: "e02c2f85b36ce1c733bd= 908a210ce1182bdd2560"; system: "x86_64-linux"; > host version: "a8cb1e72ef351330d1521833c1b270dcc0da593f"; pull-version: 1= ). A summary of the IRC discussion and experiments: 1. The underlying problem is a missing (ice-9 threads) import in the =E2=80=98compute-guix-derivation=E2=80=99 script, fixed in 05e783871c2c69b402e088863d46f5be7915ac74. 2. The =E2=80=98%quirks=E2=80=99 mechanism in (guix channels) doesn=E2=80= =99t work as is here because what we would need to change is the #:guile parameter passed to =E2=80=98gexp->script=E2=80=99 (the one defined in build-sel= f.scm). Attached a patch to add a quirk but that doesn=E2=80=99t solve the pro= blem. Possible solutions include: a. Changing the value returned by =E2=80=98default-guile=E2=80=99 as used= by =E2=80=98gexp->script=E2=80=99. b. Supporting the definition of quirks that patch the code. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/channels.scm b/guix/channels.scm index 041fae2a9c..cbb0a97546 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -328,16 +328,34 @@ to '%package-module-path'." #f (apply throw args))))) +(define (missing-ice-9-threads-import? source) + "Return true of %SELF-BUILD-FILE is missing an (ice-9 threads) import as +described at ." + (define content + (call-with-input-file (string-append source "/" %self-build-file) + read-string)) + + ;; The faulty code uses 'call-with-new-thread' without importing (ice-9 + ;; threads). However, the 'call-with-new-thread' binding is no longer + ;; available in the default name space on Guile 3.0. + (and (string-contains content "(call-with-new-thread") + (not (string-contains content "(ice-9 threads)")))) + (define (guile-2.2.4) (module-ref (resolve-interface '(gnu packages guile)) 'guile-2.2.4)) +(define (guile-2.2) + (module-ref (resolve-interface '(gnu packages guile)) + 'guile-2.2)) + (define %quirks ;; List of predicate/package pairs. This allows us provide information ;; about specific Guile versions that old Guix revisions might need to use ;; just to be able to build and run the trampoline in %SELF-BUILD-FILE. See ;; - `((,syscalls-reexports-local-variables? . ,guile-2.2.4))) + `((,syscalls-reexports-local-variables? . ,guile-2.2.4) + (,missing-ice-9-threads-import? . ,guile-2.2))) (define* (guile-for-source source #:optional (quirks %quirks)) "Return the Guile package to use when building SOURCE or #f if the default @@ -372,32 +390,32 @@ package modules under SOURCE using CORE, an instance of Guix." (string-append source "/" %self-build-file)) (if (file-exists? script) - (let ((build (save-module-excursion - (lambda () - ;; Disable deprecation warnings; it's OK for SCRIPT to - ;; use deprecated APIs and the user doesn't have to know - ;; about it. - (parameterize ((guix-warning-port - (%make-void-port "w"))) - (primitive-load script))))) - (guile (guile-for-source source))) + (mlet* %store-monad ((guile -> (guile-for-source source)) + (_ (mwhen guile + (set-guile-for-build (pk 'G guile)))) + (build -> (save-module-excursion + (lambda () + ;; Disable deprecation warnings; it's + ;; OK for SCRIPT to use deprecated + ;; APIs and the user doesn't have to + ;; know about it. + (parameterize ((guix-warning-port + (%make-void-port "w"))) + (primitive-load script)))))) ;; BUILD must be a monadic procedure of at least one argument: the ;; source tree. ;; ;; Note: BUILD can return #f if it does not support %PULL-VERSION. In ;; the future we'll fall back to a previous version of the protocol ;; when that happens. - (mbegin %store-monad - (mwhen guile - (set-guile-for-build guile)) - ;; BUILD is usually quite costly. Install a "trivial" build handler - ;; so we don't bounce an outer build-accumulator handler that could - ;; cause us to redo half of the BUILD computation several times just - ;; to realize it gives the same result. - (with-trivial-build-handler - (build source #:verbose? verbose? #:version commit - #:pull-version %pull-version)))) + ;; BUILD is usually quite costly. Install a "trivial" build handler + ;; so we don't bounce an outer build-accumulator handler that could + ;; cause us to redo half of the BUILD computation several times just + ;; to realize it gives the same result. + (with-trivial-build-handler + (build source #:verbose? verbose? #:version commit + #:pull-version %pull-version))) ;; Build a set of modules that extend Guix using the standard method. (standard-module-derivation name source core dependencies))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 06 17:42:14 2020 Received: (at 41028) by debbugs.gnu.org; 6 May 2020 21:42:14 +0000 Received: from localhost ([127.0.0.1]:41478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWRnx-00058i-JH for submit@debbugs.gnu.org; Wed, 06 May 2020 17:42:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWRnv-00058U-SB for 41028@debbugs.gnu.org; Wed, 06 May 2020 17:42:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36452) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWRnq-000734-Io; Wed, 06 May 2020 17:42:06 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=34376 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jWRnp-0005wk-Bk; Wed, 06 May 2020 17:42:05 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines , Marius Bakke Subject: Re: bug#41028: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread References: <87h7wymj8a.fsf@cbaines.net> Date: Wed, 06 May 2020 23:42:02 +0200 In-Reply-To: <87h7wymj8a.fsf@cbaines.net> (Christopher Baines's message of "Sat, 02 May 2020 16:47:49 +0100") Message-ID: <87a72kg2qd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41028 Cc: 41028@debbugs.gnu.org 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 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Comrades, Christopher Baines skribis: > (use-modules (guix channels) > (guix inferior)) > > (define channels > (list (channel > (name 'guix) > (url "https://git.savannah.gnu.org/git/guix.git") > (commit > "e02c2f85b36ce1c733bd908a210ce1182bdd2560")))) > > (define inferior > (inferior-for-channels channels)) > > (first (lookup-inferior-packages inferior "linux-libre" "5.2.21")) > > > If you save that as a file then attempt to build it: > > > =E2=86=92 guix build -f test.scm=20 > Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.= org/git/guix.git'... > Backtrace: > 4 (primitive-load "/gnu/store/8mv5bpjgxg9c369xnbb5rf1kv9r?") > In ice-9/eval.scm: > 619:8 3 (_ #(#(#(#(#(#(#(#(#(#(#(?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) > 182:19 2 (proc #(#(#(#(#(#(#(#(#(#(# ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) > 142:16 1 (compile-top-call # ?) > In unknown file: > 0 (%resolve-variable (7 . call-with-new-thread) #) > > ERROR: In procedure %resolve-variable: > Unbound variable: call-with-new-thread The attached patches add a mechanism to patch the Guix source tree, and then use that mechanism to add the missing (ice-9 threads) import. With this I can do: ./pre-inst-env guix time-machine \ --commit=3De02c2f85b36ce1c733bd908a210ce1182bdd2560 -- build linux-lib= re =E2=80=A6 which is a simple way to do what the manifest above was about. If we think a bit long-term, I think the %quirks and %patches mechanisms are a necessary evil. The goal is for =E2=80=98build-self.scm=E2=80=99 to = use as little of the Guix API, as well as Guile APIs that are presumably here to stay. But as we=E2=80=99re already seeing, there are unavoidably incompatibilities that arise here and there. The good news is that we know today how to modify yesterday=E2=80=99s code to work well, or which Guile version to use= to get it to run. Thoughts? Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-channels-Add-latest-channel-instance.patch >From 4ec2c3b5527b2189b3f767a980f80dee3c6717ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 6 May 2020 22:18:52 +0200 Subject: [PATCH 1/3] channels: Add 'latest-channel-instance'. * guix/channels.scm (latest-channel-instance): New procedure. (latest-channel-instances): Use it. --- guix/channels.scm | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index 041fae2a9c..4ffc366d6a 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -199,6 +199,14 @@ description file or its default value." channel INSTANCE." (channel-metadata-dependencies (channel-instance-metadata instance))) +(define (latest-channel-instance store channel) + "Return the latest channel instance for CHANNEL." + (let-values (((checkout commit) + (latest-repository-commit store (channel-url channel) + #:ref (channel-reference + channel)))) + (channel-instance channel commit checkout))) + (define* (latest-channel-instances store channels #:optional (previous-channels '())) "Return a list of channel instances corresponding to the latest checkouts of CHANNELS and the channels on which they depend. PREVIOUS-CHANNELS is a list @@ -224,20 +232,16 @@ of previously processed channels." (G_ "Updating channel '~a' from Git repository at '~a'...~%") (channel-name channel) (channel-url channel)) - (let-values (((checkout commit) - (latest-repository-commit store (channel-url channel) - #:ref (channel-reference - channel)))) - (let ((instance (channel-instance channel commit checkout))) - (let-values (((new-instances new-channels) - (latest-channel-instances - store - (channel-instance-dependencies instance) - previous-channels))) - (values (append (cons channel new-channels) - previous-channels) - (append (cons instance new-instances) - instances)))))))) + (let ((instance (latest-channel-instance store channel))) + (let-values (((new-instances new-channels) + (latest-channel-instances + store + (channel-instance-dependencies instance) + previous-channels))) + (values (append (cons channel new-channels) + previous-channels) + (append (cons instance new-instances) + instances))))))) previous-channels '() ;instances channels)) -- 2.26.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-channels-Add-mechanism-to-patch-checkouts-of-the-gui.patch >From 18f2efd43b824f87b3d3a5dbcba9e8c363798f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 6 May 2020 22:45:31 +0200 Subject: [PATCH 2/3] channels: Add mechanism to patch checkouts of the 'guix channel. * guix/channels.scm (): New record type. (apply-patches): New procedure. (latest-channel-instance)[dot-git?]: New procedure. Use 'update-cached-checkout' and 'add-to-store' instead of 'latest-repository-commit'. Call 'apply-patches' when CHANNEL is the 'guix channel. (%patches): New variable. * guix/git.scm (url+commit->name): Make public. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Mock 'update-cached-checkout' instead of 'latest-repository-commit'. Wrap body in 'with-store' and pass the store to 'latest-channel-instances'. --- guix/channels.scm | 50 +++++++++++++++++++++++++++++++----- guix/git.scm | 1 + tests/channels.scm | 64 ++++++++++++++++++++++++---------------------- 3 files changed, 79 insertions(+), 36 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index 4ffc366d6a..75b53c3a8e 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -199,13 +199,45 @@ description file or its default value." channel INSTANCE." (channel-metadata-dependencies (channel-instance-metadata instance))) -(define (latest-channel-instance store channel) +;; Patch to apply to a source tree. +(define-record-type + (patch predicate application) + patch? + (predicate patch-predicate) ;procedure + (application patch-application)) ;procedure + +(define (apply-patches checkout commit patches) + "Apply the matching PATCHES to CHECKOUT, modifying files in place. The +result is unspecified." + (let loop ((patches patches)) + (match patches + (() #t) + ((($ predicate modify) rest ...) + ;; PREDICATE is passed COMMIT so that it can choose to only apply to + ;; ancestors. + (when (predicate checkout commit) + (modify checkout)) + (loop rest))))) + +(define* (latest-channel-instance store channel + #:key (patches %patches)) "Return the latest channel instance for CHANNEL." + (define (dot-git? file stat) + (and (string=? (basename file) ".git") + (eq? 'directory (stat:type stat)))) + (let-values (((checkout commit) - (latest-repository-commit store (channel-url channel) - #:ref (channel-reference - channel)))) - (channel-instance channel commit checkout))) + (update-cached-checkout (channel-url channel) + #:ref (channel-reference channel)))) + (when (guix-channel? channel) + ;; Apply the relevant subset of PATCHES directly in CHECKOUT. This is + ;; safe to do because 'switch-to-ref' eventually does a hard reset. + (apply-patches checkout commit patches)) + + (let* ((name (url+commit->name (channel-url channel) commit)) + (checkout (add-to-store store name #t "sha256" checkout + #:select? (negate dot-git?)))) + (channel-instance channel commit checkout)))) (define* (latest-channel-instances store channels #:optional (previous-channels '())) "Return a list of channel instances corresponding to the latest checkouts of @@ -337,12 +369,18 @@ to '%package-module-path'." 'guile-2.2.4)) (define %quirks - ;; List of predicate/package pairs. This allows us provide information + ;; List of predicate/package pairs. This allows us to provide information ;; about specific Guile versions that old Guix revisions might need to use ;; just to be able to build and run the trampoline in %SELF-BUILD-FILE. See ;; `((,syscalls-reexports-local-variables? . ,guile-2.2.4))) +(define %patches + ;; Bits of past Guix revisions can become incompatible with newer Guix and + ;; Guile. This variable lists records for the Guix source tree that + ;; apply to the Guix source. + '()) + (define* (guile-for-source source #:optional (quirks %quirks)) "Return the Guile package to use when building SOURCE or #f if the default '%guile-for-build' should be good enough." diff --git a/guix/git.scm b/guix/git.scm index 5fffd429bd..92121156cf 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -40,6 +40,7 @@ with-repository update-cached-checkout + url+commit->name latest-repository-commit commit-difference diff --git a/tests/channels.scm b/tests/channels.scm index f5a7955483..910088ba15 100644 --- a/tests/channels.scm +++ b/tests/channels.scm @@ -135,44 +135,48 @@ (name 'test) (url "test"))) (test-dir (channel-instance-checkout instance--simple))) - (mock ((guix git) latest-repository-commit - (lambda* (store url #:key ref) + (mock ((guix git) update-cached-checkout + (lambda* (url #:key ref) (match url - ("test" (values test-dir 'whatever)) - (_ (values "/not-important" 'not-important))))) - (let ((instances (latest-channel-instances #f (list channel)))) - (and (eq? 2 (length instances)) - (lset= eq? - '(test test-channel) - (map (compose channel-name channel-instance-channel) - instances))))))) + ("test" (values test-dir "caf3cabba9e")) + (_ (values (channel-instance-checkout instance--no-deps) + "abcde1234"))))) + (with-store store + (let ((instances (latest-channel-instances store (list channel)))) + (and (eq? 2 (length instances)) + (lset= eq? + '(test test-channel) + (map (compose channel-name channel-instance-channel) + instances)))))))) (test-assert "latest-channel-instances excludes duplicate channel dependencies" (let* ((channel (channel (name 'test) (url "test"))) (test-dir (channel-instance-checkout instance--with-dupes))) - (mock ((guix git) latest-repository-commit - (lambda* (store url #:key ref) + (mock ((guix git) update-cached-checkout + (lambda* (url #:key ref) (match url - ("test" (values test-dir 'whatever)) - (_ (values "/not-important" 'not-important))))) - (let ((instances (latest-channel-instances #f (list channel)))) - (and (= 2 (length instances)) - (lset= eq? - '(test test-channel) - (map (compose channel-name channel-instance-channel) - instances)) - ;; only the most specific channel dependency should remain, - ;; i.e. the one with a specified commit. - (find (lambda (instance) - (and (eq? (channel-name - (channel-instance-channel instance)) - 'test-channel) - (string=? (channel-commit - (channel-instance-channel instance)) - "abc1234"))) - instances)))))) + ("test" (values test-dir "caf3cabba9e")) + (_ (values (channel-instance-checkout instance--no-deps) + "abcde1234"))))) + (with-store store + (let ((instances (latest-channel-instances store (list channel)))) + (and (= 2 (length instances)) + (lset= eq? + '(test test-channel) + (map (compose channel-name channel-instance-channel) + instances)) + ;; only the most specific channel dependency should remain, + ;; i.e. the one with a specified commit. + (find (lambda (instance) + (and (eq? (channel-name + (channel-instance-channel instance)) + 'test-channel) + (string=? (channel-commit + (channel-instance-channel instance)) + "abc1234"))) + instances))))))) (test-assert "channel-instances->manifest" ;; Compute the manifest for a graph of instances and make sure we get a -- 2.26.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0003-channels-Add-patch-for-https-bugs.gnu.org-41028.patch >From 66e2ef6ae0958fa45e14c3528c767cd84e24a480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 6 May 2020 23:17:47 +0200 Subject: [PATCH 3/3] channels: Add patch for . Without this patch, we couldn't jump from here to commits before 05e783871c2c69b402e088863d46f5be7915ac74 because the 'compute-guix-derivation' script would crash with an unbound-variable error for 'call-with-new-thread'. Fixes . Reported by Christopher Baines . * guix/channels.scm (%bug-41028-patch): New variable. (%patches): Add it. --- guix/channels.scm | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/guix/channels.scm b/guix/channels.scm index 75b53c3a8e..0fa036446c 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -38,6 +38,7 @@ #:select (source-properties->location &error-location &fix-hint)) + #:use-module ((guix build utils) #:select (substitute*)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-2) #:use-module (srfi srfi-9) @@ -375,11 +376,35 @@ to '%package-module-path'." ;; `((,syscalls-reexports-local-variables? . ,guile-2.2.4))) + +(define %bug-41028-patch + ;; Patch for . The faulty code is the + ;; 'compute-guix-derivation' body, which uses 'call-with-new-thread' without + ;; importing (ice-9 threads). However, the 'call-with-new-thread' binding + ;; is no longer available in the default name space on Guile 3.0. + (let () + (define (missing-ice-9-threads-import? source commit) + ;; Return true if %SELF-BUILD-FILE is missing an (ice-9 threads) import. + (define content + (call-with-input-file (string-append source "/" %self-build-file) + read-string)) + + (and (string-contains content "(call-with-new-thread") + (not (string-contains content "(ice-9 threads)")))) + + (define (add-missing-ice-9-threads-import source) + ;; Add (ice-9 threads) import in the gexp of 'compute-guix-derivation'. + (substitute* (string-append source "/" %self-build-file) + (("^ +\\(use-modules \\(ice-9 match\\)\\)") + (object->string '(use-modules (ice-9 match) (ice-9 threads)))))) + + (patch missing-ice-9-threads-import? add-missing-ice-9-threads-import))) + (define %patches ;; Bits of past Guix revisions can become incompatible with newer Guix and ;; Guile. This variable lists records for the Guix source tree that ;; apply to the Guix source. - '()) + (list %bug-41028-patch)) (define* (guile-for-source source #:optional (quirks %quirks)) "Return the Guile package to use when building SOURCE or #f if the default -- 2.26.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 06 17:43:05 2020 Received: (at control) by debbugs.gnu.org; 6 May 2020 21:43:05 +0000 Received: from localhost ([127.0.0.1]:41482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWRon-0005AW-Bo for submit@debbugs.gnu.org; Wed, 06 May 2020 17:43:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWRol-00059u-1b for control@debbugs.gnu.org; Wed, 06 May 2020 17:43:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36469) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWRof-0000Or-P8 for control@debbugs.gnu.org; Wed, 06 May 2020 17:42:57 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=34380 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jWRof-000614-AF for control@debbugs.gnu.org; Wed, 06 May 2020 17:42:57 -0400 Date: Wed, 06 May 2020 23:42:56 +0200 Message-Id: <878si4g2ov.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #41028 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) retitle 41028 Today's Guile 3 'core-updates' cannot pull yesterday's 2.2 master quit From debbugs-submit-bounces@debbugs.gnu.org Thu May 07 04:12:11 2020 Received: (at 41028-done) by debbugs.gnu.org; 7 May 2020 08:12:11 +0000 Received: from localhost ([127.0.0.1]:42007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWbdb-0008AK-8d for submit@debbugs.gnu.org; Thu, 07 May 2020 04:12:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWbda-0008A3-2y for 41028-done@debbugs.gnu.org; Thu, 07 May 2020 04:12:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46344) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWbdU-0005UF-Lr; Thu, 07 May 2020 04:12:04 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35708 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jWbdT-0007bv-T6; Thu, 07 May 2020 04:12:04 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Subject: Re: bug#41028: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread References: <87h7wymj8a.fsf@cbaines.net> <87a72kg2qd.fsf@gnu.org> Date: Thu, 07 May 2020 10:12:02 +0200 In-Reply-To: <87a72kg2qd.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 06 May 2020 23:42:02 +0200") Message-ID: <87k11oduzx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) 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: 41028-done Cc: Marius Bakke , 41028-done@debbugs.gnu.org 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 (---) Hey! Ludovic Court=C3=A8s skribis: > The attached patches add a mechanism to patch the Guix source tree, and > then use that mechanism to add the missing (ice-9 threads) import. With > this I can do: > > ./pre-inst-env guix time-machine \ > --commit=3De02c2f85b36ce1c733bd908a210ce1182bdd2560 -- build linux-l= ibre > > =E2=80=A6 which is a simple way to do what the manifest above was about. Given the enthusiasm expressed on IRC, I went ahead and pushed. :-) ff3ca7979e channels: Add patch for . 053b10c3ef channels: Add mechanism to patch checkouts of the 'guix channe= l. 4ba425060a channels: Add 'latest-channel-instance'. So=E2=80=A6 it might be that today is merge day? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu May 07 06:05:23 2020 Received: (at 41028) by debbugs.gnu.org; 7 May 2020 10:05:23 +0000 Received: from localhost ([127.0.0.1]:42098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWdP8-0005R6-NN for submit@debbugs.gnu.org; Thu, 07 May 2020 06:05:22 -0400 Received: from mail-qk1-f171.google.com ([209.85.222.171]:33861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWdP6-0005Qh-Nw; Thu, 07 May 2020 06:05:21 -0400 Received: by mail-qk1-f171.google.com with SMTP id t3so12086qkg.1; Thu, 07 May 2020 03:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YeVK5w7v2Ib9FmHkKdNL9RdHEqdyJFW62C1Y4uwfpHY=; b=J8Y/jpjphEZkngmoZCJLXp9KGzCpFRJ4+RwgPOV9B8bsStP42MAfrgWwDAVduybo3b umywe/4uyt+dd6tRfcGPuLHV5sYzbNt+JTr6c5T9TfFUvLmIXKrN2oWNGfbsBp5UL6av yNAUKlsPXs5PCa3BXTA6vDJt+Ihl+hdBo1/HqOIZYQV/kLNOaePYSYb2g25Fy8uoq+bz XyjLh4QAlnm767mj5727O1w5GoKcHzgbnp797xLFR12NDQV4z0rRXwaHYPRbUAMojxEI vkG4mMLOVkFfkgDM3WlJiwqBvQGq9kEIKLORrKnr5/H7OMuWpZYX6xtU/rQOZMWN1y8o jLkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YeVK5w7v2Ib9FmHkKdNL9RdHEqdyJFW62C1Y4uwfpHY=; b=U3utcGHB4PLfcfhcc6LslpxGujbzoB9B6Aqi2fhZNa3tfDDvF4gsEOXNoJHqLPjtPG b3ruXKZZ0mz9+cOSd9fkc7vTJBVQYxvfFO+ZFUrJIaY2xiygk/CYwuopEGijA3ZtJFF5 YtbvH0SdDYjTvFQ39X0xO8vCPv7OLRpqb9rrbFFU2b85AGGJSvPk18JQqqGO2QPmC9bi I/C+f+bdHWYnnnq2bOntqC41uGX/fgdJhBYTlHEcL8z3pRbFDcbtQ8WRpkcRj9gYe5fY auSn7UkUb+0acdAlQ8/E7vEbdYbiV8yB1wOm0TEFky7r6PzNTbAZ/zoTpvKhK1NhjGhJ QQcA== X-Gm-Message-State: AGi0Pua/CxxeEE9TJQs879/M2vGUSDPvJj4ILpVLiL6ZZxb7FxEXRRIq hgWSEdasOl7PC+KUB65bn16kqoeZGYE0GQIs7FKnVZcO X-Google-Smtp-Source: APiQypLES/i2dbiQMHguFqdVCV2gqzU4FiqAqtCey6CzIlwGKYPERmw0KI2NkwIEx5MEyNwI32DzISS9KDXrSvqbBP0= X-Received: by 2002:a37:4e05:: with SMTP id c5mr13440800qkb.232.1588845914900; Thu, 07 May 2020 03:05:14 -0700 (PDT) MIME-Version: 1.0 References: <87h7wymj8a.fsf@cbaines.net> <87a72kg2qd.fsf@gnu.org> <87k11oduzx.fsf@gnu.org> In-Reply-To: <87k11oduzx.fsf@gnu.org> From: zimoun Date: Thu, 7 May 2020 12:05:03 +0200 Message-ID: Subject: Re: bug#41028: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread To: 41028@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Christopher Baines Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41028 Cc: 41028-done@debbugs.gnu.org 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.0 (-) Hi Ludo, On Thu, 7 May 2020 at 10:13, Ludovic Court=C3=A8s wrote: > Given the enthusiasm expressed on IRC, I went ahead and pushed. :-) > > ff3ca7979e channels: Add patch for . > 053b10c3ef channels: Add mechanism to patch checkouts of the 'guix chan= nel. > 4ba425060a channels: Add 'latest-channel-instance'. Just to be sure to well-understand: the versions before 05e783 were broken (guix build failed) and the proposed in-place mechanism is a way to fix them, right? If yes, that's awesome! Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri May 08 05:37:52 2020 Received: (at 41028-done) by debbugs.gnu.org; 8 May 2020 09:37:52 +0000 Received: from localhost ([127.0.0.1]:44605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWzS4-0001uN-EG for submit@debbugs.gnu.org; Fri, 08 May 2020 05:37:52 -0400 Received: from mira.cbaines.net ([212.71.252.8]:40938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWzS2-0001uD-DP for 41028-done@debbugs.gnu.org; Fri, 08 May 2020 05:37:50 -0400 Received: from localhost (unknown [46.237.174.28]) by mira.cbaines.net (Postfix) with ESMTPSA id 7703127BBE1; Fri, 8 May 2020 10:37:49 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 3d45c7a8; Fri, 8 May 2020 09:37:47 +0000 (UTC) References: <87h7wymj8a.fsf@cbaines.net> <87a72kg2qd.fsf@gnu.org> <87k11oduzx.fsf@gnu.org> User-agent: mu4e 1.2.0; emacs 26.3 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#41028: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread In-reply-to: <87k11oduzx.fsf@gnu.org> Date: Fri, 08 May 2020 10:37:45 +0100 Message-ID: <87sggag42e.fsf@cbaines.net> 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: 41028-done Cc: Marius Bakke , 41028-done@debbugs.gnu.org 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.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Ludovic Court=C3=A8s skribis: > >> The attached patches add a mechanism to patch the Guix source tree, and >> then use that mechanism to add the missing (ice-9 threads) import. With >> this I can do: >> >> ./pre-inst-env guix time-machine \ >> --commit=3De02c2f85b36ce1c733bd908a210ce1182bdd2560 -- build linux-= libre >> >> =E2=80=A6 which is a simple way to do what the manifest above was about. > > Given the enthusiasm expressed on IRC, I went ahead and pushed. :-) > > ff3ca7979e channels: Add patch for . > 053b10c3ef channels: Add mechanism to patch checkouts of the 'guix chan= nel. > 4ba425060a channels: Add 'latest-channel-instance'. > > So=E2=80=A6 it might be that today is merge day? Wonderful :) I've had a chance to try this out now, and it works. I was able to reconfigure my system. One even more niche issue is that because I'm using this channel in my system configuration, the patching happens as root, but it's the cached channel in my users home directory that's patched. This means that build-self.scm becomes owned by root. I noticed this when I went to pull: =E2=86=92 guix pull --branch=3Dcore-updates Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.= org/git/guix.git'... guix pull: error: Git error: could not open '/home/chris/.cache/guix/chec= kouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/build-aux/build-= self.scm' for writing: Permission denied I'm not sure what the neat way of addressing this is, but maybe the file ownership can be recorded prior to patching, and reset afterwards if it's changed. Thanks again for looking at the original issue Ludo, Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl61KGlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfF6g//UT+CFPaSPcsbzcvn2TBqy+h8tLmJHvvJ39ervySkffseCfIjTtYJ0Zqs 8uzQePl3zeIaL/auRzZHV15+Rdg9pynqfxF2rMOJtiOCr7tYbBgiP2QiVUFNevkW wlRIYyYq+JXaPj3DMcbsmMcyOjXsFsJ4vRln3AExteJpR3ZnUEA83QHdNeXp65Z6 BPpPLjLWc3Ne+bgSkfA/JmBNFd3EBRb7R3uPlt5Tz8uqoe28U5uBH0ayXjS7a0a0 5TY7FwBg5K3HSFLRa7aBl57QaHxGukDDTuRlYzXzCn7+V47PdCKQ3VnXN774NZrH Xl13FJwTRF7J0N8Kx6t5HtJrKpnJ4ak57Pfqne2V0k0FlIQGC4IZtQRUbN2y0wKm PLv37R+5hDoxNmm+CRbHm4oaDZbY1QeySO9DvKDPelvKpCm/NkRqc/beRNAeg4Ui 2+1V9BP5GWk2Pl3Rq2aVwZXnSPClzJ0OQLs6CXtdmsn2GHCM3611rJls6WJ48Jrp G19Otpj18WJYCFN5u035tnReZyi1UddHnfIWyKZyrzMvajkp84utBwVj/inmxOXc 2YllbhIWRFNWGBRbE6OmLdFnPxc5Ld96WHhc6Fjkak2XJHaNFqgC1QgbBineTEwn M4s1h0w46ZyjraUrHH6XuvR78ejMy11tjukOBy+hbpHb5QQ5Tg4= =RanM -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 08 10:35:27 2020 Received: (at 41028-done) by debbugs.gnu.org; 8 May 2020 14:35:27 +0000 Received: from localhost ([127.0.0.1]:46035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jX462-0003MS-RU for submit@debbugs.gnu.org; Fri, 08 May 2020 10:35:27 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:52095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jX460-0003MA-Uo for 41028-done@debbugs.gnu.org; Fri, 08 May 2020 10:35:25 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D140C5C01DC; Fri, 8 May 2020 10:35:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 08 May 2020 10:35:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=XtcV1OFhV4IxWxLEhem4nvS2Hy De+gTqtC/eLlThpKs=; b=xdbKx4Wb8NNRC1Zc33HdEOXpuhi/An3Scq3IoObI85 hLv6WLkgvskVSBYsvv3WDBqWI4sa0GAsxOUyfK+wWApSQoHONQor6PTibL0G4UyJ cKBDZ0vY2tjw7SdQt6hV+khZWyfRmo6lLRMu5xcH4dv9vWX3t6L7rmNVV8rvLJdX XX51zE3FmxP1AL9h0K390MyGPepu9qCbjgUgKZH8TS6q81OBE7GAA6v1+iYH7aKO 3tts/icj6CGrZy4Oei0NpsoNAO+QJwRQThIaxIOJTp7UGYV24nePWtovkVdcKPpa On7xbNuZuYsYTujlPJXHLuHfuWJHD4eQrCWUMot4H9+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=XtcV1O FhV4IxWxLEhem4nvS2HyDe+gTqtC/eLlThpKs=; b=i1pBhpQGtCYfEy+T/l9/4w XVeYlIOcTRoDDs6oWA9FyEpUCd8trP3R0jCSTTwC3uaEZEcDwRYJHGEN0ic7jiRz Od5gwFKUkLF9PPrjfzb5P0+KEaYz57avkAeirzNdgZY1kSoQj97SAf0wA6CEKrvl 4koMc0uuz/W1sqPIER5CXc+XXLNqDIe14NcQPro6Jgy+CgVRH1Vo8F86Bi2j8+yg sTmSMr6bw2r1BdY08DYhgRX++Wf6j33/qCtgqq1QhkvLk7MusAmAW+JzkNlJ7KOv r5Y2eH+k/EmHvaXcIWjSR52VbYFOwlZixAjmdTpANQknuL/vgFEi6IQlV4rZtLWQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeefgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesghdtreertderjeenucfhrhhomhepofgrrhhiuhhs uceurghkkhgvuceomhgsrghkkhgvsehfrghsthhmrghilhdrtghomheqnecuggftrfgrth htvghrnhepudekhfdvffeivedvffeiffejveejuddtvdeigfekjeegtdeguefhieekgfel iefgnecuffhomhgrihhnpehgnhhurdhorhhgnecukfhppeekgedrvddtvddrieekrdejhe enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmsggr khhkvgesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: from localhost (ti0006q161-2604.bb.online.no [84.202.68.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 018513280067; Fri, 8 May 2020 10:35:18 -0400 (EDT) From: Marius Bakke To: Christopher Baines , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#41028: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread In-Reply-To: <87sggag42e.fsf@cbaines.net> References: <87h7wymj8a.fsf@cbaines.net> <87a72kg2qd.fsf@gnu.org> <87k11oduzx.fsf@gnu.org> <87sggag42e.fsf@cbaines.net> User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Fri, 08 May 2020 16:35:16 +0200 Message-ID: <875zd6336j.fsf@devup.no> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41028-done Cc: 41028-done@debbugs.gnu.org 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 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Christopher Baines writes: > Ludovic Court=C3=A8s writes: > >> Ludovic Court=C3=A8s skribis: >> >>> The attached patches add a mechanism to patch the Guix source tree, and >>> then use that mechanism to add the missing (ice-9 threads) import. With >>> this I can do: >>> >>> ./pre-inst-env guix time-machine \ >>> --commit=3De02c2f85b36ce1c733bd908a210ce1182bdd2560 -- build linux= -libre >>> >>> =E2=80=A6 which is a simple way to do what the manifest above was about. >> >> Given the enthusiasm expressed on IRC, I went ahead and pushed. :-) >> >> ff3ca7979e channels: Add patch for . >> 053b10c3ef channels: Add mechanism to patch checkouts of the 'guix cha= nnel. >> 4ba425060a channels: Add 'latest-channel-instance'. >> >> So=E2=80=A6 it might be that today is merge day? > > Wonderful :) I've had a chance to try this out now, and it works. I was > able to reconfigure my system. > > One even more niche issue is that because I'm using this channel in my > system configuration, the patching happens as root, but it's the cached > channel in my users home directory that's patched. This means that > build-self.scm becomes owned by root. > > I noticed this when I went to pull: > > =E2=86=92 guix pull --branch=3Dcore-updates > Updating channel 'guix' from Git repository at 'https://git.savannah.gn= u.org/git/guix.git'... > guix pull: error: Git error: could not open '/home/chris/.cache/guix/ch= eckouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/build-aux/buil= d-self.scm' for writing: Permission denied > > > I'm not sure what the neat way of addressing this is, but maybe the file > ownership can be recorded prior to patching, and reset afterwards if > it's changed. I took a stab at exactly this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-channels-Preserve-permissions-when-patching-https-bu.patch Content-Transfer-Encoding: quoted-printable From=20993dd0d36ba8e67af5c60d73cb1f9d60741f5418 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 8 May 2020 16:23:55 +0200 Subject: [PATCH] channels: Preserve permissions when patching . * guix/channels.scm (%bug-41028-patch): Record permissions before invoking SUBSTITUTE* and reset afterwards if file permissions differ from the curren= t user. =2D-- guix/channels.scm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index 0fa036446c..a102d5bc35 100644 =2D-- a/guix/channels.scm +++ b/guix/channels.scm @@ -393,10 +393,21 @@ to '%package-module-path'." (not (string-contains content "(ice-9 threads)")))) =20 (define (add-missing-ice-9-threads-import source) =2D ;; Add (ice-9 threads) import in the gexp of 'compute-guix-derivat= ion'. =2D (substitute* (string-append source "/" %self-build-file) =2D (("^ +\\(use-modules \\(ice-9 match\\)\\)") =2D (object->string '(use-modules (ice-9 match) (ice-9 threads)))))) + (let* ((self-build-file (string-append source "/" %self-build-file)) + ;; Record permissions so that we can reset it afterwards in c= ase + ;; we run this as the root user (see ). + ;; TODO: Ideally SUBSTITUTE* would preserve permissions itsel= f. + (stat (stat self-build-file)) + (owner (stat:uid stat)) + (group (stat:gid stat))) + + ;; Add (ice-9 threads) import in the gexp of 'compute-guix-derivat= ion'. + (substitute* self-build-file + (("^ +\\(use-modules \\(ice-9 match\\)\\)") + (object->string '(use-modules (ice-9 match) (ice-9 threads))))) + + (unless (and (eq? (getuid) owner) (eq? (getgid) group)) + (chown self-build-file owner group)))) =20 (patch missing-ice-9-threads-import? add-missing-ice-9-threads-import))) =20 =2D-=20 2.26.2 --=-=-= Content-Type: text/plain WDYT? Currently in the process of testing it locally, feedback appreciated. --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl61biQACgkQoqBt8qM6 VPoFoAf/UKOIozWoTgGoPdH/k7NVKYeD1BJPMzS+1QtO9fwwnJf5bgtOIt0mPeti gdgrgVYYg+Jk1WQRFMLEil5EdUgjMQiqP2OgpK/UwVmMMR3e8HESngn9jtB02hUq 2sq6ZeALV4PL/gPIukObTt/BjluexVZpD5qaKcaRjC/JKLs87SM7zlMGY6Cqut5c vAOZYqjCRrggvlqwj4HIR51XavUHylIh26vQY2g9pecDrdCKkfCAGOg55+jZfogm ypIrP2yUszIssZ4bUK21OIKE7+WmZtLhWyjrqCOkvDPJFbtvY4BXDzmuYXhISpdU 09eE+aIhrd0hDQVEgt5BKw+bVVHFdg== =xxKC -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 08 10:47:28 2020 Received: (at 41028-done) by debbugs.gnu.org; 8 May 2020 14:47:29 +0000 Received: from localhost ([127.0.0.1]:46054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jX4Hg-0003fH-LM for submit@debbugs.gnu.org; Fri, 08 May 2020 10:47:28 -0400 Received: from mira.cbaines.net ([212.71.252.8]:38678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jX4HU-0003ez-BS for 41028-done@debbugs.gnu.org; Fri, 08 May 2020 10:47:27 -0400 Received: from localhost (unknown [46.237.174.28]) by mira.cbaines.net (Postfix) with ESMTPSA id 21D4827BBE1; Fri, 8 May 2020 15:47:15 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id fd892977; Fri, 8 May 2020 14:47:12 +0000 (UTC) References: <87h7wymj8a.fsf@cbaines.net> <87a72kg2qd.fsf@gnu.org> <87k11oduzx.fsf@gnu.org> <87sggag42e.fsf@cbaines.net> <875zd6336j.fsf@devup.no> User-agent: mu4e 1.2.0; emacs 26.3 From: Christopher Baines To: Marius Bakke Subject: Re: bug#41028: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread In-reply-to: <875zd6336j.fsf@devup.no> Date: Fri, 08 May 2020 15:47:10 +0100 Message-ID: <87r1vufpqp.fsf@cbaines.net> 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: 41028-done Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 41028-done@debbugs.gnu.org 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.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Marius Bakke writes: > Christopher Baines writes: > >> Ludovic Court=C3=A8s writes: >> >>> Ludovic Court=C3=A8s skribis: >>> >>>> The attached patches add a mechanism to patch the Guix source tree, and >>>> then use that mechanism to add the missing (ice-9 threads) import. Wi= th >>>> this I can do: >>>> >>>> ./pre-inst-env guix time-machine \ >>>> --commit=3De02c2f85b36ce1c733bd908a210ce1182bdd2560 -- build linu= x-libre >>>> >>>> =E2=80=A6 which is a simple way to do what the manifest above was abou= t. >>> >>> Given the enthusiasm expressed on IRC, I went ahead and pushed. :-) >>> >>> ff3ca7979e channels: Add patch for . >>> 053b10c3ef channels: Add mechanism to patch checkouts of the 'guix ch= annel. >>> 4ba425060a channels: Add 'latest-channel-instance'. >>> >>> So=E2=80=A6 it might be that today is merge day? >> >> Wonderful :) I've had a chance to try this out now, and it works. I was >> able to reconfigure my system. >> >> One even more niche issue is that because I'm using this channel in my >> system configuration, the patching happens as root, but it's the cached >> channel in my users home directory that's patched. This means that >> build-self.scm becomes owned by root. >> >> I noticed this when I went to pull: >> >> =E2=86=92 guix pull --branch=3Dcore-updates >> Updating channel 'guix' from Git repository at 'https://git.savannah.g= nu.org/git/guix.git'... >> guix pull: error: Git error: could not open '/home/chris/.cache/guix/c= heckouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/build-aux/bui= ld-self.scm' for writing: Permission denied >> >> >> I'm not sure what the neat way of addressing this is, but maybe the file >> ownership can be recorded prior to patching, and reset afterwards if >> it's changed. > > I took a stab at exactly this: Awesome, thanks. I haven't tried it, but it looks good :) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl61cO5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XcezQ//Q+ajQjnUSufWkAbO2D/6mlicDbZW/Z3bLPjIywv8Hsb1tO145P/ZDT0h Y5AmBhsWwpTeyZ3zKUNFk18tRUYeqIv9ZpYSn59HAF3pvynsFbX5M4cDD/Fxdx1c mqHECvw7V4WxUwIPNcXXH5KD6JErZZnzG0TMXcWyKHgRBan5cb1j6qVj+iWnD/zN DtHDp3PI82Op8jeAmNvr9WZ6SZhm/+bVBDj6wWgImqpm92MKgtX+eN/Xjtps8qaL 6C4uqPv0WPfaFpKkCkxHOJgwCOTe31BmdJgbdBMivwnp8g9pxHtvmjXuqgnxHssF 0n8rIf20tG81WBfRiNuAWvNRI+Qa0Wvr1+VPaJAFd0OzVxJp6nnY1RjMHay6xzZp UW9XIlOzAZJSozs5a42dOSiYcjGngG3msRu/2dE5vx5XWrGNXkF7908s7tptHNRc 7rIVjZ7K6sprSBCJkP012btvVXf07GA7n4onnn0Efz+zG+nsyrCkCGC/ksTOu8Mm Q0ls0InooL3PUYnkv+uF/lusFCQ+pLr36LCuU7EJTdNFzytDN1s3of3MFV+eOPTF 4tmIR8eAn2lnIy4yISplMzBlPxOY7z88pRaqqmQrBuo9tMD851E0jVb3TbX3yxvM wQivc9A+zebq0p+ySctDsRslp63qoJnEQHulG//EtN86tHQ2Ci8= =sKvg -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 08 14:19:18 2020 Received: (at 41028-done) by debbugs.gnu.org; 8 May 2020 18:19:18 +0000 Received: from localhost ([127.0.0.1]:46284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jX7ag-0000ku-30 for submit@debbugs.gnu.org; Fri, 08 May 2020 14:19:18 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jX7aZ-0000ka-4c for 41028-done@debbugs.gnu.org; Fri, 08 May 2020 14:19:16 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E40AA5C01CE; Fri, 8 May 2020 14:19:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 08 May 2020 14:19:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=j0logTrPFjRqywXBSAFwafcnfu hvO5496pE6PyeEMoI=; b=Ihov7WdwvteQ5U7HJDd6iH6PdHyuPNLY9bjqegpjqF s4LlB4C5yLbNW80zOfPEINq9MphYHHeRiOqvVq3EYj3oolXeY2FcLwelMlSQdhJS R7nWL267HqiYyPHu11tEdv2mEHvUwNGjC3pP8Fwihb0L10qZj0SSg3K3WBasnfCS iUkGZ4TCmSfEEma8j4nn7W5/CP44ZQ8SefA9sksK7pQsuuqK3n3iLMS5dipqPPwd ettVz/lPDEqU+s+QpY9/OQYMlJnHoWkSx6HkfikKvmaK1eiKc9wc18+IMOULJfG4 LtjU4EzhiSYTCPpX/L391Src4woPCoijAzb7dvKb20Lw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=j0logT rPFjRqywXBSAFwafcnfuhvO5496pE6PyeEMoI=; b=dGKkLtU1baTDd0H9YGcZ6T qi03wGEejxGPlJ6e2bp/3WPQh/fc/8DPFIE+5Mjo0yvl8J03jmgTJZeq1AGOW+c2 N4c6sOOvjBoJwDC7Nm+9qj4jLCCjnlKtDOwzPptUt4mVDJoIzkud7dYTmWHerYPr vqd9FSuVyJkMydeCdDD9rISrsXnV7ftDw+2BJXCSMmOliGT+CvCDJLr2gCBHD1+i x8dbedF1zhqxu5gmxmp6MhjLEGWzDNWH+3tr9vaB2pWGz7VSNLyw6Pr6HER/k/0I ebdVYbYBi22T8Ga6qDGSQ2HHnMZ7u0xnWPvHiccNVPT6chYTcAcjUiAYfNfkxSmQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeefgdehjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesghdtreertderjeenucfhrhhomhepofgrrhhiuhhs uceurghkkhgvuceomhgsrghkkhgvsehfrghsthhmrghilhdrtghomheqnecuggftrfgrth htvghrnhepudekhfdvffeivedvffeiffejveejuddtvdeigfekjeegtdeguefhieekgfel iefgnecuffhomhgrihhnpehgnhhurdhorhhgnecukfhppeekgedrvddtvddrieekrdejhe enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmsggr khhkvgesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: from localhost (ti0006q161-2604.bb.online.no [84.202.68.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 5D0053280065; Fri, 8 May 2020 14:19:05 -0400 (EDT) From: Marius Bakke To: Christopher Baines , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#41028: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread In-Reply-To: <875zd6336j.fsf@devup.no> References: <87h7wymj8a.fsf@cbaines.net> <87a72kg2qd.fsf@gnu.org> <87k11oduzx.fsf@gnu.org> <87sggag42e.fsf@cbaines.net> <875zd6336j.fsf@devup.no> User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Fri, 08 May 2020 20:19:03 +0200 Message-ID: <87368a2stk.fsf@devup.no> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41028-done Cc: 41028-done@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Marius Bakke writes: > Christopher Baines writes: > >> One even more niche issue is that because I'm using this channel in my >> system configuration, the patching happens as root, but it's the cached >> channel in my users home directory that's patched. This means that >> build-self.scm becomes owned by root. >> >> I noticed this when I went to pull: >> >> =E2=86=92 guix pull --branch=3Dcore-updates >> Updating channel 'guix' from Git repository at 'https://git.savannah.g= nu.org/git/guix.git'... >> guix pull: error: Git error: could not open '/home/chris/.cache/guix/c= heckouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/build-aux/bui= ld-self.scm' for writing: Permission denied >> >> >> I'm not sure what the neat way of addressing this is, but maybe the file >> ownership can be recorded prior to patching, and reset afterwards if >> it's changed. > > I took a stab at exactly this: > > From 993dd0d36ba8e67af5c60d73cb1f9d60741f5418 Mon Sep 17 00:00:00 2001 > From: Marius Bakke > Date: Fri, 8 May 2020 16:23:55 +0200 > Subject: [PATCH] channels: Preserve permissions when patching > . > > * guix/channels.scm (%bug-41028-patch): Record permissions before invoking > SUBSTITUTE* and reset afterwards if file permissions differ from the curr= ent user. > --- > guix/channels.scm | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > > diff --git a/guix/channels.scm b/guix/channels.scm > index 0fa036446c..a102d5bc35 100644 > --- a/guix/channels.scm > +++ b/guix/channels.scm > @@ -393,10 +393,21 @@ to '%package-module-path'." > (not (string-contains content "(ice-9 threads)")))) >=20=20 > (define (add-missing-ice-9-threads-import source) > - ;; Add (ice-9 threads) import in the gexp of 'compute-guix-derivat= ion'. > - (substitute* (string-append source "/" %self-build-file) > - (("^ +\\(use-modules \\(ice-9 match\\)\\)") > - (object->string '(use-modules (ice-9 match) (ice-9 threads)))))) > + (let* ((self-build-file (string-append source "/" %self-build-file= )) > + ;; Record permissions so that we can reset it afterwards in= case > + ;; we run this as the root user (see ). > + ;; TODO: Ideally SUBSTITUTE* would preserve permissions its= elf. > + (stat (stat self-build-file)) > + (owner (stat:uid stat)) > + (group (stat:gid stat))) > + > + ;; Add (ice-9 threads) import in the gexp of 'compute-guix-deriv= ation'. > + (substitute* self-build-file > + (("^ +\\(use-modules \\(ice-9 match\\)\\)") > + (object->string '(use-modules (ice-9 match) (ice-9 threads)))= )) > + > + (unless (and (eq? (getuid) owner) (eq? (getgid) group)) > + (chown self-build-file owner group)))) >=20=20 > (patch missing-ice-9-threads-import? add-missing-ice-9-threads-import= ))) Ludovic pointed out on IRC that 'sudo guix system build foo.scm' with an inferior will update the cached checkout (typically ~/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalw= q) as root, and break subsequent unprivileged 'guix pull' operations anyway. Which is partially correct: .git/index and .git/refs/heads/master will be owned by root in that case, but you are still allowed to unlink() and rename() such files as long as you own the directory, so libgit2 will successfully reset permissions on the checkout even after pulling as root! It fails to do that for build-self.scm because it does not know it has changed, and tries opening it directly with O_WRONLY (which fails). I can confirm that this patch solves that problem, and unprivileged 'guix pull' works again even after previously using sudo. Now, users are likely to run into other issues when using inferiors with sudo (e.g. if new directories are added), so I'm not sure if this patch is worth the effort. Perhaps the Guix git cache should be per-uid, but that requires more intrusive changes. Thoughts? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl61opcACgkQoqBt8qM6 VPq/DQf/VpxtgyPipXlZiHtWs222a/Ojzh/A59h3wH7ZisDkxd4/bgkK4OpFeMQt M+tEXtAvlnzI5ViTSNKaFQI+TijT4PuHKApnJAYhELPoRCVpFk13GBphP5hdXUN4 NadA8ZpK3IpTjbD3+Od/gxzqv43OYCwp8N1hEuxZFUkieE4gD/mmJ401ujUNdUHI Xcb/f64vWt7YUevKEpxn8zVDILUGIQmREoxWsJmVBnGb4hJPzpvrjW/TnjIOBee1 Lo8dFA4wMHRSYxTV+LK2/qhT+9L9Nq8hqIvKZwxeOSVMfBfnbg19WnX44IIDXhhm vaveKOeUgrmGwF9bNlTKMODuSq6huQ== =d7Wa -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Sep 11 07:55:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 06 Jun 2020 11:24:05 +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