From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#27284: [PATCH 3/4] Add (guix self) and use it when pulling. Date: Mon, 18 Dec 2017 15:57:49 +0100 Message-ID: <871sjst76a.fsf@gnu.org> References: <87h8tnz1dx.fsf@gnu.org> <20171211105253.9670-1-ludo@gnu.org> <20171211105253.9670-4-ludo@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQwrm-0001gY-Eh for bug-guix@gnu.org; Mon, 18 Dec 2017 09:58:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQwri-0002Mz-CS for bug-guix@gnu.org; Mon, 18 Dec 2017 09:58:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:60257) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQwri-0002Mn-7v for bug-guix@gnu.org; Mon, 18 Dec 2017 09:58:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20171211105253.9670-4-ludo@gnu.org> ("Ludovic \=\?utf-8\?Q\?Cour\?\= \=\?utf-8\?Q\?t\=C3\=A8s\=22's\?\= message of "Mon, 11 Dec 2017 11:52:52 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 27284@debbugs.gnu.org Hello, As Marius reported on IRC, pulling this branch from current master fails along these lines: --8<---------------cut here---------------start------------->8--- $ guix pull --url=3D$PWD --branch=3Dwip-pull-reload Updating from Git repository at '/home/ludo/src/guix'... Building from Git commit 0f34a0f4bc3f7c5483c0c9b09b1e4bf00b85271d... Unloading current modules... Loading new modules... New modules successfully loaded. Backtrace: In ice-9/boot-9.scm: 837:9 19 (catch _ _ # =E2=80=A6) 837:9 18 (catch _ _ # _) In guix/scripts/pull.scm: 280:17 17 (_) In guix/store.scm: 1443:24 16 (run-with-store _ _ #:guile-for-build _ #:system _ #:target _) In guix/scripts/pull.scm: 178:2 15 (_ _) In unknown file: 14 (_ # # =E2=80=A6) In guix/packages.scm: 1207:17 13 (_ #) 834:14 12 (cache! # # =E2=80=A6) In unknown file: 11 (_ # # #) In guix/packages.scm: 1154:22 10 (thunk) 1087:25 9 (bag->derivation # #< name: = "guile-2.2.2" system: "x86_64-linux"=E2=80=A6> =E2=80=A6) In srfi/srfi-1.scm: 592:17 8 (map1 (("source" #) =E2=80=A6)) In ice-9/boot-9.scm: 837:9 7 (catch srfi-34 # # =E2=80=A6) In guix/packages.scm: 903:18 6 (_) In guix/store.scm: 1443:24 5 (run-with-store _ _ #:guile-for-build _ #:system _ #:target _) In guix/packages.scm: 1255:5 4 (_ _) In unknown file: 3 (_ # # =E2=80=A6) In ice-9/eval.scm: 159:9 2 (_ #(#(# #) #)) 293:34 1 (_ #(#(#(# #) #) #)) In guix/store.scm: 1164:17 0 (_ #) guix/store.scm:1164:17: guix/store.scm:1164:17: In procedure nix-server-maj= or-version: Wrong type argument: # Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message. --8<---------------cut here---------------end--------------->8--- This comes from the fact that current master doesn=E2=80=99t protect against module reloads like this branch does: > +(define (build-and-install mdrv) > + "Bind MDRV, a monadic value for a derivation, build it, and finally in= stall > +it as the latest Guix." > + (define do-it > + ;; Weirdness follows! Before we were called, the Guix modules have > + ;; probably been reloaded, leading to a "parallel universe" with dis= joint > + ;; record types. However, procedures in this file have already cach= ed the > + ;; module relative to which they lookup global bindings (see > + ;; 'toplevel-box' documentation), so they're stuck in the old world.= To > + ;; work around that, evaluate our procedure in the context of the "n= ew" > + ;; (guix scripts pull) module--which has access to the new > + ;; record, and so on. > + (eval '(lambda (mdrv cont) > + ;; Reopen a connection to the daemon so that we have a reco= rd > + ;; with the new type. > + (with-store store > + (run-with-store store > + (mlet %store-monad ((drv mdrv)) > + (mbegin %store-monad > + (what-to-build (list drv)) > + (built-derivations (list drv)) > + (return (cont (derivation->output-path drv)))))))) > + (resolve-module '(guix scripts pull)))) ;the new module > + > + (do-it mdrv > + (lambda (result) > + (install-latest result (config-directory))))) I=E2=80=99m thinking that perhaps a middle ground would be to skip the relo= ad thing when we detect that the calling =E2=80=98guix=E2=80=99 is not prepare= d for module reloads. Ludo=E2=80=99.