unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Thiago Jung Bauermann via Guix-patches via <guix-patches@gnu.org>
To: 57314@debbugs.gnu.org
Cc: Thiago Jung Bauermann <bauermann@kolabnow.com>
Subject: [bug#57314] [PATCH] guix system: Use standard cross and native build options.
Date: Sun, 21 Aug 2022 03:11:24 -0300	[thread overview]
Message-ID: <20220821061125.47120-1-bauermann@kolabnow.com> (raw)

This change prevents guix system from erroring out with an ugly backtrace
when it's passed an invalid value to the “--system” or “--target”
option. It also adds the “--list-systems” and “--list-targets” options.

The manual section about guix system doesn't mention the “--target” option,
so add it there.

* guix/scripts/system (show-help): Call show-cross-build-options-help and
show-native-build-options-help.
(%options): Remove own implementation of “system” and “target” options and
use the ones in %standard-cross-build-options and
%standard-native-build-options.
* doc/guix.texi (Invoking guix system): Document “--target” option.
---
 doc/guix.texi           |  5 +++++
 guix/scripts/system.scm | 16 +++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 023b48ae3507..e8f05ffdeb51 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -37533,6 +37533,11 @@ Installation Image}).
 Attempt to build for @var{system} instead of the host system type.
 This works as per @command{guix build} (@pxref{Invoking guix build}).
 
+@item --target=@var{triplet}
+Cross-build for @var{triplet}, which must be a valid GNU triplet, such
+as @code{"aarch64-linux-gnu"} (@pxref{Specifying target triplets, GNU
+configuration triplets,, autoconf, Autoconf}).
+
 @item --derivation
 @itemx -d
 Return the derivation file name of the given operating system without
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index be6e83994100..443e9d3282fc 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -1046,6 +1046,10 @@ (define (show-help)
                          for 'describe' and 'list-generations', list installed
                          packages matching REGEXP"))
   (newline)
+  (show-cross-build-options-help)
+  (newline)
+  (show-native-build-options-help)
+  (newline)
   (display (G_ "
   -h, --help             display this help and exit"))
   (display (G_ "
@@ -1136,14 +1140,6 @@ (define %options
                    (let ((level (string->number* arg)))
                      (alist-cons 'verbosity level
                                  (alist-delete 'verbosity result)))))
-         (option '(#\s "system") #t #f
-                 (lambda (opt name arg result)
-                   (alist-cons 'system arg
-                               (alist-delete 'system result eq?))))
-         (option '("target") #t #f
-                 (lambda (opt name arg result)
-                   (alist-cons 'target arg
-                               (alist-delete 'target result eq?))))
          (option '(#\r "root") #t #f
                  (lambda (opt name arg result)
                    (alist-cons 'gc-root arg result)))
@@ -1153,7 +1149,9 @@ (define %options
          (option '(#\I "list-installed") #f #t
                  (lambda (opt name arg result)
                    (alist-cons 'list-installed (or arg "") result)))
-         %standard-build-options))
+         (append %standard-build-options
+                 %standard-cross-build-options
+                 %standard-native-build-options)))
 
 (define %default-options
   ;; Alist of default option values.




             reply	other threads:[~2022-08-21  6:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-21  6:11 Thiago Jung Bauermann via Guix-patches via [this message]
2022-08-30  6:56 ` bug#57314: [PATCH] guix system: Use standard cross and native build options Mathieu Othacehe
2022-08-31  5:16   ` [bug#57314] " Thiago Jung Bauermann via Guix-patches via

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=20220821061125.47120-1-bauermann@kolabnow.com \
    --to=guix-patches@gnu.org \
    --cc=57314@debbugs.gnu.org \
    --cc=bauermann@kolabnow.com \
    /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).