From patchwork Sun Aug 21 04:54:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roel Janssen X-Patchwork-Id: 14803 Received: (qmail 38536 invoked by uid 89); 21 Aug 2016 04:54:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=dry, Something, 486, 7, 4868 X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 21 Aug 2016 04:54:19 +0000 Received: from localhost ([::1]:35347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbKm0-0001XB-Ml for patchwork@sourceware.org; Sun, 21 Aug 2016 00:54:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbKlu-0001Wu-5t for guix-devel@gnu.org; Sun, 21 Aug 2016 00:54:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbKls-0006Bh-V6 for guix-devel@gnu.org; Sun, 21 Aug 2016 00:54:10 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbKll-00069Q-UG; Sun, 21 Aug 2016 00:54:01 -0400 Received: from 541e9304.cm-5-7c.dynamic.ziggo.nl ([84.30.147.4]:46460 helo=roel-tp) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1bbKlk-0003oX-1b; Sun, 21 Aug 2016 00:54:00 -0400 References: <87y44sqtiw.fsf@gnu.org> <87h9bfcteu.fsf@gmail.com> <87y44q8yta.fsf@gnu.org> <8760rtbc14.fsf@gnu.org> <87r3agd8yg.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.1.1 From: Roel Janssen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: Odd behavior with --dry-run and --upgrade In-reply-to: <87r3agd8yg.fsf@gnu.org> Date: Sun, 21 Aug 2016 06:54:39 +0200 Message-ID: <87wpja67sg.fsf@gnu.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel , Alex Kost Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" Ludovic Courtès writes: > Roel Janssen skribis: > >> Ludovic Courtès writes: >> >>> Hi! >>> >>> Alex Kost skribis: >>> >>>> Roel Janssen (2016-07-23 18:11 +0300) wrote: >>>> >>>>> Dear Guix, >>>>> >>>>> For some time now, running `guix package --dry-run --upgrade' results in >>>>> build actions involving grafting. For a dry-run, I find that really >>>>> odd. I believe the correct behavior should be what can be achieved >>>>> with: `guix package --dry-run --no-grafts --upgrade'. >>>> >>>> I'm totally agree with this; nowadays I always use --dry-run with >>>> --no-grafts option. >>> >>> Same here… >>> >>>> As a user I expect that --dry-run means no building at all. >>>> >>>> BTW it's not just about ‘guix package --dry-run --upgrade’, it relates >>>> to all commands, for example ‘guix build --dry-run foo’, etc. >>>> >>>> OTOH, if a future ‘--dry-run’ would mean what ‘--dry-run --no-grafts’ >>>> means now, than how to achieve what ‘--dry-run’ means now? Or rather: >>>> does anyone use just --dry-run (without --no-grafts)? Is it really >>>> useful? >>> >>> In theory it could be useful for ‘guix build’, since it’s a “low level” >>> tool and people using it may want to be able to distinguish between >>> grafted and non-grafted results. >>> >>> But honestly, I think changing ‘--dry-run’ to do ‘--dry-run --no-grafts’ >>> would be fine, and probably better than the current situation. >> >> Could you provide some insight in where I should be looking to att the >> check to 'graft?'? > > Everything that relates to command-line argument processing is in (guix > scripts build), for the common options, and then in each (guix scripts > *) module. > > Roughly, the change I suggest would be along these lines: > > > However, since --dry-run is processed separately in each command, this > change should probably be duplicated. > > Would you like to look into it? > > Something similar should be done in the Emacs interface. > > Thanks, > Ludo’. Sorry for the delay. The attached patch applies your idea to all subcommands that have a --dry-run option. Is this what you had in mind? Kind regards, Roel Janssen From cf5a01aba3c08b7c62048bff3e0f1df80dc0b4dc Mon Sep 17 00:00:00 2001 From: Roel Janssen Date: Sun, 21 Aug 2016 06:48:52 +0200 Subject: [PATCH] guix scripts: Disable grafting on dry runs. * guix/scripts/archive.scm, guix/scripts/build.scm, guix/scripts/environment.scm, guix/scripts/system.scm, guix/scripts/package.scm: Disable grafting when a dry-run parameter is given. --- guix/scripts/archive.scm | 2 +- guix/scripts/build.scm | 2 +- guix/scripts/environment.scm | 2 +- guix/scripts/package.scm | 3 ++- guix/scripts/system.scm | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm index e06c38a..8c7322d 100644 --- a/guix/scripts/archive.scm +++ b/guix/scripts/archive.scm @@ -162,7 +162,7 @@ Export/import one or more packages from/to the store.\n")) (alist-cons 'expression arg result))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) - (alist-cons 'dry-run? #t result))) + (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) %standard-build-options)) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index a02a0d5..9a113b4 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -541,7 +541,7 @@ must be one of 'package', 'all', or 'transitive'~%") (alist-cons 'file arg result))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) - (alist-cons 'dry-run? #t result))) + (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) (option '(#\r "root") #t #f (lambda (opt name arg result) (alist-cons 'gc-root arg result))) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 9f72b7b..0c69bfc 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -226,7 +226,7 @@ COMMAND or an interactive shell in that environment.\n")) (alist-cons 'ad-hoc? #t result))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) - (alist-cons 'dry-run? #t result))) + (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) (option '(#\s "system") #t #f (lambda (opt name arg result) (alist-cons 'system arg diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 2a751a4..fd42cdb 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -486,7 +486,8 @@ kind of search path~%") #f))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result arg-handler) - (values (alist-cons 'dry-run? #t result) + (values (alist-cons 'dry-run? #t + (alist-cons 'graft? #f result)) #f))) (option '("bootstrap") #f #f (lambda (opt name arg result arg-handler) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 4b53c3d..a9fe7d5 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -750,7 +750,7 @@ Build the operating system declared in FILE according to ACTION.\n")) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) - (alist-cons 'dry-run? #t result))) + (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) (option '(#\s "system") #t #f (lambda (opt name arg result) (alist-cons 'system arg -- 2.9.3