From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QO4+JF/1HGKKngAAgWs5BA (envelope-from ) for ; Mon, 28 Feb 2022 17:16:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GAjNHF/1HGLmAQAAG6o9tA (envelope-from ) for ; Mon, 28 Feb 2022 17:16:31 +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 4116DE503 for ; Mon, 28 Feb 2022 17:16:31 +0100 (CET) Received: from localhost ([::1]:47176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOihK-0001kD-BS for larch@yhetil.org; Mon, 28 Feb 2022 11:16:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOiSQ-0005Ne-Cf for guix-devel@gnu.org; Mon, 28 Feb 2022 11:01:06 -0500 Received: from [2607:f8b0:4864:20::f2d] (port=36769 helo=mail-qv1-xf2d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOiSM-0002dt-KP; Mon, 28 Feb 2022 11:01:05 -0500 Received: by mail-qv1-xf2d.google.com with SMTP id w7so13232805qvr.3; Mon, 28 Feb 2022 08:01:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=2zmNBc7NMAryTBoj1tZ2In9MVaNy68XkVgXt9RL82I4=; b=ZZhDB3OAfR+jeR6p3jwPIt6lHM+3njySjitPfFKizxsjHbK3KdTKyl//IvfWqc3rJJ 97qA7s4dV9cjBWNjs4ET9xDErBnS+EMjegMmUj1jUdsPVjQpTriP6iQDHInKWvfne3lN mLvFljdZZBP+r4FZ++VmZyOkAMfygRbdPOgMEh9FA0p2M5qxcwHpEqiRsBtwRQrID3gC iNUn+3K0RSoiaeOESJwjW3F04hC43N9GJxprIluBIKujWyHMKMhlvWJnh7Qay74SdQGi +CCcwsa4EryQI5TPyFAMXeQqc9gKmPBgH/vJ6494gR3QzoXuQWeFNvu7drMetS36l4BV c1pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=2zmNBc7NMAryTBoj1tZ2In9MVaNy68XkVgXt9RL82I4=; b=KlP9O/rwg2T121z5j4/iGxg0gW9yQWljVlYLkG1iXlhfQxY2lGlfMRlp+JoWIebzPA Xksx8qnFrEFp5uAvbsi3PY0FPAWIdZCAXMbf0/Jn46jrEl6P9ZFoE7ptPW3OSNy76DH9 qQdnwoTp2ti9Bu4EHbWGRQT5pejzMEl2iqZSfH6rOeGkwM/9FFRU8YVLsq1Mzb4hD7c6 f/LapE/5mC81GyYZJDVTFiCLo8jCyE65Geh/1iisKavx8kOzUmce6nr89nlu2GcxXvwJ iqp7+DY3S+6nm1JFqDYRJySsyPwiNTBx7ZP0C3LFhcYcUblf2Wqs4GS8ypHDSVQOBfnR Lb/Q== X-Gm-Message-State: AOAM530hOjvxmbmeHPTbjPYRlV18qJHGzleaGqb4AODkldkZfasTb9vx mm8z05xbMBEPOiFQGBzGuj7DyblU6Io= X-Google-Smtp-Source: ABdhPJyhfzKTmGFwbnTQwpb0cikwG1iIuQsgIOFKVQRZnrGnqQc4L0nd9Akrf9Xe2STzaBhnrRhztg== X-Received: by 2002:ac8:5850:0:b0:2dd:9260:c4f9 with SMTP id h16-20020ac85850000000b002dd9260c4f9mr17083010qth.446.1646064060083; Mon, 28 Feb 2022 08:01:00 -0800 (PST) Received: from hurd (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id z14-20020a05622a028e00b002dc8e843596sm6956820qtw.61.2022.02.28.08.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 08:00:59 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: better error messages through assertions References: <87ilthoxvu.fsf@elephly.net> <875yp2zsgd.fsf@gmail.com> <87lexx7nv4.fsf@elephly.net> <87ilszdu0e.fsf@gnu.org> Date: Mon, 28 Feb 2022 11:00:58 -0500 In-Reply-To: <87ilszdu0e.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 28 Feb 2022 14:02:09 +0100") Message-ID: <87fso3t1z9.fsf@gmail.com> 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-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f2d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2d; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf2d.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Wurmus , guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646064991; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=2zmNBc7NMAryTBoj1tZ2In9MVaNy68XkVgXt9RL82I4=; b=kBvxRXvKXo/DDM930nipvZftzdUA2ud/4TN5W1uH1yQrUEoC74FWMk4uTNZItI0yLevcQw ks64IbNJry8CcW8sT6PzkD5zf63/Ibmq37qwbBB2tOaT1Z/Rz6+fgFYszlezyuX9wSw7/i A6YJINWBC00+w+729RMnHMp6SktYdpHXsCjv5xMJnU/5Cs+j730VdY1G8N4l9VVkZKJfAj b4lFp3m+ZXIy+KLvISb+srA9NlUqAMbnP6zl9nykh8PHzJIhl/iRJNnSZzi7EH4KovnbcG 8ViHMEylTAjRqIJtRFlhGBM/7c9caym54z+WR9nIUSZ2Mw9GGGPSJtJOEyRVFQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646064991; a=rsa-sha256; cv=none; b=XJgIKz99I6aYtPDz1CIx4zmM4VZW2GVvdyLGs/wLGYMIHoH1Mfvla3xe5nNcYZbTovfVxe sf4aJLHoy5ehXQXVE1WGkGIT122nukq9q5bJmQjM4uCnvjiMt21aMN26ZPfhajsHTb9vnv AC8qGEbTlmwevxsAkjTMoUs18cg/2Yisw2mZud5bw2nATifkvrY3F+abGc7qIEak74JhtF OPwRLbVFHhG46IJgVbz3xRj/U31hrc/HFVuWguloHiD1KByLyjctQn6d/jUl44Kzai8Tp+ Sh98Q7nqr7UWuARR/7oP7XqmUOWOazXRyxPE+JWufWUUaCrxx86HZZImVTxZAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZZhDB3OA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.79 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZZhDB3OA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4116DE503 X-Spam-Score: -7.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: DXKkuShCurUp Hello, Ludovic Court=C3=A8s writes: > Ricardo Wurmus skribis: > >> Maxim Cournoyer writes: >> >>> I hear we now have "field sanitizers" on Guix records; without having >>> dug the details, it seems to be we could add a predicate validating the >>> input there? >> >> I don=E2=80=99t see how that would help here. In my example the service= values >> themselves are all right. It=E2=80=99s a procedure acting on what it as= sumes is >> a list of service values that fails. >> >> Record field validation would not have prevented that error. > > I think we could validate primarily at the user/core boundary. If the > =E2=80=98services=E2=80=99 field had a sanitizer ensuring it=E2=80=99s a = list of services, then > it=E2=80=99d be fine. That seems a fine approach to me; thank you for your input. Ricardo, would you like to give idea a shot and see if it suites the bill? :-). Maxim