From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 WEY3B342RGOp0gAAbAwnHQ (envelope-from ) for ; Mon, 10 Oct 2022 17:13:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id eNwrB342RGPaaQEAG6o9tA (envelope-from ) for ; Mon, 10 Oct 2022 17:13:02 +0200 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 C3E592E99F for ; Mon, 10 Oct 2022 17:13:01 +0200 (CEST) Received: from localhost ([::1]:45140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohuSi-0007tF-Vs for larch@yhetil.org; Mon, 10 Oct 2022 11:13:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohu9O-0004wm-Sz for guix-patches@gnu.org; Mon, 10 Oct 2022 10:53:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50465) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohu9O-0000oz-KW for guix-patches@gnu.org; Mon, 10 Oct 2022 10:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ohu9O-0007IY-Fs for guix-patches@gnu.org; Mon, 10 Oct 2022 10:53:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58231] [PATCH 2/2] packages: Raise an exception for invalid 'license' values. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 10 Oct 2022 14:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58231 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 58231@debbugs.gnu.org, Philip McGrath Received: via spool by 58231-submit@debbugs.gnu.org id=B58231.166541356328027 (code B ref 58231); Mon, 10 Oct 2022 14:53:02 +0000 Received: (at 58231) by debbugs.gnu.org; 10 Oct 2022 14:52:43 +0000 Received: from localhost ([127.0.0.1]:49543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohu95-0007Hz-E0 for submit@debbugs.gnu.org; Mon, 10 Oct 2022 10:52:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohu93-0007Hj-AE for 58231@debbugs.gnu.org; Mon, 10 Oct 2022 10:52:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohu8x-0000n0-04; Mon, 10 Oct 2022 10:52:35 -0400 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=dQDCd3AYD/h+ThgLmOF4X9Id4R/KC8Oh5HI8ZqDAgKg=; b=QX8xU/fnU1dLSgg7q0ME krSKKHmWMTzUYg2rQta1fZ2Duz9DaGnjGcT5mJsiwfZnAvKDoJKjyctWvvaQ+3WhfbneR1y0JKk9F GW2F7rQbad4tKB2hvS33/R733ONPn+wNLto89zhpcBbeP1uzzu7A29xiaX+lQVazHwkW4BIBUUHaD LqE0Sb+EZ4hpejfhsRQLo9LDMR4Q2n77GNdZIaWiyTk6XhdkONwzgbA09nZUvROVjJMWXk+04+42o HwlKeeCqVi8yckIFai8SKtsb1gPAh/tnbjuPJ9jAlqap4n06Sto+R5GbJtfbIR9dLFJtalp2c7JTj RONLhkhO1H4zoA==; Received: from [193.50.110.253] (port=32780 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohu8h-0002qT-K4; Mon, 10 Oct 2022 10:52:34 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20221001162058.8214-1-ludo@gnu.org> <20221001162058.8214-2-ludo@gnu.org> <87tu4crnad.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 19 =?UTF-8?Q?Vend=C3=A9miaire?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Tournesol 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: Mon, 10 Oct 2022 16:52:16 +0200 In-Reply-To: <87tu4crnad.fsf@gmail.com> (zimoun's message of "Mon, 10 Oct 2022 12:22:18 +0200") Message-ID: <87mta320kf.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (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" 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=1665414781; 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=dQDCd3AYD/h+ThgLmOF4X9Id4R/KC8Oh5HI8ZqDAgKg=; b=qLV3rtq0Ta5IppV4G2zpkptnu5oZM5lHGzjHiP3Ou1mZt4OPg+WKaAWHlDcTTyNkbv3VXy bD/bhwBYthZZrMDFAVySxad22AvB0g6M66iJmK9dIIYjYaTvzhgM5DmdnGZX5AdtjAmIwG 8QyCqFi7cdeHKwGuterZUzfXSn1pC4jnBwEuC0X9mSm6VKkkFLaDUKwirLDRa/8rlnuaxi cW/XbOWuhR/5oPciS/8qXR5Pm7bzuL4OsjW9JIAdVw78efSX5D0R1ZZinQ+U5pNy0I45Zc ebq1FOLjwbMZxEx20TZX2MKolK4X5NQdEla8bcZ8K6XFnwt59TKKESOCdydhBw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665414781; a=rsa-sha256; cv=none; b=MNRqc0aRZRQ1j+lemjkjx7x9PhFi8fKc7UQskJOy2lKRadln2JVXt4vbDlxAqNmprbiBrK Ai/vDwPEhnT5qDICmiDW8GvboeY69PF2cOHkg9KOEXsaYmViiglEMEU8yN+MMeEbwwxNae Hxdd+fMRh+rvkd/pkEwv4th7CGsh50zOWTq5YSOAmWVCVRWaYFsm8mY5tQToel6l7abysP CbhV8doTpMF/oMK1++hilSZKduH3rqrMdpYly1X6eUqfS0ouFFSFqbMZuR5LIaCSb3Z5I7 R5zsI+gLRrqkJUdKaTOdX0Su1CDtpGHgNVz1dpBLt3+6k+OM2oLMjJ6Ab1NaUg== 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="QX8xU/fn"; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -4.89 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="QX8xU/fn"; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: C3E592E99F X-Spam-Score: -4.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3WoluxfIhMoc Hi, zimoun skribis: > On sam., 01 oct. 2022 at 18:20, Ludovic Court=C3=A8s wrote: > >> ;; A package. >> (define-record-type* >> package make-package >> @@ -574,7 +607,8 @@ (define-record-type* >> (sanitize validate-texinfo)) ; one-line description >> (description package-description >> (sanitize validate-texinfo)) ; one or two paragrap= hs >> - (license package-license) ; (list of) >> + (license package-license ; (list of) >> + (sanitize validate-license)) >> (home-page package-home-page) >> (supported-systems package-supported-systems ; list of strings >> (default %supported-systems)) > > This change is the core, IIUC. The question is: does it make sense to > have something similar for all the fields? > > For instance, the fields =E2=80=99name=E2=80=99 and =E2=80=99verson=E2=80= =99 are expected to be =E2=80=99string=E2=80=99 > and could be similarly checked? I think eventually we should have contracts rather than home-made type checks like this (Cc=E2=80=99ing Philip). However, as you write, we have to pay attention to performance in the case of packages as it could quickly become too expensive. While I think it could make sense to have contracts for all the fields of service configuration records, I think we=E2=80=99ll have to do much less f= or fields. Ludo=E2=80=99.