GNU bug report logs - #36738
[PATCH] guix deploy: Support '--no-grafts' and '--system'

Previous Next

Package: guix-patches;

Reported by: iyzsong <at> member.fsf.org (宋文武)

Date: Sat, 20 Jul 2019 05:06:01 UTC

Severity: normal

Tags: patch

Done: iyzsong <at> member.fsf.org (宋文武)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: iyzsong <at> member.fsf.org (宋文武)
Cc: tracker <at> debbugs.gnu.org
Subject: bug#36738: closed ([PATCH] guix deploy: Support '--no-grafts' and
 '--system')
Date: Wed, 24 Jul 2019 12:37:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 24 Jul 2019 20:36:11 +0800
with message-id <87wog7zk1w.fsf <at> member.fsf.org>
and subject line Re: [bug#36738] [PATCH] guix deploy: Support '--no-grafts' and '--system'
has caused the debbugs.gnu.org bug report #36738,
regarding [PATCH] guix deploy: Support '--no-grafts' and '--system'
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
36738: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36738
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: iyzsong <at> member.fsf.org (宋文武)
To: guix-patches <at> gnu.org
Subject: [PATCH] guix deploy: Support '--no-grafts' and '--system'
Date: Sat, 20 Jul 2019 13:05:31 +0800
[Message part 3 (text/plain, inline)]
Hello, this patch handle the '--no-grafts' command line option:
[0001-deploy-Honor-no-grafts.patch (text/x-patch, inline)]
From a9af4a0404d9cec29ed200c2fa6a6fb160f6babb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong <at> member.fsf.org>
Date: Sat, 20 Jul 2019 12:45:34 +0800
Subject: [PATCH 1/2] deploy: Honor '--no-grafts'.

* guix/scripts/deploy.scm (guix-deploy): Parameterize '%graft?'.
---
 guix/scripts/deploy.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index 978cfb2a81..3acd32eaa7 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -23,6 +23,7 @@
   #:use-module (guix scripts build)
   #:use-module (guix store)
   #:use-module (guix ui)
+  #:use-module (guix grafts)
   #:use-module (ice-9 format)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-37)
@@ -80,5 +81,6 @@ Perform the deployment specified by FILE.\n"))
       (set-build-options-from-command-line store opts)
       (for-each (lambda (machine)
                   (info (G_ "deploying to ~a...") (machine-display-name machine))
-                  (run-with-store store (deploy-machine machine)))
+                  (parameterize ((%graft? (assq-ref opts 'graft?)))
+                    (run-with-store store (deploy-machine machine))))
                 machines))))
-- 
2.19.2

[Message part 5 (text/plain, inline)]

And '--system', so I can deploy a "i686-linux" from my "x86_64-linux":
[0002-deploy-Handle-the-system-command-line-option.patch (text/x-patch, inline)]
From 192f96a3fa4342765db919006c35cdeb1774b62f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong <at> member.fsf.org>
Date: Sat, 20 Jul 2019 12:51:45 +0800
Subject: [PATCH 2/2] deploy: Handle the '--system' command line option.

* guix/scripts/deploy.scm (show-help): Add help for '--system'.
(%options): Add '-s' and '--system'.
(guix-deploy): Parameterize %current-system.
---
 guix/scripts/deploy.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index 3acd32eaa7..52bba3f3bf 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -23,6 +23,7 @@
   #:use-module (guix scripts build)
   #:use-module (guix store)
   #:use-module (guix ui)
+  #:use-module (guix utils)
   #:use-module (guix grafts)
   #:use-module (ice-9 format)
   #:use-module (srfi srfi-1)
@@ -41,6 +42,8 @@
 (define (show-help)
   (display (G_ "Usage: guix deploy [OPTION] FILE...
 Perform the deployment specified by FILE.\n"))
+  (display (G_ "
+  -s, --system=SYSTEM    attempt to build for SYSTEM--e.g., \"i686-linux\""))
   (show-build-options-help)
   (newline)
   (display (G_ "
@@ -55,10 +58,14 @@ Perform the deployment specified by FILE.\n"))
                  (lambda args
                    (show-help)
                    (exit 0)))
+         (option '(#\s "system") #t #f
+                 (lambda (opt name arg result)
+                   (alist-cons 'system arg
+                               (alist-delete 'system result eq?))))
          %standard-build-options))
 
 (define %default-options
-  '((system . ,(%current-system))
+  `((system . ,(%current-system))
     (substitutes? . #t)
     (build-hook? . #t)
     (graft? . #t)
@@ -81,6 +88,7 @@ Perform the deployment specified by FILE.\n"))
       (set-build-options-from-command-line store opts)
       (for-each (lambda (machine)
                   (info (G_ "deploying to ~a...") (machine-display-name machine))
-                  (parameterize ((%graft? (assq-ref opts 'graft?)))
+                  (parameterize ((%current-system (assq-ref opts 'system))
+                                 (%graft? (assq-ref opts 'graft?)))
                     (run-with-store store (deploy-machine machine))))
                 machines))))
-- 
2.19.2

[Message part 7 (text/plain, inline)]
Or better we can add a 'system' field to the <machine> record, so we can
deploy a list of machines with different 'system'.  Currently a
<machine> has 'system' as a field for the <operating-system>, so where
to put this machine/arch 'system'...
[Message part 8 (message/rfc822, inline)]
From: iyzsong <at> member.fsf.org (宋文武)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Christopher Lemmer Webber <cwebber <at> dustycloud.org>,
 36738-done <at> debbugs.gnu.org,
 "Jakob L. Kreuze" <zerodaysfordays <at> sdf.lonestar.org>, "Thompson,
 David" <dthompson2 <at> worcester.edu>
Subject: Re: [bug#36738] [PATCH] guix deploy: Support '--no-grafts' and
 '--system'
Date: Wed, 24 Jul 2019 20:36:11 +0800
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hello,
>
> zerodaysfordays <at> sdf.lonestar.org (Jakob L. Kreuze) skribis:
>
>> Hello Wenwu,
>> iyzsong <at> member.fsf.org (宋文武) writes:
>>
>>> Hello, this patch handle the '--no-grafts' command line option:
>>> ...
>>> And '--system', so I can deploy a "i686-linux" from my "x86_64-linux":
>>
>> These patches look good to me, thank you!
>>
>> Ludo, Dave, Chris, any additional comments?
>
> Fine with me!
>
> I agree with Dave that we should avoid adding a ‘system-type’ field to
> <machine>, at least for now.  Instead, we should just honor
> (%current-system).
>
> Thanks,
> Ludo’.

Pushed, thanks for the reviews!


This bug report was last modified 5 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.