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: Thu, 28 Jul 2016 10:58:51 +0300 [thread overview]
Message-ID: <87twfa19dw.fsf@gmail.com> (raw)
In-Reply-To: <87lh0mvi4f.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 28 Jul 2016 00:19:44 +0200")
Ludovic Courtès (2016-07-28 01:19 +0300) wrote:
> Alex Kost <alezost@gmail.com> skribis:
>
>> I have zero knowledge in grafting, but if I checked it right, the
>> attached patch should disable grafting for the emacs interface (when
>> dry-run is on). If you think it should be a part of a bigger
>> dry-run+no-grafts patch, please use it.
>
> Two separate patches is fine, IMO.
OK, then I'll commit this patch when it will be ready.
>> From d7747453bf31a616d414dce293fc0556d601abcb Mon Sep 17 00:00:00 2001
>> From: Alex Kost <alezost@gmail.com>
>> Date: Wed, 27 Jul 2016 14:55:50 +0300
>> Subject: [PATCH] emacs: Disable grafts when dry-run is enabled.
>>
>> * emacs/guix-main.scm (process-package-actions): Set grafting according
>> to 'dry-run?'.
>> * guix/scripts.scm (build-package): Likewise.
>
> [...]
>
>> (define-module (guix scripts)
>> + #:use-module (guix grafts)
>> #:use-module (guix utils)
>> #:use-module (guix ui)
>> #:use-module (guix store)
>> @@ -106,6 +107,7 @@ true."
>> "Build PACKAGE using BUILD-OPTIONS acceptable by 'set-build-options'.
>> Show what and how will/would be built."
>> (mbegin %store-monad
>> + (set-grafting (not dry-run?))
>> (apply set-build-options*
>> #:use-substitutes? use-substitutes?
>> (strip-keyword-arguments '(#:dry-run?) build-options))
>
> Here it might be best to do something like this:
>
> (mlet %store-monad ((grafting? ((lift0 %graft? %store-monad))))
> (set-grafting (and (not dry-run?) grafting?))
> …)
>
> This would make sure we don’t enable grafting if it turned out to be
> disabled.
>
> WDYT?
OK, you know better :-)
However, I tried it and it doesn't work for me (note: I know nothing
about monads, gexps, etc.). When I try this:
(mbegin %store-monad
(set-grafting #f)
…)
the grafting doesn't happen, but when I try this:
(mlet %store-monad ((grafting? ((lift0 %graft? %store-monad))))
(set-grafting #f)
…)
grafting happens anyway. I have no idea what the problem is.
--
Alex
next prev parent reply other threads:[~2016-07-28 7:58 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 [this message]
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
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=87twfa19dw.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).