From patchwork Sat Jan 14 03:08:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 46106 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 3E92227BBEB; Sat, 14 Jan 2023 03:09:34 +0000 (GMT) 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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS 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 9660127BBE9 for ; Sat, 14 Jan 2023 03:09:33 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGWuq-0001KU-EC; Fri, 13 Jan 2023 22:09:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGWuk-0001JX-QU for guix-patches@gnu.org; Fri, 13 Jan 2023 22:09:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGWuk-0005id-Fr for guix-patches@gnu.org; Fri, 13 Jan 2023 22:09:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGWuk-0002Pa-BJ for guix-patches@gnu.org; Fri, 13 Jan 2023 22:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60802] [PATCH 1/2] platforms: Raise an exception when no suitable platform is found. References: <20230114030542.23524-1-maxim.cournoyer@gmail.com> In-Reply-To: <20230114030542.23524-1-maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Jan 2023 03:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60802@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Ricardo Wurmus Received: via spool by 60802-submit@debbugs.gnu.org id=B60802.16736657319237 (code B ref 60802); Sat, 14 Jan 2023 03:09:02 +0000 Received: (at 60802) by debbugs.gnu.org; 14 Jan 2023 03:08:51 +0000 Received: from localhost ([127.0.0.1]:52889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGWuY-0002Ov-Ep for submit@debbugs.gnu.org; Fri, 13 Jan 2023 22:08:50 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:34813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGWuX-0002Oh-0j for 60802@debbugs.gnu.org; Fri, 13 Jan 2023 22:08:49 -0500 Received: by mail-qt1-f172.google.com with SMTP id e22so8196581qts.1 for <60802@debbugs.gnu.org>; Fri, 13 Jan 2023 19:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=whdfB9FbqUidVpHK3Bl0OCLIlSfUs/XHMR/BKsPM9AY=; b=Hus63zSUkcLszdPkhoyPCAY8V1fnmAguNGOxlUjQdIcCHUapT/x9YytI58IAdunxby IKrXflLGlDu9CUdaP1c4yxMjwXZ40YtqpUD0mAEwvYfYrPmahVy3+j0/uVfXByfEM2az QR1dbXlQJdMhng+xS3ZSDPn9fZ7bG7zNMQVTnG23WGkfKoeEKFDFyudkGNSKlEDjCmRy 0CZDbrlmP0c7dM6JI/7OqoaFGqDUAR62AYlSTXlWCQiLA/t9RlIQahVQv8RvgtM7oYCY eIJVrT3Ese+vW8/j0CQNk/LIJwHdsusGdydXUx28uxENnTQ9I5YgwQ8e1OOemRljys3q S0Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=whdfB9FbqUidVpHK3Bl0OCLIlSfUs/XHMR/BKsPM9AY=; b=f/sO46E+bc0qdvkLaTqJF/jyyFjwDO6ewAKzUHZuhwXTEko0DFvTpQ9y6Hkbum63jS jSnhWuCKL5SF4QsnTZXLtYgUd3dBQ+JgcAdDFUiEfcnymBPEWuC1X5hUJStaAwnenUGA In0jlIfuVrjQJAG5f74ZYUbFO9AEIEUCEtBu+F+zUthUbA8yHLO0hKhLxUbqD8Qhdtba DQBLq10nqdZOMQ16SDqXzwk0zP8zaoAccFDKQ5CVRgHl1Sb8F8N6ueNA3eLCHgQfp3Nw 99M2UJbnIkC890N3NjO9u7QaVWirvAR6PjYzDBCCbA35bTCygRhMQyY8W3VIbOyu7oL8 7UCA== X-Gm-Message-State: AFqh2kpzUG7IR6BG3amlAf8abCtC1vZlxKsvIc1fJ2fRKFkuY1H5Hjpk Ahf7OAKT16zaQyDaQf1t3gGHUGEZqUQjsihd X-Google-Smtp-Source: AMrXdXv8wSaj2RUl6NgervCpCC/CoIs3IOmswhGgXd/SCwNSf3OzXF0OyKydw25ibGKu1pDvVALejQ== X-Received: by 2002:a05:622a:1f10:b0:3a5:10c3:13ff with SMTP id ca16-20020a05622a1f1000b003a510c313ffmr112712045qtb.48.1673665723025; Fri, 13 Jan 2023 19:08:43 -0800 (PST) Received: from localhost.localdomain (dsl-10-149-10.b2b2c.ca. [72.10.149.10]) by smtp.gmail.com with ESMTPSA id t11-20020a05620a034b00b006fa31bf2f3dsm13584261qkm.47.2023.01.13.19.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 19:08:42 -0800 (PST) From: Maxim Cournoyer Date: Fri, 13 Jan 2023 22:08:16 -0500 Message-Id: <20230114030817.23959-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This was motivated by #60786, which produced a cryptic, hard to understand backtrace. * guix/platform.scm (&platform-not-found-error): New exception type. (make-platform-not-found-error): New exception constructor. (platform-not-found-error?): New predicate. (lookup-platform-by-system): Raise an exception when no platform is found. Update documentation. (lookup-platform-by-target): Likewise. (lookup-platform-by-target-or-system): Likewise. --- gnu/packages/bootstrap.scm | 2 +- guix/platform.scm | 44 +++++++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index d2914fb5a7..772be7e5e4 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -315,7 +315,7 @@ (define* (glibc-dynamic-linker (%current-system)))) "Return the name of Glibc's dynamic linker for SYSTEM." ;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc. - (let ((platform (lookup-platform-by-system system))) + (let ((platform (false-if-exception (lookup-platform-by-system system)))) (cond ((platform? platform) (platform-glibc-dynamic-linker platform)) diff --git a/guix/platform.scm b/guix/platform.scm index f873913fe0..c2be66e227 100644 --- a/guix/platform.scm +++ b/guix/platform.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Mathieu Othacehe +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +22,7 @@ (define-module (guix platform) #:use-module (guix memoization) #:use-module (guix records) #:use-module (guix ui) + #:use-module (ice-9 exceptions) #:use-module (srfi srfi-1) #:export (platform platform? @@ -29,6 +31,10 @@ (define-module (guix platform) platform-linux-architecture platform-glibc-dynamic-linker + &platform-not-found-error + make-platform-not-found-error + platform-not-found-error? + platform-modules platforms lookup-platform-by-system @@ -70,6 +76,14 @@ (define-record-type* platform make-platform (default #false)) (glibc-dynamic-linker platform-glibc-dynamic-linker)) + +;;; +;;; Exception types. +;;; +(define-exception-type &platform-not-found-error &error + make-platform-not-found-error platform-not-found-error?) + + ;;; ;;; Platforms. @@ -94,23 +108,29 @@ (define platforms (platform-modules))))) (define (lookup-platform-by-system system) - "Return the platform corresponding to the given SYSTEM." - (find (lambda (platform) - (let ((s (platform-system platform))) - (and (string? s) (string=? s system)))) - (platforms))) + "Return the platform corresponding to the given SYSTEM. Raise +&PLATFORM-NOT-FOUND-ERROR when no platform could be found." + (or (find (lambda (platform) + (let ((s (platform-system platform))) + (and (string? s) (string=? s system)))) + (platforms)) + (raise-exception (make-platform-not-found-error)))) (define (lookup-platform-by-target target) - "Return the platform corresponding to the given TARGET." - (find (lambda (platform) - (let ((t (platform-target platform))) - (and (string? t) (string=? t target)))) - (platforms))) + "Return the platform corresponding to the given TARGET. Raise +&PLATFORM-NOT-FOUND-ERROR when no platform could be found." + (or (find (lambda (platform) + (let ((t (platform-target platform))) + (and (string? t) (string=? t target)))) + (platforms)) + (raise-exception (make-platform-not-found-error)))) (define (lookup-platform-by-target-or-system target-or-system) - "Return the platform corresponding to the given TARGET or SYSTEM." + "Return the platform corresponding to the given TARGET or SYSTEM. Raise +&PLATFORM-NOT-FOUND-ERROR when no platform could be found." (or (lookup-platform-by-target target-or-system) - (lookup-platform-by-system target-or-system))) + (lookup-platform-by-system target-or-system) + (raise-exception (make-platform-not-found-error)))) (define (platform-system->target system) "Return the target matching the given SYSTEM if it exists or false From patchwork Sat Jan 14 03:08:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 46107 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 31E5F27BBED; Sat, 14 Jan 2023 03:09:39 +0000 (GMT) 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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 B94F527BBE9 for ; Sat, 14 Jan 2023 03:09:38 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGWun-0001K6-Kq; Fri, 13 Jan 2023 22:09:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGWul-0001Je-6q for guix-patches@gnu.org; Fri, 13 Jan 2023 22:09:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGWuk-0005il-VK for guix-patches@gnu.org; Fri, 13 Jan 2023 22:09:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGWuk-0002Ph-Qh for guix-patches@gnu.org; Fri, 13 Jan 2023 22:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60802] [PATCH 2/2] gnu: Remove u-boot-malta. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Jan 2023 03:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60802@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 60802-submit@debbugs.gnu.org id=B60802.16736657379259 (code B ref 60802); Sat, 14 Jan 2023 03:09:02 +0000 Received: (at 60802) by debbugs.gnu.org; 14 Jan 2023 03:08:57 +0000 Received: from localhost ([127.0.0.1]:52892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGWue-0002PH-V4 for submit@debbugs.gnu.org; Fri, 13 Jan 2023 22:08:57 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:43529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGWuc-0002Ot-Sp for 60802@debbugs.gnu.org; Fri, 13 Jan 2023 22:08:55 -0500 Received: by mail-qv1-f49.google.com with SMTP id q10so16024219qvt.10 for <60802@debbugs.gnu.org>; Fri, 13 Jan 2023 19:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HYWtvVDo91rSYxihkALtfjXQRX6VZFL/bMRpEvDPiVU=; b=qxDhlTLvQnQPhcvK6HEeMBR5gHe04Jid0cPUaZZW8AyQZTHNXIt6czjS3mtMMFltL4 qxihlgwwfkSoz66nh+H5fYjtTyIaG1lnTmW/cb2QP0uFbsOb1cyY5IGA/kZRgxI+Tn6B RuW6eVnW40Cm4CjEcQJK77l+0FGW/TpzzEIKDLRhTu4x39CtpuZ9zcQJDKB00KD76qXG x5fiCtIQuzHG/6wQ8cYPrpTb+vHG3ersABRcLkAcp3JyFdqXsKVknWbQUfO57/18pSHh jTQNX8V64oAwaEyECBXC7tfzwBfeNBlEn2vcA0kCxL4/c6aFC2lVNRsXRBotnXmUydwA w1Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HYWtvVDo91rSYxihkALtfjXQRX6VZFL/bMRpEvDPiVU=; b=W/xeq5IWnDRCVzUrZevcYgBIAqWHBx4n3zei/0jlFzMLbOvTJU4wf2DFsOabOSRyZx FhZkKT2flWSiIPQIe3q8XxpJqM2+5ZVoxWZqdrTMVy+cMejDLOkXIwFLkyXcniOlTuL8 dOvRV+AyJ+LA8wyvei93j7oujHQ5ezBPsqTr16aDtWpHfMVj2jiZpFIT/cq/D0gl8hvo vhxjLX3o3/PN8fy0jJz4u9r8Nw0IRpsaHof8trquCZcRB9mrcFePy9kRrRtjKZ6rPczD CLGI8RzVapP0pemI5tCRNppqTWeMsEBQHx4eUd/fgY5f7sAa/Cz08lRfDTju5ctbwVLx xxNw== X-Gm-Message-State: AFqh2kpjijpc+thQFTzUXaGjdmpHgDaTAtleuOEgJvXNHfc7tsWSmA59 oJMFb6qc84E+77XF+vlTp3g19YGfvomkMWQ6 X-Google-Smtp-Source: AMrXdXsJzV4DWmLr9cmIaUkVwj0bL/qCoKIQ10CiOc7SjHJuKu6SzE04grsRBboGQ1Tn0+qBmMORZg== X-Received: by 2002:a05:6214:4116:b0:532:299d:99c9 with SMTP id kc22-20020a056214411600b00532299d99c9mr22944305qvb.1.1673665729193; Fri, 13 Jan 2023 19:08:49 -0800 (PST) Received: from localhost.localdomain (dsl-10-149-10.b2b2c.ca. [72.10.149.10]) by smtp.gmail.com with ESMTPSA id t11-20020a05620a034b00b006fa31bf2f3dsm13584261qkm.47.2023.01.13.19.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 19:08:48 -0800 (PST) From: Maxim Cournoyer Date: Fri, 13 Jan 2023 22:08:17 -0500 Message-Id: <20230114030817.23959-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230114030817.23959-2-maxim.cournoyer@gmail.com> References: <20230114030817.23959-2-maxim.cournoyer@gmail.com> 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Relates to . The mips64el architecture is not currently supported, causing (guix platform) to raise an exception when attempting to cross-build the package. * gnu/packages/bootloaders.scm (u-boot-malta): Delete variable. --- gnu/packages/bootloaders.scm | 3 --- 1 file changed, 3 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 6e6bdb4c08..8dc6ff698d 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -965,9 +965,6 @@ (define*-public (make-u-boot-package board triplet uboot-files) #t))))))))) -(define-public u-boot-malta - (make-u-boot-package "malta" "mips64el-linux-gnuabi64")) - (define-public u-boot-am335x-boneblack (let ((base (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf"