From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Odd behavior with --dry-run and --upgrade Date: Wed, 27 Jul 2016 15:09:55 +0300 Message-ID: <87twfbth7w.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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSNf3-0001Zx-PQ for guix-devel@gnu.org; Wed, 27 Jul 2016 08:10:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSNez-00011V-LE for guix-devel@gnu.org; Wed, 27 Jul 2016 08:10:05 -0400 In-Reply-To: <87r3ag8tc1.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 26 Jul 2016 14:41:34 +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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s (2016-07-26 15:41 +0300) wrote: > Roel Janssen skribis: > >> Ludovic Court=C3=A8s writes: [...] >>> Something similar should be done in the Emacs interface. >> >> I'm not familiar with the code of the Emacs interface. Any other >> takers for it? Otherwise I will look into it, but that will take even >> more time :) > > Maybe Alex can give a hand? :-) 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. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-emacs-Disable-grafts-when-dry-run-is-enabled.patch Content-Transfer-Encoding: quoted-printable >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. --- emacs/guix-main.scm | 20 +++++++++++--------- guix/scripts.scm | 4 +++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm index cbf7cdc..040932f 100644 --- a/emacs/guix-main.scm +++ b/emacs/guix-main.scm @@ -46,6 +46,7 @@ (guix) (guix combinators) (guix git-download) + (guix grafts) (guix packages) (guix profiles) (guix licenses) @@ -930,15 +931,16 @@ OUTPUTS is a list of package outputs (may be an empty= list)." (new-manifest (manifest-perform-transaction manifest transaction))) (unless (and (null? install) (null? remove)) - (with-store store - (set-build-options store - #:print-build-trace #f - #:use-substitutes? use-substitutes?) - (show-manifest-transaction store manifest transaction - #:dry-run? dry-run?) - (build-and-use-profile store profile new-manifest - #:use-substitutes? use-substitutes? - #:dry-run? dry-run?))))) + (parameterize ((%graft? (not dry-run?))) + (with-store store + (set-build-options store + #:print-build-trace #f + #:use-substitutes? use-substitutes?) + (show-manifest-transaction store manifest transaction + #:dry-run? dry-run?) + (build-and-use-profile store profile new-manifest + #:use-substitutes? use-substitutes? + #:dry-run? dry-run?)))))) =20 (define (delete-generations* profile generations) "Delete GENERATIONS from PROFILE. diff --git a/guix/scripts.scm b/guix/scripts.scm index d84375f..2ed1eeb 100644 --- a/guix/scripts.scm +++ b/guix/scripts.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013, 2014, 2015 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2014 Deck Pickard -;;; Copyright =C2=A9 2015 Alex Kost +;;; Copyright =C2=A9 2015, 2016 Alex Kost ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,6 +19,7 @@ ;;; along with GNU Guix. If not, see . =20 (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)) --=20 2.8.3 --=-=-=--