[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Odd behavior with --dry-run and --upgrade

From: Ludovic Courtès
Subject: Re: Odd behavior with --dry-run and --upgrade
Date: Tue, 26 Jul 2016 11:50:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Roel Janssen <address@hidden> skribis:

> Ludovic Courtès writes:
>> Hi!
>> Alex Kost <address@hidden> 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:

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]