From patchwork Mon May 2 11:17:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 745 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 23BDD27BBEA; Mon, 2 May 2022 12:28:22 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 BC11D27BBE9 for ; Mon, 2 May 2022 12:28:21 +0100 (BST) Received: from localhost ([::1]:39182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlUE0-0006ku-Uz for patchwork@mira.cbaines.net; Mon, 02 May 2022 07:28:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlU42-0000Ez-UR for guix-patches@gnu.org; Mon, 02 May 2022 07:18:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlU42-0005Pd-Du for guix-patches@gnu.org; Mon, 02 May 2022 07:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlU42-0005eX-5x for guix-patches@gnu.org; Mon, 02 May 2022 07:18:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55220] [PATCH 0/4] Add --list-systems and --list-targets options. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 May 2022 11:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55220 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55220@debbugs.gnu.org Cc: Mathieu Othacehe X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165149025421669 (code B ref -1); Mon, 02 May 2022 11:18:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 May 2022 11:17:34 +0000 Received: from localhost ([127.0.0.1]:34994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlU3a-0005dK-Dk for submit@debbugs.gnu.org; Mon, 02 May 2022 07:17:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:53326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlU3V-0005Ye-6c for submit@debbugs.gnu.org; Mon, 02 May 2022 07:17:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlU3U-0006pG-W5 for guix-patches@gnu.org; Mon, 02 May 2022 07:17:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlU3U-0005M3-MU for guix-patches@gnu.org; Mon, 02 May 2022 07:17:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=iQH5HxaJB5BGYHtxdU+qLWqTMZdpS/0ImMp1K1NABGI=; b=ZnwvtIproNRZ+t tvKcQ4s4xB0GsTbM3GuJy/CY6HrJ8MfZ+XoXD6mRhR689/RtS/DuiTXhSDNHSgsbbY/3+SG08shuX FShzl0ig1Czks2NkuImGfGNvTjcm9xYXxCWIeIPMTH/JnDHjDsUGSd3L2qEkeRDke0uFpFTp7S1mS ENYxANMcXX+hbWLTjy4gzzEsgUkZIc6NheBx1+pbOeIULACptaXw+WwRojqHhdLCPNBirRBVQ+GGV tc5PB1YxcDJCf7/ppDuSwlVTGXFw8+j+3Kn+cg98Q0fRMX1lr2s/1/4fBR9eMqh1P7xZeJN9AAJu0 xieB9gPvp+uaHluYc+EQ==; Received: from 71.125.192.77.rev.sfr.net ([77.192.125.71]:33766 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlU3U-0003Em-6j; Mon, 02 May 2022 07:17:28 -0400 From: Mathieu Othacehe Date: Mon, 2 May 2022 13:17:15 +0200 Message-Id: <20220502111715.13500-1-othacehe@gnu.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 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" X-getmail-retrieved-from-mailbox: Patches Hello, Most build commands support --system and --target options. Those options suffer from multiple issues: they are never listed and never checked. For --system, this is a real issue as aside from reading the (gnu packages bootstrap) module content the user cannot know what are the supported arguments. Providing a wrong system also fails badly: mathieu@meije ~$ guix build hello --system=arm-linux Backtrace: In guix/memoization.scm: 101:0 19 (_ # # …) ... ice-9/boot-9.scm:1685:16: In procedure raise-exception: dynamic linker name not known for this system "arm-linux" For --target, any GNU supported triplet can possibly work but providing a wrong triplet will also fail badly: mathieu@meije ~$ guix build hello --target=arm-linux Backtrace: In guix/store.scm: 1385:9 19 (map/accumulate-builds # …) ... ice-9/boot-9.scm:1685:16: In procedure raise-exception: dynamic linker name not known for this system "arm-linux" This patchset adds two new options: --list-systems and --list-targets that list the supported systems and targets. The arguments passed to --system and --target options are also checked: mathieu@meije ~/guix [env]$ ./pre-inst-env guix build hello --system=arm-linux guix build: error: 'arm-linux' is not a supported system. mathieu@meije ~/guix [env]$ ./pre-inst-env guix build hello --target=arm-linux guix build: error: 'arm-linux' is not a supported target. Thanks, Mathieu Mathieu Othacehe (4): platform: Introduce new platforms. platform: Add discovery support. ci: Do not rely on hardcoded cross-targets lists. scripts: Add --list-systems and --list-targets options. doc/guix.texi | 8 ++++ etc/release-manifest.scm | 4 +- gnu/ci.scm | 15 +------ gnu/local.mk | 4 ++ gnu/platform.scm | 62 ++++++++++++++++++++++++-- gnu/platforms/intel.scm | 48 +++++++++++++++++++++ gnu/platforms/mips.scm | 29 +++++++++++++ gnu/platforms/powerpc.scm | 36 ++++++++++++++++ gnu/platforms/riscv.scm | 29 +++++++++++++ guix/scripts/archive.scm | 20 +++------ guix/scripts/build.scm | 84 ++++++++++++++++++++++++++++++------ guix/scripts/environment.scm | 11 ++--- guix/scripts/graph.scm | 15 +++---- guix/scripts/pack.scm | 20 +++------ guix/scripts/pull.scm | 12 +++--- guix/scripts/size.scm | 13 +++--- guix/scripts/weather.scm | 11 +++-- 17 files changed, 329 insertions(+), 92 deletions(-) create mode 100644 gnu/platforms/intel.scm create mode 100644 gnu/platforms/mips.scm create mode 100644 gnu/platforms/powerpc.scm create mode 100644 gnu/platforms/riscv.scm