all messages for Guix-related lists mirrored at yhetil.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: Wed, 27 Jul 2016 15:09:55 +0300	[thread overview]
Message-ID: <87twfbth7w.fsf@gmail.com> (raw)
In-Reply-To: <87r3ag8tc1.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 26 Jul 2016 14:41:34 +0200")

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

Ludovic Courtès (2016-07-26 15:41 +0300) wrote:

> Roel Janssen <roel@gnu.org> skribis:
>
>> Ludovic Courtès writes:
[...]
>>> Something similar should be done in the Emacs interface.
>>
>> I'm not familiar with the code of the Emacs interface.  Any other
>> takers for it?  Otherwise I will look into it, but that will take even
>> more time :)
>
> Maybe Alex can give a hand?  :-)

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.


[-- Attachment #2: 0001-emacs-Disable-grafts-when-dry-run-is-enabled.patch --]
[-- Type: text/x-patch, Size: 3268 bytes --]

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.
---
 emacs/guix-main.scm | 20 +++++++++++---------
 guix/scripts.scm    |  4 +++-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index cbf7cdc..040932f 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -46,6 +46,7 @@
  (guix)
  (guix combinators)
  (guix git-download)
+ (guix grafts)
  (guix packages)
  (guix profiles)
  (guix licenses)
@@ -930,15 +931,16 @@ OUTPUTS is a list of package outputs (may be an empty list)."
          (new-manifest (manifest-perform-transaction
                         manifest transaction)))
     (unless (and (null? install) (null? remove))
-      (with-store store
-        (set-build-options store
-                           #:print-build-trace #f
-                           #:use-substitutes? use-substitutes?)
-        (show-manifest-transaction store manifest transaction
-                                   #:dry-run? dry-run?)
-        (build-and-use-profile store profile new-manifest
-                               #:use-substitutes? use-substitutes?
-                               #:dry-run? dry-run?)))))
+      (parameterize ((%graft? (not dry-run?)))
+        (with-store store
+          (set-build-options store
+                             #:print-build-trace #f
+                             #:use-substitutes? use-substitutes?)
+          (show-manifest-transaction store manifest transaction
+                                     #:dry-run? dry-run?)
+          (build-and-use-profile store profile new-manifest
+                                 #:use-substitutes? use-substitutes?
+                                 #:dry-run? dry-run?))))))
 
 (define (delete-generations* profile generations)
   "Delete GENERATIONS from PROFILE.
diff --git a/guix/scripts.scm b/guix/scripts.scm
index d84375f..2ed1eeb 100644
--- a/guix/scripts.scm
+++ b/guix/scripts.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Deck Pickard <deck.r.pickard@gmail.com>
-;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
+;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,6 +19,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (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))
-- 
2.8.3


  reply	other threads:[~2016-07-27 12:10 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 [this message]
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
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

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

  git send-email \
    --in-reply-to=87twfbth7w.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.