From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 4Fh7FEp6xGP+0wAAbAwnHQ (envelope-from ) for ; Sun, 15 Jan 2023 23:12:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YBVnFEp6xGOYJAEAauVa8A (envelope-from ) for ; Sun, 15 Jan 2023 23:12:26 +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 2C4A633B83 for ; Sun, 15 Jan 2023 23:12:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHBEV-0002wU-Ra; Sun, 15 Jan 2023 17:12:07 -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 1pHBEQ-0002vA-7e for guix-patches@gnu.org; Sun, 15 Jan 2023 17:12: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 1pHBEP-00016b-VD for guix-patches@gnu.org; Sun, 15 Jan 2023 17:12:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pHBEP-0007hW-Lb for guix-patches@gnu.org; Sun, 15 Jan 2023 17:12:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60802] [PATCH v3 1/2] platforms: Raise an exception when no suitable platform is found. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Jan 2023 22:12: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: Josselin Poiret Cc: Tobias Geerinckx-Rice , 60802@debbugs.gnu.org, Simon Tournier , Mathieu Othacehe , ludo@gnu.org, Christopher Baines , Ricardo Wurmus Received: via spool by 60802-submit@debbugs.gnu.org id=B60802.167382071129586 (code B ref 60802); Sun, 15 Jan 2023 22:12:01 +0000 Received: (at 60802) by debbugs.gnu.org; 15 Jan 2023 22:11:51 +0000 Received: from localhost ([127.0.0.1]:59848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHBEF-0007h8-4f for submit@debbugs.gnu.org; Sun, 15 Jan 2023 17:11:51 -0500 Received: from mail-qt1-f169.google.com ([209.85.160.169]:46061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHBEC-0007gr-Ct for 60802@debbugs.gnu.org; Sun, 15 Jan 2023 17:11:49 -0500 Received: by mail-qt1-f169.google.com with SMTP id h21so23246830qta.12 for <60802@debbugs.gnu.org>; Sun, 15 Jan 2023 14:11:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=tVuz1VSZOpGEkEE7FPRRwVlAw7bBRCa9Arl37gozt3E=; b=n9rbsP10GozRPp+EycmPFsUYO605Q15qaVGMjXLL6nK4u849vc1FZsx2MYaXeCugDQ 4vrHUJ+3DkDA7k0xAROHKAO9AMdYhqXT3MT3w0z66HGwt5wCqVrz9zHl+0etmIOYNFW4 f0mEzErgy+c3vh+liP1fuwp7oA3G9tj1/SazVTUkbbbWrEjTz/2OmHFwT57PHZxP5r4T 0NG7Gj3f4lFfDH60ECOSM3gCgWFpkpxVjF55Kbfv1tYtujyX+FDWNoa8Ubvf4uyhNt3E 1sTOn4L36PyD0vu2b+xtDpVW2euO6yKC5NdxmnBD9GCeW2mVLQHZzr0VdSduQYmXFOZh Iwzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tVuz1VSZOpGEkEE7FPRRwVlAw7bBRCa9Arl37gozt3E=; b=mD7EyrMMh7gTToWy+1tG1KTkMyA6lUMC3Y3pxnTEutbKO1hrfyZ6Kn9iiaEMdbZzy+ Qeoyz/NGfKE/AxQO304ThFAn5huErVw3/FJnhv3botWlQ1rjc42c4QHa3wv3hK5YaUSd cGXNMgONmU0cB1Rt3JyZB6BUqii4sdI/gs/9sI7dZi6kA/3VtQQX/JY6pSqPc0GchcKt zy/cVuI6Ev0tI6P4i5lnDMySmQTPgVxqkHE/VqgmtgcdrtWrDKLhHKvV0CSae3El8OsM j1KuVcaIXDR2iRwRa1yq7A7XMuzTrDkbQ6ykB+hGO1IML1HleMKXGzaxSEH02IZxhToy YFTA== X-Gm-Message-State: AFqh2kpY7lqa4ViIDdMvmk7RUh5SAL7inHNcR2JAYZ5fylReDK7uKoip AbRdNUfa9Iqd1tZGsgOySVg= X-Google-Smtp-Source: AMrXdXuhfFzb5+HJ1ChLKRMn24c9WwI5lWwc6RaV/B/wx/rfrJ84/pSWNxu3qHeVn1MpKKpShvCDPQ== X-Received: by 2002:a05:622a:148e:b0:3b6:310f:a170 with SMTP id t14-20020a05622a148e00b003b6310fa170mr3248449qtx.9.1673820702789; Sun, 15 Jan 2023 14:11:42 -0800 (PST) Received: from hurd (dsl-10-130-209.b2b2c.ca. [72.10.130.209]) by smtp.gmail.com with ESMTPSA id x24-20020ac87ed8000000b003b323387c1asm3872784qtj.18.2023.01.15.14.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 14:11:42 -0800 (PST) From: Maxim Cournoyer References: <20230114151457.1903-2-maxim.cournoyer@gmail.com> <87zgajkiiy.fsf@jpoiret.xyz> Date: Sun, 15 Jan 2023 17:11:40 -0500 In-Reply-To: <87zgajkiiy.fsf@jpoiret.xyz> (Josselin Poiret's message of "Sun, 15 Jan 2023 14:57:09 +0100") Message-ID: <87y1q3cusj.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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=1673820746; a=rsa-sha256; cv=none; b=gobEfDRQX3BHr7H8sJJ1ZRVtCln1XopsEA4x2O7f5t6U/r8JfghWXIWU69hWoSWGZ0dSQ1 ZdoVsKhEmMVGkM15GobCCSN0nWkZ5qXpIvP2IHb3CD0fUq2QckJ94E22jT7N7q4/EdVL7P ANYm+rQTp6LQGOHEf+VYV5KOsbt8jIw96qEw0JVxc3FYlfjzszxdjYlZSEV4uVFDVauDxb uoM03EAfYSm0fJ5CZxvzkiX1cDB2YhwecoJpr3B1AvLxTU/V+7cHwBh74nPXAzg786z+Al /kaOlD9I6+nn+z87Qloxo1X2BUWWBVzOPxczh2xy/VhRI6ghA5kR34xTbb4Rpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=n9rbsP10; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673820746; 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: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=tVuz1VSZOpGEkEE7FPRRwVlAw7bBRCa9Arl37gozt3E=; b=a5yfryFLhKNUJloIaHzmJHK/5dWWZZh5A/fGVI4aUhEx3Z+ND8fPhNnrI5YBi0i+fN6n1y NEoCwqO8dsivqdXcxQxBLDbOAlXFB8UJjTEdURe1Qzd3bOP0sfEz9kVYEzkMvmVNOGgEwo vHOQqdw9ta3cYEYhG218awEXNRrbxmcQ03+8Hv+58oJoZgEaiQSwEDZkkzdbGHj9Ep3hxh 7GUQCht/NYLx55AvCfRvyZkKMxLMolJu7GXenauxtDY7csEJdj9dOopHZ9Ccc13g6mGP9f ra62EgUm53qV1gwBI55q6mO0Xz3e4pG/9RYokd4OOTIeBcG6H7NFHRByEer/ZQ== X-Migadu-Spam-Score: -0.52 X-Spam-Score: -0.52 X-Migadu-Queue-Id: 2C4A633B83 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=n9rbsP10; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-TUID: 97/iI+KGgosm Hi Josselin, Josselin Poiret writes: > Hi Maxim, > > This looks good to me, although in the grand scheme of things I wonder > if that change is a step forward: for those kinds of procedures, we > could expect consumers to instead always properly handle the #f case > themselves, rather than baby-sitting them and systematically relying on > exceptions in the parent procedure, no? I like exceptions; I think they are an improvement to C-style ad-hoc checking of each call return; when things fail they fail early and in a clear fashion, rather than indirectly, which is easier to debug and removes the burden to duplicate the same checks at every call site. > As a caricatural example: the SRFI-1 `find` could raise an exception > instead of returning #f, but I don't think anyone would consider that > proper behaviour. I think the find interface is well established; lookup-platform-by-system and friends is not really intended to return #f, as shown in the few usages in our code base (there's only one place where it needed to be handled in previous code, and that's a TODO waiting to move more things to (guix platform)). > I don't have a particularly strong opinion towards either option, which > probably means that there's some discussion to be had here. Good, that's what reviews are for :-). -- Thanks, Maxim