From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: package.scm: (profile-derivation (%store) '()) Date: Fri, 20 Sep 2013 23:35:09 +0200 Message-ID: <87wqmbch2q.fsf@gnu.org> References: <87r4cjjsu2.fsf@karetnikov.org> <877gebdz2c.fsf@gnu.org> <87a9j7b3qq.fsf@karetnikov.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]:51473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN8R0-0000zr-Oo for guix-devel@gnu.org; Fri, 20 Sep 2013 17:40:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN8Qv-0005uJ-2w for guix-devel@gnu.org; Fri, 20 Sep 2013 17:40:18 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:45552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN8Qu-0005tq-T6 for guix-devel@gnu.org; Fri, 20 Sep 2013 17:40:13 -0400 In-Reply-To: <87a9j7b3qq.fsf@karetnikov.org> (Nikita Karetnikov's message of "Sat, 21 Sep 2013 01:08:29 +0400") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: guix-devel@gnu.org Nikita Karetnikov skribis: >> =E2=80=98%store=E2=80=99 is a SRFI-39 parameter (info "(guile) Parameter= s"), aka. a >> dynamically-scoped variable. > >> It is initialized with the =E2=80=98parameterize=E2=80=99 form, which se= ts its value for >> the dynamic extent of its body. > > I don=E2=80=99t understand what code initializes =E2=80=98%store=E2=80=99. This: (parameterize ((%store (open-connection))) ...) > For example, I have one generation in the =E2=80=98test=E2=80=99 profile.= So =E2=80=98test=E2=80=99 > points to =E2=80=98test-1-link=E2=80=99. If I do > > scheme@(guix scripts package)> (roll-back "test") > > I get an error > > guix/derivations.scm:428:17: In procedure derivation->output-path: > guix/derivations.scm:428:17: In procedure struct_vtable: Wrong type argum= ent in position 1 (expecting struct): #f > > Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. > scheme@(guix scripts package) [1]>=20 I suspect it=E2=80=99s the =E2=80=98%guile-for-build=E2=80=99 parameter tha= t=E2=80=99s set to #f instead of being set to a derivation here. There=E2=80=99s also a =E2=80=98paramet= erize=E2=80=99 form for that one in guix/scripts/package.scm. > But why does this command work? > > $ ./pre-inst-env guix package -p test --roll-back > switching from generation 1 to 0 Because it=E2=80=99s designed to work! :-) > As far as I understand, this code is called when the above command is > invoked: > > ;; First roll back if asked to. > (if (and (assoc-ref opts 'roll-back?) (not dry-run?)) > (begin > (roll-back profile) > > I don=E2=80=99t see any references to =E2=80=98%store=E2=80=99 here. Look for =E2=80=98parameterize=E2=80=99; it=E2=80=99s dynamic scoping, whic= h makes it less visible. HTH, Ludo=E2=80=99.