From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id ePaiKtE2dWKtJQEAbAwnHQ (envelope-from ) for ; Fri, 06 May 2022 16:55:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qMx+KtE2dWI0QwAA9RJhRA (envelope-from ) for ; Fri, 06 May 2022 16:55:13 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 38F7B30FC3 for ; Fri, 6 May 2022 16:55:13 +0200 (CEST) Received: from localhost ([::1]:54846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmzMN-0006Hz-Da for larch@yhetil.org; Fri, 06 May 2022 10:55:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmzMF-0006Hq-44 for guix-patches@gnu.org; Fri, 06 May 2022 10:55:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nmzME-0008HT-RY for guix-patches@gnu.org; Fri, 06 May 2022 10:55:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nmzME-0003hc-Qz for guix-patches@gnu.org; Fri, 06 May 2022 10:55:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55220] [PATCH 0/4] Add --list-systems and --list-targets options. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 06 May 2022 14:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55220 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 55220@debbugs.gnu.org Received: via spool by 55220-submit@debbugs.gnu.org id=B55220.165184885514147 (code B ref 55220); Fri, 06 May 2022 14:55:02 +0000 Received: (at 55220) by debbugs.gnu.org; 6 May 2022 14:54:15 +0000 Received: from localhost ([127.0.0.1]:49412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nmzLT-0003g7-EA for submit@debbugs.gnu.org; Fri, 06 May 2022 10:54:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nmzLR-0003fs-MS for 55220@debbugs.gnu.org; Fri, 06 May 2022 10:54:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmzLM-00084r-CY for 55220@debbugs.gnu.org; Fri, 06 May 2022 10:54:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=6aTU0ifpLcFLC4cx9lxkFiOJrP5FjaoDOLf5dGXgQVw=; b=rnnebpYIOG6jLXikzJvO riYW0FLD8uRzamCqhX1KESamVigMRccFFKAyqjcotEfW+JiqZUNV+1Kz2x92TRiQhktBtfA55mjfT EBeV3JuYfBOZvezJzS0emPaGDDoStIjjaXyXoT0gCG3AgTC51DJmGes4e9VbG1Glwnxu3OsZ+fmAL veeoL+bRoruNCo3AHImK6uN5TwluhX3Q9IQWtlz3D93SlyOFdUP7Px8mt8fAYVSQLumqhAW5j8bfr uVJ8VT7ZbBfV//GAXi2RdP/pV0sRoAQtlEJoJvGMitBf8KMu/Ul7f9DXamiAOUsGXinjuZL3XXt9m fWmbHA09kkbCKA==; Received: from [193.50.110.244] (port=52674 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmzLL-0007Y5-UR; Fri, 06 May 2022 10:54:08 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220502111859.13605-1-othacehe@gnu.org> <20220502111859.13605-4-othacehe@gnu.org> Date: Fri, 06 May 2022 16:54:06 +0200 In-Reply-To: <20220502111859.13605-4-othacehe@gnu.org> (Mathieu Othacehe's message of "Mon, 2 May 2022 13:18:59 +0200") Message-ID: <875ymi3e5t.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651848913; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6aTU0ifpLcFLC4cx9lxkFiOJrP5FjaoDOLf5dGXgQVw=; b=YpgLaUd4G7SNHuYPnYAuvW7UbHdxxRGKRi/oQLp+h5Q8znyBU1S64QZRKHAgOMzo7MnUoX 4jTSpMwmjuirbyn6f20zGO3+mbHlnz+R/cB3LaQlA+gJ6neemtCnuiKflzVnnX39THbyVt 98f88MVLvkQ48HiDivlolXQkloVEu+c69O421N4gfspxrD0Q7aQyve7+F3SlUpVT6n8VHu zpRzF5QnMDsjcOZRzMRb0F/P2HpMJQKsFmDIoLnuMmEWe0Q5wAnXMffRToekYfjWIIHygP 0tdK95Fy38G8PjFDjyPfCsZ0dXj59LSpcgg26AuieKP3RsH42lKKF//mO/PDfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651848913; a=rsa-sha256; cv=none; b=fnzjwdKq8V+GBkK7RR0ZI6AcWa7YAxvgyrBC2FSz7PB8MfGPK603y1szQB62OcuaUCv7XH UgdI51nRB7FSzSzgikJp9ljz54kQknuVUuhWooQNs60DllR0wtP1PJTkFOIoNcdwZkc5RF 0Gc32ONmfyRQ7QCLrnGqa/WGrhxhVzR9m9lNoxxy//LsML85QnB7q+BknJkx9Zq/UjKsQv iKwkz4r2d9sdiWTKfeFqcieN1hVF8evCZcQ0cWB3M8aXAl2xM3hVVe6FQ5uHEbSv4a65qW 2myJqB5SFeJJQ2hwe8rNQ0CDCc7+Nu3gqQNG15k2jtbMJTJVRGY7KxRGkvFKrQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=rnnebpYI; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=rnnebpYI; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 38F7B30FC3 X-Spam-Score: -3.90 X-Migadu-Scanner: scn1.migadu.com X-TUID: R5hcwi6Qnq8t Mathieu Othacehe skribis: > Also factorize the --system and --target build options. Check that the pa= ssed > system and target arguments are known platforms. > > * doc/guix.texi (Additional Build Options): Document the new --list-syste= ms > and --list-targets options. > * guix/scripts/build.scm (show-cross-build-options-help, > show-emulated-build-options-help, list-systems, list-targets): New proced= ures. > (%standard-cross-build-options, %standard-emulated-build-options): New > variables. > (show-help): Remove --system and --target entries and use > show-cross-build-options-help and show-emulated-build-options-help proced= ures instead. > (%options): Remove --system and --target entries and use > %standard-cross-build-options and %standard-emulated-build-options variab= les instead. > * guix/scripts/archive.scm (show-help, %options): Adapt them. > * guix/scripts/environment.scm: Ditto. > * guix/scripts/graph.scm: Ditto. > * guix/scripts/pack.scm: Ditto. > * guix/scripts/pull.scm: Ditto. > * guix/scripts/size.scm: Ditto. > * guix/scripts/weather.scm: Ditto. > > Signed-off-by: Mathieu Othacehe [...] > +@item --list-systems > +List all the supported systems, than can be passed as @var{system} > +argument. =E2=80=9Cas an argument to @option{--system}=E2=80=9D maybe? > +@item --list-targets > +List all the supported targets, than can be passed as @var{target} > +argument. Likewise. > +(define %standard-cross-build-options > + ;; Build options related to cross builds. > + (list > + (option '("list-targets") #f #f > + (lambda (opt name arg result) > + (list-targets) > + (exit 0))) > + (option '("target") #t #f > + (lambda (opt name arg result . rest) > + (let ((t (false-if-exception > + (first (member arg (targets)))))) > + (if t > + (apply values (alist-cons 'target t result) rest) > + (leave (G_ "'~a' is not a supported target.~%") > + arg))))))) This is my main issue: should we still accept any triplet, and simply print a nicer error than currently when the glibc dynamic linker name is unknown? Or should be be just as strict as above, at the risk of frustrating developers porting stuff to new or unusual platforms? Or should there be an option to bypass this check? Maybe I=E2=80=99m overrating the usefulness of allowing users to pass in arbitrary triplets, though the manual does suggest that when porting to a new platform (info "(guix) Porting"). Thoughts? > +(define %standard-emulated-build-options > + ;; Build options related to emulated builds. > + (list > + (option '("list-systems") #f #f > + (lambda (opt name arg result) > + (list-systems) > + (exit 0))) > + (option '(#\s "system") #t #f > + (lambda (opt name arg result . rest) > + (let ((s (false-if-exception > + (first (member arg (systems)))))) > + (if s > + (apply values (alist-cons 'system s result) rest) > + (leave (G_ "'~a' is not a supported system.~%") > + arg))))))) Since it has nothing to do with emulation :-), how about calling it =E2=80=98%standard-native-build-options=E2=80=99, =E2=80=98%standard-system= -type-build-options=E2=80=99, or similar? How about replacing: (let ((s (false-if-exception (first (member arg (systems)))))) (if s =E2=80=A6)) with: (if (member arg (systems)) =E2=80=A6) ? Also, please remove final period in the error message passed to =E2=80=98le= ave=E2=80=99. Anyway, overall this patch series is a clear improvement over the status quo, so this is just about fine-tuning the details. Thanks! Ludo=E2=80=99.