unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Odd behavior with --dry-run and --upgrade
Date: Tue, 26 Jul 2016 16:41:07 +0300	[thread overview]
Message-ID: <87fuqwa558.fsf@gmail.com> (raw)
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")

Ludovic Courtès (2016-07-26 12:50 +0300) wrote:

> Roel Janssen <roel@gnu.org> skribis:
>
>> Ludovic Courtès writes:
[...]
>>> 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:
>
>
> 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
‘graft?’ option as you suggest, and later 'guix-package', 'guix-system'
and other similar procedures from (guix scripts ...) modules
parameterize ‘%graft?’ according to this option.

The only way I see for the Emacs interface is to modify
"emacs/guix-main.scm" to parameterize ‘%graft?’ as well and to set it
depending on the current value of ‘dry-run’.  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.

-- 
Alex

  parent reply	other threads:[~2016-07-26 13:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-23 15:11 Odd behavior with --dry-run and --upgrade Roel Janssen
2016-07-23 18:23 ` Leo Famulari
2016-07-24  8:49 ` Alex Kost
2016-07-24 22:18   ` Ludovic Courtès
2016-07-25  7:46     ` Andreas Enge
2016-07-25 22:14     ` Roel Janssen
2016-07-26  9:50       ` Ludovic Courtès
2016-07-26 10:20         ` Roel Janssen
2016-07-26 12:41           ` Ludovic Courtès
2016-07-27 12:09             ` Alex Kost
2016-07-27 22:19               ` Ludovic Courtès
2016-07-28  7:58                 ` Alex Kost
2016-07-28 13:01                   ` Ludovic Courtès
2016-07-30 15:25                     ` Alex Kost
2016-07-30 22:51                       ` Ludovic Courtès
2016-07-26 13:41         ` Alex Kost [this message]
2016-07-26 14:37           ` Ludovic Courtès
2016-08-21  4:54         ` Roel Janssen
2016-08-27 23:23           ` Roel Janssen
2016-08-28 14:08           ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fuqwa558.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).