From: iyzsong@member.fsf.org (宋文武)
To: 36738@debbugs.gnu.org
Subject: [bug#36738] [PATCH] guix deploy: Support '--no-grafts' and '--system'
Date: Sat, 20 Jul 2019 13:05:31 +0800 [thread overview]
Message-ID: <87a7d9l2hw.fsf@member.fsf.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 64 bytes --]
Hello, this patch handle the '--no-grafts' command line option:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-deploy-Honor-no-grafts.patch --]
[-- Type: text/x-patch, Size: 1263 bytes --]
From a9af4a0404d9cec29ed200c2fa6a6fb160f6babb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@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
[-- Attachment #3: Type: text/plain, Size: 73 bytes --]
And '--system', so I can deploy a "i686-linux" from my "x86_64-linux":
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0002-deploy-Handle-the-system-command-line-option.patch --]
[-- Type: text/x-patch, Size: 2313 bytes --]
From 192f96a3fa4342765db919006c35cdeb1774b62f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@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
[-- Attachment #5: Type: text/plain, Size: 246 bytes --]
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'...
next reply other threads:[~2019-07-20 5:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-20 5:05 宋文武 [this message]
2019-07-22 16:48 ` [bug#36738] [PATCH] guix deploy: Support '--no-grafts' and '--system' Jakob L. Kreuze
2019-07-22 22:46 ` Jakob L. Kreuze
2019-07-23 16:45 ` Christopher Lemmer Webber
2019-07-23 19:33 ` Jakob L. Kreuze
2019-07-23 21:59 ` Ricardo Wurmus
2019-07-24 0:11 ` Jakob L. Kreuze
2019-07-23 17:05 ` Thompson, David
2019-07-23 19:35 ` Jakob L. Kreuze
2019-07-23 16:44 ` Christopher Lemmer Webber
2019-07-23 21:29 ` Ludovic Courtès
2019-07-24 12:36 ` bug#36738: " 宋文武
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=87a7d9l2hw.fsf@member.fsf.org \
--to=iyzsong@member.fsf.org \
--cc=36738@debbugs.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).