From patchwork Sun Aug 21 06:11:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 41791 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C693227BBEA; Sun, 21 Aug 2022 07:12:43 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 422B427BBE9 for ; Sun, 21 Aug 2022 07:12:43 +0100 (BST) Received: from localhost ([::1]:60298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPeCQ-0003Up-48 for patchwork@mira.cbaines.net; Sun, 21 Aug 2022 02:12:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPeBu-0003TN-Mg for guix-patches@gnu.org; Sun, 21 Aug 2022 02:12:11 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43946) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPeBm-0005iX-59 for guix-patches@gnu.org; Sun, 21 Aug 2022 02:12:10 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oPeBl-00081F-Pu for guix-patches@gnu.org; Sun, 21 Aug 2022 02:12:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57314] [PATCH] guix system: Use standard cross and native build options. Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 21 Aug 2022 06:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57314 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57314@debbugs.gnu.org Cc: Thiago Jung Bauermann X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166106231930815 (code B ref -1); Sun, 21 Aug 2022 06:12:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Aug 2022 06:11:59 +0000 Received: from localhost ([127.0.0.1]:33695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPeBj-00080x-7m for submit@debbugs.gnu.org; Sun, 21 Aug 2022 02:11:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:60924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPeBg-00080p-ML for submit@debbugs.gnu.org; Sun, 21 Aug 2022 02:11:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPeBX-0003T6-Hz for guix-patches@gnu.org; Sun, 21 Aug 2022 02:11:49 -0400 Received: from mx.kolabnow.com ([212.103.80.153]:45796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPeBR-0005i1-Q6 for guix-patches@gnu.org; Sun, 21 Aug 2022 02:11:46 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id F3CBE41883 for ; Sun, 21 Aug 2022 08:11:34 +0200 (CEST) Authentication-Results: ext-mx-out003.mykolab.com (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received :received:received; s=dkim20160331; t=1661062294; x=1662876695; bh=N+HMLU1ZjGuk7PZV86aEjW7sHKOXvoPZBajKpYnZDeM=; b=EbS9iJHijy7n rUuAOD1ymQRqmPuxk+JPtf/cmEajsqFBhymhNItIRR3ffAidcbF8VdZYHKgvoAcM 3eEY2D/q4vDnUGuCU4/7yvxPM591EhL7Z116MrCHSl/FwiEE5f1XmR6qrukqZ7T4 vIYU+1/+WAsy19F55iUnTeStPrQcJ0Oc0VBAEpaJTO6xXjQZrl7C04D0pkEAnXii Qc5a1euUasy8RpgW1ae/PR8RC71iD/5E4FSlO201Ca6K6hLxLG//MZ21gT/N5VD0 gG7vGwJMuYrczUmObUq9iaG/P1VwR2okZTmAa+C/FRZ0Eq2wSCtCC7wuxOhjOPaH Yj4bV8z8Ps1nkvf7iKRhkEe7mIJFg2OOOUz8/6gnXTyUhaGLQZi1lliqVfYWx2c4 wDgajhAUNDhjwHtUfqmNXKgHqfRYrQ74LSU4eDKAQFgljJUNHuhM/vmSh3xVrj5w XzsYticSGq/3z0H3sazhhrXAm9zxyDMfbHBtwoO97PUnC0PuYooQzFxQ58rMieiY PkZytVg7HDZNY+Tr3UZ9Ju7CRAfb1kYuBY0agXmM5V3c8WMddwvV9A+ObbxoYQq7 mXwuX6IYtcHrXWVzhAmvoG56AJO44o8+kmt2D9dlhs1DusrYUjI0fshOPHCctV0U tU28VspcLD9fHJ2lOH7KqMYotIiicK0= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b2BCozpD_Rhc for ; Sun, 21 Aug 2022 08:11:34 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by mx.kolabnow.com (Postfix) with ESMTPS id B86A440F97 for ; Sun, 21 Aug 2022 08:11:33 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 80622156; Sun, 21 Aug 2022 08:11:33 +0200 (CEST) Date: Sun, 21 Aug 2022 03:11:24 -0300 Message-Id: <20220821061125.47120-1-bauermann@kolabnow.com> MIME-Version: 1.0 Received-SPF: pass client-ip=212.103.80.153; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches X-Patchwork-Original-From: Thiago Jung Bauermann via Guix-patches via From: Thiago Jung Bauermann X-getmail-retrieved-from-mailbox: Patches 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.