From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Odd behavior with --dry-run and --upgrade Date: Thu, 28 Jul 2016 10:58:51 +0300 Message-ID: <87twfa19dw.fsf@gmail.com> References: <87y44sqtiw.fsf@gnu.org> <87h9bfcteu.fsf@gmail.com> <87y44q8yta.fsf@gnu.org> <8760rtbc14.fsf@gnu.org> <87r3agd8yg.fsf@gnu.org> <87mvl41z1a.fsf@gnu.org> <87r3ag8tc1.fsf@gnu.org> <87twfbth7w.fsf@gmail.com> <87lh0mvi4f.fsf@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]:34705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSgDZ-0008Ig-Jw for guix-devel@gnu.org; Thu, 28 Jul 2016 03:58:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSgDT-0004pL-J7 for guix-devel@gnu.org; Thu, 28 Jul 2016 03:58:56 -0400 In-Reply-To: <87lh0mvi4f.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 28 Jul 2016 00:19:44 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." 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" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel Ludovic Court=C3=A8s (2016-07-28 01:19 +0300) wrote: > Alex Kost skribis: > >> I have zero knowledge in grafting, but if I checked it right, the >> attached patch should disable grafting for the emacs interface (when >> dry-run is on). If you think it should be a part of a bigger >> dry-run+no-grafts patch, please use it. > > Two separate patches is fine, IMO. OK, then I'll commit this patch when it will be ready. >> From d7747453bf31a616d414dce293fc0556d601abcb Mon Sep 17 00:00:00 2001 >> From: Alex Kost >> Date: Wed, 27 Jul 2016 14:55:50 +0300 >> Subject: [PATCH] emacs: Disable grafts when dry-run is enabled. >> >> * emacs/guix-main.scm (process-package-actions): Set grafting according >> to 'dry-run?'. >> * guix/scripts.scm (build-package): Likewise. > > [...] > >> (define-module (guix scripts) >> + #:use-module (guix grafts) >> #:use-module (guix utils) >> #:use-module (guix ui) >> #:use-module (guix store) >> @@ -106,6 +107,7 @@ true." >> "Build PACKAGE using BUILD-OPTIONS acceptable by 'set-build-options'. >> Show what and how will/would be built." >> (mbegin %store-monad >> + (set-grafting (not dry-run?)) >> (apply set-build-options* >> #:use-substitutes? use-substitutes? >> (strip-keyword-arguments '(#:dry-run?) build-options)) > > Here it might be best to do something like this: > > (mlet %store-monad ((grafting? ((lift0 %graft? %store-monad)))) > (set-grafting (and (not dry-run?) grafting?)) > =E2=80=A6) > > This would make sure we don=E2=80=99t enable grafting if it turned out to= be > disabled. > > WDYT? OK, you know better :-) However, I tried it and it doesn't work for me (note: I know nothing about monads, gexps, etc.). When I try this: (mbegin %store-monad (set-grafting #f) =E2=80=A6) the grafting doesn't happen, but when I try this: (mlet %store-monad ((grafting? ((lift0 %graft? %store-monad)))) (set-grafting #f) =E2=80=A6) grafting happens anyway. I have no idea what the problem is. --=20 Alex