From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cIQODKi9wmP/PAAAbAwnHQ (envelope-from ) for ; Sat, 14 Jan 2023 15:35:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MLzBC6i9wmMwsAAAauVa8A (envelope-from ) for ; Sat, 14 Jan 2023 15:35:20 +0100 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 A5B042A8D3 for ; Sat, 14 Jan 2023 15:35:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGhce-0003FO-QU; Sat, 14 Jan 2023 09:35:04 -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 1pGhcc-0003F6-KX for guix-patches@gnu.org; Sat, 14 Jan 2023 09:35: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 1pGhcc-0005s1-Be for guix-patches@gnu.org; Sat, 14 Jan 2023 09:35:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGhcc-0007bz-0F for guix-patches@gnu.org; Sat, 14 Jan 2023 09:35:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60802] [PATCH v2 1/2] platforms: Raise an exception when no suitable platform is found. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Jan 2023 14:35:01 +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: Maxim Cournoyer Cc: Tobias Geerinckx-Rice , Josselin Poiret , 60802@debbugs.gnu.org, Simon Tournier , Mathieu Othacehe , Christopher Baines , Ricardo Wurmus Received: via spool by 60802-submit@debbugs.gnu.org id=B60802.167370689529231 (code B ref 60802); Sat, 14 Jan 2023 14:35:01 +0000 Received: (at 60802) by debbugs.gnu.org; 14 Jan 2023 14:34:55 +0000 Received: from localhost ([127.0.0.1]:53703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGhcU-0007bO-Ui for submit@debbugs.gnu.org; Sat, 14 Jan 2023 09:34:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGhcS-0007bB-U5 for 60802@debbugs.gnu.org; Sat, 14 Jan 2023 09:34:53 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGhcN-0005qN-2r; Sat, 14 Jan 2023 09:34:47 -0500 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=pRQf/xrRkVWk6M84fd9/MogBQLBQ675pq/JEaVoRFdQ=; b=bxOGE4vUqiWxpcEuZl5H IHg+P0+qqE7xxHGC0cKYWxJd+73kxPNPdRLog2oC5a6YOO/c0QaHFwm3Pff/RK8DfX3SAyBIe4lV2 cIp6wHC5pqcPxEuASzjoML49rY2m9PO+fGrUDowBcr/9n9xLnGkuNFSItMSI1OQeqRj42ioOCP7Yk 8wzhpYbLFEgHuzx9z6rJa8ZkZVvdI80wU7l1MZv6lniVhEm42dWUm1SQCHdUiUGqTq0VOZ1jX3z7R ME046ua16LkHjeBSXTj6zOu/tNJ7OcP1iGx7PIHedzMe4KZvh05Z3ecv5mF+DmidS8SbfoJoaUgXZ QFt5GaKyrnrbQw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGhcA-0001Ue-6y; Sat, 14 Jan 2023 09:34:46 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20230114041903.7121-2-maxim.cournoyer@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 25 =?UTF-8?Q?Niv=C3=B4se?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Chat X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 14 Jan 2023 15:34:32 +0100 In-Reply-To: <20230114041903.7121-2-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Fri, 13 Jan 2023 23:19:02 -0500") Message-ID: <87o7r19ocn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673706919; a=rsa-sha256; cv=none; b=RAc5bgaxblQtVh/UKx87hPwmKi+V3sBaaj84E6GcSYyrstxcG3EQTWi7CcjQNpxJw3Xy4I Ht44u3s45zTQFRCs+Ud5JJd4OmA6ngkPG0bWZfWSw6qGpP/cQs4ast5oODxTpTeWa432Ip /h5/Ogte4hwzBxrXLPCrkynRHuTodGI/ChqpYRXuzoT37C5ecsWkaBcvM/1JWU3Xzglu5b jaWpdYCoLik7XM2rEax9jXrLJpNkEuYuEgm8B5CLaazGoKPXm7LbJUEtE4UBVCVRw9OHvc puQEhlmm6MxL3KW/osjmoX50rpwQCR+eqPCaJ6aL5yBXzDJhVjnlh2urhOU5CQ== 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=bxOGE4vU; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673706919; 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=pRQf/xrRkVWk6M84fd9/MogBQLBQ675pq/JEaVoRFdQ=; b=FZIGMWAmHSY7QOTzO6whzyf1MPUueLaugXBQCX6o45/+S1kmXBx1HIUNYV7+0/SWbD+Zjm HN16GQreurVuZ7Oi625JxUsTkh8/SGcgFbJXFKc8mEoyZ4EfKaPzbaHG86DOkUzbcpfe6m uS+uWaW+JOcSyoUZw23Qk5hkn1YzvasNNj0yiOOYoexmX+0cBU0fngLKKw9QXdEv+tQZu5 niW0QPnWR7y3sm6MpirJMVTRHQJIlGKVf+AsE6G22EO6jLCP4PugPlXW5+qFjOqx6M29Nt I2GSUfRyA8vM0644qbGI2aS7GI9W+ubtM9tLYNdhnIV8yu0lZph0CTh6OAML+w== X-Migadu-Spam-Score: -2.51 X-Spam-Score: -2.51 X-Migadu-Queue-Id: A5B042A8D3 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=bxOGE4vU; 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"; dmarc=pass (policy=none) header.from=gnu.org X-TUID: 0cCzl3AEZf6v Hi, Maxim Cournoyer skribis: > 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. > (false-if-platform-not-found): New syntax. > (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, and guard lookup calls w= ith > false-if-platform-not-found. Sounds like a good idea! > +++ 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)= ))) Maybe we don=E2=80=99t need to protect here, because it=E2=80=99s a=20 > +++ b/guix/platform.scm > @@ -21,6 +21,7 @@ (define-module (guix platform) > #:use-module (guix memoization) > #:use-module (guix records) > #:use-module (guix ui) > + #:use-module (ice-9 exceptions) So far the we use (srfi srfi-35) exclusively to define condition types; I think we should do the same here, for consistency. > + &platform-not-found-error > + make-platform-not-found-error The constructor doesn=E2=80=99t need to be exposed. > +;;; > +;;; Exceptions. > +;;; > +(define-exception-type &platform-not-found-error &error > + make-platform-not-found-error platform-not-found-error?) So this would become (define-condition-type =E2=80=A6). Otherwise LGTM, thanks! Ludo=E2=80=99.