From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Odd behavior with --dry-run and --upgrade Date: Tue, 26 Jul 2016 16:41:07 +0300 Message-ID: <87fuqwa558.fsf@gmail.com> References: <87y44sqtiw.fsf@gnu.org> <87h9bfcteu.fsf@gmail.com> <87y44q8yta.fsf@gnu.org> <8760rtbc14.fsf@gnu.org> <87r3agd8yg.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]:50817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS2bh-0006l1-NP for guix-devel@gnu.org; Tue, 26 Jul 2016 09:41:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS2bd-00059W-Hz for guix-devel@gnu.org; Tue, 26 Jul 2016 09:41:12 -0400 In-Reply-To: <87r3agd8yg.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 26 Jul 2016 11:50:31 +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-26 12:50 +0300) wrote: > Roel Janssen skribis: > >> Ludovic Court=C3=A8s writes: [...] >>> 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: > > > 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))) > > 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. What would be "something similar" here? For CLI it's easy to set =E2=80=98graft?=E2=80=99 option as you suggest, and later 'guix-package', '= guix-system' and other similar procedures from (guix scripts ...) modules parameterize =E2=80=98%graft?=E2=80=99 according to this option. The only way I see for the Emacs interface is to modify "emacs/guix-main.scm" to parameterize =E2=80=98%graft?=E2=80=99 as well and= to set it depending on the current value of =E2=80=98dry-run=E2=80=99. AFAICT this parameterization should be added to: - 'process-package-actions': it is responsible for operations with profiles (installing/upgrading/removing packages); - 'package-source-build-derivation': it is responsible for building package sources. If my understanding is correct, I can make a patch for this. I can also add 'grafts' option that will appear in prompts (in the mode-line along with 'substitutes' and 'dry-run'), but I'm not sure if it will be useful since dry-run will disable grafts anyway. --=20 Alex