From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Odd behavior with --dry-run and --upgrade Date: Tue, 26 Jul 2016 11:50:31 +0200 Message-ID: <87r3agd8yg.fsf@gnu.org> References: <87y44sqtiw.fsf@gnu.org> <87h9bfcteu.fsf@gmail.com> <87y44q8yta.fsf@gnu.org> <8760rtbc14.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRz0d-0004Jw-BO for guix-devel@gnu.org; Tue, 26 Jul 2016 05:50:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRz0X-00054E-CV for guix-devel@gnu.org; Tue, 26 Jul 2016 05:50:42 -0400 In-Reply-To: <8760rtbc14.fsf@gnu.org> (Roel Janssen's message of "Tue, 26 Jul 2016 00:14:47 +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: Roel Janssen Cc: guix-devel , Alex Kost --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Roel Janssen skribis: > Ludovic Court=C3=A8s 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=E2=80=A6 >> >>> As a user I expect that --dry-run means no building at all. >>> >>> BTW it's not just about =E2=80=98guix package --dry-run --upgrade=E2=80= =99, it relates >>> to all commands, for example =E2=80=98guix build --dry-run foo=E2=80=99= , etc. >>> >>> OTOH, if a future =E2=80=98--dry-run=E2=80=99 would mean what =E2=80=98= --dry-run --no-grafts=E2=80=99 >>> means now, than how to achieve what =E2=80=98--dry-run=E2=80=99 means n= ow? Or rather: >>> does anyone use just --dry-run (without --no-grafts)? Is it really >>> useful? >> >> In theory it could be useful for =E2=80=98guix build=E2=80=99, since it= =E2=80=99s a =E2=80=9Clow level=E2=80=9D >> tool and people using it may want to be able to distinguish between >> grafted and non-grafted results. >> >> But honestly, I think changing =E2=80=98--dry-run=E2=80=99 to do =E2=80= =98--dry-run --no-grafts=E2=80=99 >> 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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index a02a0d5..daa60b9 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -541,7 +541,8 @@ 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))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=E2=80=99. --=-=-=--