From unknown Sat Jul 12 12:27:54 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#58231 <58231@debbugs.gnu.org> To: bug#58231 <58231@debbugs.gnu.org> Subject: Status: [PATCH 0/2] Checking the 'license' field of packages Reply-To: bug#58231 <58231@debbugs.gnu.org> Date: Sat, 12 Jul 2025 19:27:54 +0000 retitle 58231 [PATCH 0/2] Checking the 'license' field of packages reassign 58231 guix-patches submitter 58231 Ludovic Court=C3=A8s severity 58231 normal tag 58231 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 12:19:26 2022 Received: (at submit) by debbugs.gnu.org; 1 Oct 2022 16:19:26 +0000 Received: from localhost ([127.0.0.1]:45621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oefD4-0003iv-DK for submit@debbugs.gnu.org; Sat, 01 Oct 2022 12:19:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:47482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oefD2-0003in-DD for submit@debbugs.gnu.org; Sat, 01 Oct 2022 12:19:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oefD2-0005Cu-7X for guix-patches@gnu.org; Sat, 01 Oct 2022 12:19:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oefD1-0005an-Uh; Sat, 01 Oct 2022 12:19:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=D0VaQ5FZtSqQcqV0tL1H4vviN/5uOJXgqNNleppnInM=; b=LR896TbkgKOOPO D6EPypu7Ca8GsMVGPnshsqLpu+ujXvCjRvqsZLI7u05gJdhtXGjYz8S9trm/3XxrmDTOzbq7kcZ4x fIsR404bgkYjS/2Aqr5sJhUGptuTiWsTCyhpc8E5071uggWZs4b4vi5NHhOqXb8kbKS9p9m4WOGLJ K7S+IGeyh0yiuJIi0arXL72Ux5hJAI8jtjVyAww6bA95wKBdRRSnVNYpwxAaPSd4q3gVcn7VuJszN C+r2cNakwTDT3nDdGz9i6/Gx8e6OcRcQMhgDf35yVHajzZsFEXqM7UD+ZfGOP57leVK6guh5lk66w mEZ6qbQ497al5vI/fpvw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:62741 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oefD1-0007vT-C6; Sat, 01 Oct 2022 12:19:23 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 0/2] Checking the 'license' field of packages Date: Sat, 1 Oct 2022 18:19:11 +0200 Message-Id: <20221001161911.8116-1-ludo@gnu.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Guix! We already have ‘guix lint -c license’ but that hasn’t prevented us from occasionally having invalid licenses committed. This patch adds add a ‘sanitize’ option to the ‘license’ field of to detect invalid licenses early on, as zimoun suggested at: https://lists.gnu.org/archive/html/guix-devel/2022-09/msg00067.html The funny part of this patch is that the license validation expands to #t in the majority of cases, meaning that it comes without run-time overhead (there is macro-expansion overhead, but I didn’t measure it). Kinda like static type checking, except that we can only tell when a value is definitely a valid license and cannot conclude in other cases. Feedback welcome! Thanks, Ludo’. Ludovic Courtès (2): licenses: Let 'license?' expand to #t in trivial cases. packages: Raise an exception for invalid 'license' values. guix/licenses.scm | 58 +++++++++++++++++++++++++++++++++++++++------- guix/packages.scm | 40 +++++++++++++++++++++++++++++++- tests/packages.scm | 7 ++++++ 3 files changed, 95 insertions(+), 10 deletions(-) base-commit: d9b7982ba58fdea0934b60a81f507440a56c82ee -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 12:21:15 2022 Received: (at 58231) by debbugs.gnu.org; 1 Oct 2022 16:21:15 +0000 Received: from localhost ([127.0.0.1]:45631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oefEo-0003n0-U6 for submit@debbugs.gnu.org; Sat, 01 Oct 2022 12:21:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oefEm-0003mh-UP for 58231@debbugs.gnu.org; Sat, 01 Oct 2022 12:21:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oefEh-0005wf-LM; Sat, 01 Oct 2022 12:21:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=zTkeJCBbNwHI5BOVQL9SM/OKVMiiFjeDVcEzEzXUQa4=; b=bTch/j4nOD2IAF R4PVsd7LSS5xCn2Ao8BBp7wyM5LmWJNLMkPRk/hSSJSaeq84OXICmPKYwM5cuStt6Rs7g2WAOljpi Fi257RCnEB3UXNXOwDsFqYIG7vDLRHb6F69k6BOp5UQXjdE9jq8RP0F15tkietXRnHzGoqTlAvzkd Wn3xxm+BOV2lF4TkRoRAIWT77msyyLPMWG8zblO33Ka32uziX2H1M1lhYYwE1I42NlYX+LkKfH03a MYX98b9+IVBU5vU3mkPLDwjdfqIsQJGyZxVuk9eRGyuAWbZZi+9kPm/7R9IHtqJQXrb7hRoime/X/ 7GM2OmgeryRT63pyfOuA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58544 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oefEg-00088x-TV; Sat, 01 Oct 2022 12:21:07 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 58231@debbugs.gnu.org Subject: [PATCH 1/2] licenses: Let 'license?' expand to #t in trivial cases. Date: Sat, 1 Oct 2022 18:20:57 +0200 Message-Id: <20221001162058.8214-1-ludo@gnu.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58231 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) With this change, we have: > ,expand (license? gpl3+) $2 = #t > ,expand (license? something-else) $3 = (let ((obj something-else)) (and ((@@ (srfi srfi-9) struct?) obj) ((@@ (srfi srfi-9) eq?) ((@@ (srfi srfi-9) struct-vtable) obj) (@@ (guix licenses) )))) * guix/licenses.scm (define-license-predicate) (begin-license-definitions): New macros : Wrap definitions in 'begin-license-definitions'. --- guix/licenses.scm | 58 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/guix/licenses.scm b/guix/licenses.scm index 3b820ae07e..80cf0f1114 100644 --- a/guix/licenses.scm +++ b/guix/licenses.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2014, 2015, 2017, 2019, 2020 Ludovic Courtès +;;; Copyright © 2012, 2014, 2015, 2017, 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2013, 2015 Andreas Enge ;;; Copyright © 2012, 2013 Nikita Karetnikov ;;; Copyright © 2015 Mark H Weaver @@ -109,13 +109,6 @@ (define-module (guix licenses) hpnd fsdg-compatible)) -(define-record-type - (license name uri comment) - license? - (name license-name) - (uri license-uri) - (comment license-comment)) - ;;; Commentary: ;;; ;;; Available licenses. @@ -129,6 +122,53 @@ (define-record-type ;;; ;;; Code: +(define-record-type + (license name uri comment) + actual-license? + (name license-name) + (uri license-uri) + (comment license-comment)) + +(define-syntax define-license-predicate + (syntax-rules (define define*) + "Define PREDICATE as a license predicate that, when applied to trivial +cases, reduces to #t at macro-expansion time." + ((_ predicate (variables ...) (procedures ...) + (define variable _) rest ...) + (define-license-predicate + predicate + (variable variables ...) (procedures ...) + rest ...)) + ((_ predicate (variables ...) (procedures ...) + (define* (procedure _ ...) _ ...) + rest ...) + (define-license-predicate + predicate + (variables ...) (procedure procedures ...) + rest ...)) + ((_ predicate (variables ...) (procedures ...)) + (define-syntax predicate + (lambda (s) + (syntax-case s (variables ... procedures ...) + ((_ variables) #t) ... + ((_ (procedures _)) #t) ... + ((_ obj) #'(actual-license? obj)) + (id + (identifier? #'id) + #'actual-license?))))))) + +(define-syntax begin-license-definitions + (syntax-rules () + ((_ predicate definitions ...) + (begin + ;; Define PREDICATE such that it expands to #t when passed one of the + ;; identifiers in DEFINITIONS. + (define-license-predicate predicate () () definitions ...) + + definitions ...)))) + +(begin-license-definitions license? + (define agpl1 (license "AGPL 1" "https://gnu.org/licenses/agpl.html" @@ -717,6 +757,6 @@ (define* (fsdg-compatible uri #:optional (comment "")) https://www.gnu.org/distros/free-system-distribution-guidelines.en.html#non-functional-data." (license "FSDG-compatible" uri - comment)) + comment))) ;;; licenses.scm ends here -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 12:21:15 2022 Received: (at 58231) by debbugs.gnu.org; 1 Oct 2022 16:21:15 +0000 Received: from localhost ([127.0.0.1]:45633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oefEp-0003n7-FV for submit@debbugs.gnu.org; Sat, 01 Oct 2022 12:21:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oefEn-0003mj-NT for 58231@debbugs.gnu.org; Sat, 01 Oct 2022 12:21:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oefEi-0005wq-80; Sat, 01 Oct 2022 12:21:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=I2nmzHNK9HXGeBXQ3+ODQXEZ49PlbKednOcnPUpGNtE=; b=LxxvMVSWe+S3S1lZXQir 6hsbyK+7ssC2FyPEtJhldfkryF12P9XJY3duGZ2n8/kbF2BieJSwh1ATYM46fu+lBLUJrYlFcn0Nt 9sQ7pJJIEW7rmB3ZR2jKnp2iLh/CSQybAHW8Zr8u+WioauYS6iTk6uBDFG2peI30sXuMUtqgw8VmH 4gHianNbTibfAk1Z8tB/5byji09xhAjduPfWCfGXEzOBTyougS0I0DziQinUsUAwywBPcES7TNJnJ k1hDvGriQ+vTSDPGeSW91vRmOyB6fjCNn+1GMTgDEvu815sTgNVR4sex6pInJ2j47MX5AVfhZ9usI jWelwbNv1P7ZUA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58544 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oefEh-00088x-QX; Sat, 01 Oct 2022 12:21:08 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 58231@debbugs.gnu.org Subject: [PATCH 2/2] packages: Raise an exception for invalid 'license' values. Date: Sat, 1 Oct 2022 18:20:58 +0200 Message-Id: <20221001162058.8214-2-ludo@gnu.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221001162058.8214-1-ludo@gnu.org> References: <20221001162058.8214-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58231 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is written in such a way that the type check turns into a no-op at macro-expansion time for trivial cases: > ,optimize (validate-license gpl3+) $18 = gpl3+ > ,optimize (validate-license (list gpl3+ gpl2+)) $19 = (list gpl3+ gpl2+) * guix/packages.scm (valid-license-value?, validate-license): New macros. ()[license]: Add 'sanitize' option. (&package-license-error): New error condition type. * tests/packages.scm ("license type checking"): New test. --- guix/packages.scm | 40 +++++++++++++++++++++++++++++++++++++++- tests/packages.scm | 7 +++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/guix/packages.scm b/guix/packages.scm index 94e464cd01..704b4ee710 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -41,6 +41,9 @@ (define-module (guix packages) #:use-module (guix search-paths) #:use-module (guix sets) #:use-module (guix deprecation) + #:use-module ((guix diagnostics) + #:select (formatted-message define-with-syntax-properties)) + #:autoload (guix licenses) (license?) #:use-module (guix i18n) #:use-module (ice-9 match) #:use-module (ice-9 vlist) @@ -159,6 +162,8 @@ (define-module (guix packages) &package-error package-error? package-error-package + package-license-error? + package-error-invalid-license &package-input-error package-input-error? package-error-invalid-input @@ -533,6 +538,34 @@ (define ensure-thread-safe-texinfo-parser! ((_ obj) #'obj))))) +(define-syntax valid-license-value? + (syntax-rules (list package-license) + "Return #t if the given value is a valid license field, #f otherwise." + ;; Arrange so that the answer can be given at macro-expansion time in the + ;; most common cases. + ((_ (list x ...)) + (and (license? x) ...)) + ((_ (package-license _)) + #t) + ((_ obj) + (or (license? obj) + ;; Note: Avoid 'not' below due to . + (eq? #f obj) ;#f is considered valid + (let ((x obj)) + (and (pair? x) (every license? x))))))) + +(define-with-syntax-properties (validate-license (value properties)) + (unless (valid-license-value? value) + (raise + (make-compound-condition + (condition + (&error-location + (location (source-properties->location properties)))) + (condition + (&package-license-error (package #f) (license value))) + (formatted-message (G_ "~s: invalid package license~%") value)))) + value) + ;; 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 paragraphs - (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)) @@ -737,6 +771,10 @@ (define-condition-type &package-error &error package-error? (package package-error-package)) +(define-condition-type &package-license-error &package-error + package-license-error? + (license package-error-invalid-license)) + (define-condition-type &package-input-error &package-error package-input-error? (input package-error-invalid-input)) diff --git a/tests/packages.scm b/tests/packages.scm index 6cbc34ba0b..dc03b13417 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -94,6 +94,13 @@ (define %store (write (dummy-package "foo" (location #f))))))) +(test-equal "license type checking" + 'bad-license + (guard (c ((package-license-error? c) + (package-error-invalid-license c))) + (dummy-package "foo" + (license 'bad-license)))) + (test-assert "hidden-package" (and (hidden-package? (hidden-package (dummy-package "foo"))) (not (hidden-package? (dummy-package "foo"))))) -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 08 07:44:23 2022 Received: (at 58231) by debbugs.gnu.org; 8 Oct 2022 11:44:23 +0000 Received: from localhost ([127.0.0.1]:38462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh8Fj-0008G1-8r for submit@debbugs.gnu.org; Sat, 08 Oct 2022 07:44:23 -0400 Received: from relay.yourmailgateway.de ([185.244.194.184]:42109) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh8Fd-0008Fp-Ur for 58231@debbugs.gnu.org; Sat, 08 Oct 2022 07:44:21 -0400 Received: from relay01-mors.netcup.net (localhost [127.0.0.1]) by relay01-mors.netcup.net (Postfix) with ESMTPS id 4Ml3HN2x5Vz8tMf; Sat, 8 Oct 2022 13:44:16 +0200 (CEST) Authentication-Results: relay01-mors.netcup.net; dkim=permerror (bad message/signature format) Received: from policy02-mors.netcup.net (unknown [46.38.225.53]) by relay01-mors.netcup.net (Postfix) with ESMTPS id 4Ml3HN2Wc1z7yHv; Sat, 8 Oct 2022 13:44:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy02-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.899 X-Spam-Level: X-Spam-Status: No, score=-2.899 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4Ml3HM3pY5z8sb0; Sat, 8 Oct 2022 13:44:15 +0200 (CEST) Received: from florianrock64 (ip5b40552a.dynamic.kabel-deutschland.de [91.64.85.42]) by mxe217.netcup.net (Postfix) with ESMTPSA id 4A7037FDB6; Sat, 8 Oct 2022 13:44:13 +0200 (CEST) From: "pelzflorian (Florian Pelz)" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#58231] [PATCH 0/2] Checking the 'license' field of packages References: <20221001161911.8116-1-ludo@gnu.org> Date: Sat, 08 Oct 2022 13:44:11 +0200 In-Reply-To: <20221001161911.8116-1-ludo@gnu.org> ("Ludovic =?utf-8?Q?Cour?= =?utf-8?Q?t=C3=A8s=22's?= message of "Sat, 1 Oct 2022 18:19:11 +0200") Message-ID: <87y1tqzgj8.fsf@pelzflorian.de> 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-Rspamd-Queue-Id: 4A7037FDB6 X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: IP7BmjGbwbAhrdBhJGaMlgUpH5XvIy1qmvfMkMVfFAScSJJEBq20xQhS X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58231 Cc: 58231@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thank you! This is good. Just to let you know though; when reverting e61c581805b2338ea8feaac86617c5d7bff41c41 and guix pull=E2=80=99ing, there is no error location. Doesn=E2=80=99t matter to me though. Computing Guix derivation for 'x86_64-linux'... -Backtrace: In ice-9/boot-9.scm: 222:29 19 (map1 _) 222:29 18 (map1 _) 222:29 17 (map1 _) 222:29 16 (map1 _) 222:29 15 (map1 _) 222:29 14 (map1 _) 222:29 13 (map1 _) 222:17 12 (map1 (((gnu packages qt)) ((gnu packages sqlite)) ((gnu packa= ges web)) ((gnu packages xml)) ((gnu ?)) ?)) 3326:17 11 (resolve-interface (gnu packages qt) #:select _ #:hide _ #:pre= fix _ #:renamer _ #:version _) In ice-9/threads.scm: 390:8 10 (_ _) In ice-9/boot-9.scm: 3252:13 9 (_) In ice-9/threads.scm: 390:8 8 (_ _) In ice-9/boot-9.scm: 3536:20 7 (_) 2835:4 6 (save-module-excursion _) 3556:26 5 (_) In unknown file: 4 (primitive-load-path "gnu/packages/qt" #) In ice-9/eval.scm: 619:8 3 (_ #f) 626:19 2 (_ #) 293:34 1 (_ #(#(#(#(#(#(#(#(#(#(# "qtshad?") #) #) #) #) #) #) #) #) #)) 619:8 0 (_ #(#(#(#(#(#(#(#(#(#(# "qtshad?") #) #) #) #) #) #) #) #) #)) ice-9/eval.scm:619:8: ERROR: 1. &error-location: #f 2. &package-license-error: package: #f license: "https://www.qt.io/" 3. &formatted-message: format: "~s: invalid package license~%\n" arguments: ("https://www.qt.io/") guix pull: Fehler: You found a bug: the program '/gnu/store/vbk7jc9w4808cn7= 697bc3h24g2kl78wx-compute-guix-derivation' failed to compute the derivation for Guix (version: "4b2ae06e49fc7bd41856b0= 2604b5f277a6df06ce"; system: "x86_64-linux"; host version: "0dec41f329c37a4293a2a8326f1fe7d9318ec455"; pull-version: 1). Please report the COMPLETE output above by email to . From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 10 03:36:16 2022 Received: (at 58231) by debbugs.gnu.org; 10 Oct 2022 07:36:16 +0000 Received: from localhost ([127.0.0.1]:45756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohnKh-0005Me-Q1 for submit@debbugs.gnu.org; Mon, 10 Oct 2022 03:36:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohnKf-0005MS-TB for 58231@debbugs.gnu.org; Mon, 10 Oct 2022 03:36:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohnKZ-0002Tq-R4; Mon, 10 Oct 2022 03:36:07 -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=Vs2OAMzf3/xQogbkj1wBYdW5mr8NmMeCaOOSjPN+TBw=; b=I23uerlatrAuFQI2mnmo uAbFTM5Q2d/nkfY5IKA7CXJmq4OGY46VPqJsRH9Fr+oTdlxdZGmBDyOxGi0logu01/8Nn5cVKFO8m gEgPmPmedJEMacannLcHC9vYcqqrWHKl3UASVoeep9uugsta48H61iBVB3kJEP5q0+C60OZXVIlD8 3vZL8WmQrv4yYsePMERiA7ZWbKXTuRUWUeLwqHmmHImsynQebI7RE2cTbzRH4pq9FeUf9BBGA9RcY VOJsbzHFjJiuDvaj2Xs12QKYH47qCNOnCsRdVLYnN7gILCm5/0pKH1SFNbcBmjoqunUGZuMFK8j4d R/fyk1725OrViA==; Received: from [193.50.110.253] (port=47202 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohnKZ-0003LL-Cl; Mon, 10 Oct 2022 03:36:07 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: "pelzflorian (Florian Pelz)" Subject: Re: bug#58231: [PATCH 0/2] Checking the 'license' field of packages References: <20221001161911.8116-1-ludo@gnu.org> <87y1tqzgj8.fsf@pelzflorian.de> Date: Mon, 10 Oct 2022 09:36:05 +0200 In-Reply-To: <87y1tqzgj8.fsf@pelzflorian.de> (pelzflorian@pelzflorian.de's message of "Sat, 08 Oct 2022 13:44:11 +0200") Message-ID: <87fsfw5dwa.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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58231 Cc: 58231@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, "pelzflorian (Florian Pelz)" skribis: > Thank you! This is good. Just to let you know though; when reverting > e61c581805b2338ea8feaac86617c5d7bff41c41 and guix pull=E2=80=99ing, there= is > no error location. Doesn=E2=80=99t matter to me though. > > Computing Guix derivation for 'x86_64-linux'... -Backtrace: [...] > 1. &error-location: #f > 2. &package-license-error: > package: #f > license: "https://www.qt.io/" > 3. &formatted-message: > format: "~s: invalid package license~%\n" > arguments: ("https://www.qt.io/") It may be that there=E2=80=99s no location info because during the =E2=80= =9CComputing Guix derivation=E2=80=9D step, things are being evaluated. However, most likely the invalid license wouldn=E2=80=99t have been committ= ed in the first place because the committer would have been unable to test the package. (There is location info when running Guix from one=E2=80=99s checkout.) Thanks for checking! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 10 03:51:45 2022 Received: (at 58231) by debbugs.gnu.org; 10 Oct 2022 07:51:45 +0000 Received: from localhost ([127.0.0.1]:45780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohnZg-0005lg-Ts for submit@debbugs.gnu.org; Mon, 10 Oct 2022 03:51:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohnZe-0005lQ-Bp for 58231@debbugs.gnu.org; Mon, 10 Oct 2022 03:51:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohnZX-0004uI-De for 58231@debbugs.gnu.org; Mon, 10 Oct 2022 03:51: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=NTC+y0af76a99/Qw0LRFL1I3GzQyjjwV1+6vMzD8Uj0=; b=PqxfvmBNlLSjhGsbTwtM vLrt1n8eJ/6VUhGwWOFfxESVLMvDWpnVv1X2PcCLGtsQx2Su7mHCzoXUST+Cos97+VfiQIV5mIng1 99XrDTpMokMXO7xIC0iPQ0K73HBIzm9qIaDwGu+ipbbQbAG3NhqzSSHP9pRsUuQh/z3A1XxEhTKrR 5T5HJHELY7ol8QHp08ZvzC1GlpzZMTpPPpP2BLwVheBZ8Ha6GPpnDQtTbt/pFO9AnOYnSYoAflGdV pO1LNq8K4lyfZPTQXrGoWXKBZyMfWts5Vr/Dyz40kPn/i0H7Ve0SZ0NToFdbVEQqnYn//SFd5dF4d R/OiQf/6v3JLRA==; Received: from [193.50.110.253] (port=38174 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohnZW-0003Nx-WD for 58231@debbugs.gnu.org; Mon, 10 Oct 2022 03:51:35 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 58231@debbugs.gnu.org Subject: Re: bug#58231: [PATCH 0/2] Checking the 'license' field of packages References: <20221001161911.8116-1-ludo@gnu.org> Date: Mon, 10 Oct 2022 09:51:32 +0200 In-Reply-To: <20221001161911.8116-1-ludo@gnu.org> ("Ludovic =?utf-8?Q?Cour?= =?utf-8?Q?t=C3=A8s=22's?= message of "Sat, 1 Oct 2022 18:19:11 +0200") Message-ID: <874jwc5d6j.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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58231 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s skribis: > The funny part of this patch is that the license validation expands > to #t in the majority of cases, meaning that it comes without > run-time overhead (there is macro-expansion overhead, but I didn=E2=80=99t > measure it). A quick measurement of the time taken by the =E2=80=9CComputing Guix deriva= tion=E2=80=9D step=C2=B9 (most of which is macro expansion) suggests it=E2=80=99s going f= rom ~1m34s to ~1m44s on my laptop=E2=80=94so roughly a 10% slowdown on this stage. I guess that=E2=80=99s the price to pay. That phase has always been very slow though, mostly due to psyntax, and we need to do something about it anyway. Ludo=E2=80=99. =C2=B9 I ran =E2=80=98time guix time-machine --branch=3Dwip-license-checks = --url=3D$PWD=E2=80=99 and similar for the commit before those changes. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 10 05:20:50 2022 Received: (at 58231-done) by debbugs.gnu.org; 10 Oct 2022 09:20:50 +0000 Received: from localhost ([127.0.0.1]:46097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohoxu-00048N-0k for submit@debbugs.gnu.org; Mon, 10 Oct 2022 05:20:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohoxs-000489-2i for 58231-done@debbugs.gnu.org; Mon, 10 Oct 2022 05:20:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohoxl-0002aD-Ej; Mon, 10 Oct 2022 05:20:42 -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=QheVMNMUItQ3yqHWALIc4PSTiqpiIH3/mlg5jKIvbgM=; b=l6vDkvbapOMwuY1TXmQT JKrCriH1A6DdF7Xqj6zpbr4ykn8hu8IKWBIlrDouil4q6dwpXa6OYaQjF0GxMHXl78sRso4iTSX+l I5IAuYxgajrqLIPTDhY+IX2DPtRQRGcTOlQvJ69fLHXQm+08ysmF8n5x2txmiMdey9SYM0wpoxR5G OrGpxL6/DMDmavcWjeVDviTfy7fnU+/aGsAPagrgm1v4XnIWVvqDVBljhyA6Ethlhy8YhAAcz2rlV aCKcDLvXAi84fw3Q3CcovArIWravQ/kOYUBnGWt+AC6ko8luKIWE9yEQiFETP0g5y14enGzdeA/07 AqXCvbSwt5BVqQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=34400 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohoxk-0006yL-NE; Mon, 10 Oct 2022 05:20:41 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 58231-done@debbugs.gnu.org Subject: Heads-up: Run =?utf-8?Q?=E2=80=9Cmake?= clean-go && =?utf-8?Q?mak?= =?utf-8?Q?e=E2=80=9D?= References: <20221001161911.8116-1-ludo@gnu.org> Date: Mon, 10 Oct 2022 11:20:30 +0200 In-Reply-To: <20221001161911.8116-1-ludo@gnu.org> ("Ludovic =?utf-8?Q?Cour?= =?utf-8?Q?t=C3=A8s=22's?= message of "Sat, 1 Oct 2022 18:19:11 +0200") Message-ID: <87zge42fxd.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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58231-done Cc: Guix-devel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Ludovic Court=C3=A8s skribis: > licenses: Let 'license?' expand to #t in trivial cases. > packages: Raise an exception for invalid 'license' values. I pushed these two patches as b6bc4c109b807c646e99ec40360e681122d85b2c (see for context). Now we all need to run =E2=80=9Cmake clean-go && make=E2=80=9D! Thank you for your understanding. :-) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 10 06:25:27 2022 Received: (at 58231) by debbugs.gnu.org; 10 Oct 2022 10:25:27 +0000 Received: from localhost ([127.0.0.1]:46196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohpyR-0005w5-2a for submit@debbugs.gnu.org; Mon, 10 Oct 2022 06:25:27 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:41863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohpyE-0005pt-5e for 58231@debbugs.gnu.org; Mon, 10 Oct 2022 06:25:24 -0400 Received: by mail-wr1-f44.google.com with SMTP id bu30so16300912wrb.8 for <58231@debbugs.gnu.org>; Mon, 10 Oct 2022 03:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=I8htZDCg0maJpn+7RJhrkmrhv0s0HwuYQxrDiA0Cow0=; b=HS7ZPhz22ZiGdS8EMUCaEVG5TBSs+RdZ5aUG88kjxmEYzE91VhKsdqdzdemzHP/gJj EDji5Q+B0C0guN8mJ47UKpuqt9sHXQEsaz+lKSGdKDS/ReGhemXOX5IqKoVl2t6FGHx/ tRJOp3Ox7DHPLOMYcv5NXpDRqLsx5XYocx5yHjAaeA7mEqkZhBauW3eYsGkDGonMZum+ J6byIqXcaosotR2shdo18J8ItrEiFFLoWv4cuZkxX0j/5q2poZJ6TkM6Pj4zxXaLU/TT nbSoXLCU3pZLe9fBpCO6wG6yAv8q5/L1Xm8K6b9RVih4FIAPC12wNxiZPdVX+sm8b1R5 g4Ag== 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:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I8htZDCg0maJpn+7RJhrkmrhv0s0HwuYQxrDiA0Cow0=; b=VWaQvvX7S39nA1EL4du7aKWEtzpVJbb+DFWWVYn3Ry3lxS7ycDFFVBcpcX/KqpKDH7 lH4R/7PJBfgzXE9m4f4tPDxjqT7XNWqBW4dC/icDFgXkCMhb/lzRqXVldwtCrI3pf1w+ A/ZxVTIf0Kqax2BNvNv+Pzi8HoASXBDNFIWWx8lbsLKGoVHUul291FrY2RunhA52tyul nHvPGtv+pzAv2owD+yhyU2e9xq7h0fTnd97XJT8Ma6dASbrPVtI+nm5MAF4/rBafRoZS fDVC0k9xjMNXdI3NVn+fWOD55Uo91l/vxGUapSTsMedT2yMXL67C6vDC5Hj0Y0acj83M KZGg== X-Gm-Message-State: ACrzQf0GAgQxJOAQb7ers9iHBBDxS6eWhn4XBew9VKKtyHywhqUnPw1i Mq+GZcp9NXCBZnqlnYQTQEw= X-Google-Smtp-Source: AMsMyM7hGQYeR2Au0qGx4myyH16NyJ0+sx/YGVvCPLI5tYErTJmsawl5laWXtXUZW41BWpTnFTlHpg== X-Received: by 2002:a5d:6181:0:b0:22e:3db0:67a2 with SMTP id j1-20020a5d6181000000b0022e3db067a2mr11362973wru.257.1665397507163; Mon, 10 Oct 2022 03:25:07 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id w5-20020a5d6805000000b002285f73f11dsm10813005wru.81.2022.10.10.03.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 03:25:06 -0700 (PDT) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= , 58231@debbugs.gnu.org Subject: Re: [bug#58231] [PATCH 2/2] packages: Raise an exception for invalid 'license' values. In-Reply-To: <20221001162058.8214-2-ludo@gnu.org> References: <20221001162058.8214-1-ludo@gnu.org> <20221001162058.8214-2-ludo@gnu.org> Date: Mon, 10 Oct 2022 12:22:18 +0200 Message-ID: <87tu4crnad.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58231 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Well, I am a bit late. :-) 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 paragraphs > - (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? Although, the overhead by =C2=ABCompute derivation=C2=BB could too much. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 10 10:52:43 2022 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: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: [bug#58231] [PATCH 2/2] packages: Raise an exception for invalid 'license' values. 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=2C?= 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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58231 Cc: 58231@debbugs.gnu.org, Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 15 18:12:37 2022 Received: (at 58231) by debbugs.gnu.org; 15 Oct 2022 22:12:37 +0000 Received: from localhost ([127.0.0.1]:42750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojpOW-0000nw-Pv for submit@debbugs.gnu.org; Sat, 15 Oct 2022 18:12:37 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56255) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojpOU-0000ng-4F for 58231@debbugs.gnu.org; Sat, 15 Oct 2022 18:12:35 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 12F6C5C007D; Sat, 15 Oct 2022 18:12:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 15 Oct 2022 18:12:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1665871949; x= 1665958349; bh=3QRa3bPZVJNhJaB+NRmC07ImcfzWZ3I+G98GsR46M5g=; b=V hyhP5AyUEEGyce5CJZ7MEO63uCjxmMs2KWXAanzmCjIFnnsTBayLRahDD+WGRDav WCD36Gbn6xq8mALecu4RQozvebGGlBj+XfaeWMpCx0dDjBd+TlCqV1QiCGwWaqjp 4iA558wv9/0+TtG1KCaRSZTLhSDa7YZiElwyvCEjPWYt8U/4KZTjXI2OKB46RItu xGtuiyCt+Nkyc+4my9Kg3zzZpQhMNI2O5ZP4Z8V9Nyb4w+aNwzOMZTcq7EeoR3iH 1WBna2yqDZKWw42zmOa67E8YgsF5ObenI7IKGoULOZ1n6xlcn14lYcc8RM3Cy38w 5Q+HeYlf4bQ/2626PwlJg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1665871949; x=1665958349; bh=3QRa3bPZVJNhJaB+NRmC07ImcfzW Z3I+G98GsR46M5g=; b=moYUTI5GWd0aHMA8f5su76hR4AlZyszVre4RTnIVfo4R iMlKAtmo8oNq4hVbW/yiy4mvLHUzCrKuBVNDRqKjLV841SCMBxZlebpPWguuzXad l13jKqDE5nzntXx3zobtyPuEw6c1nLCqWa1dF/39u0rS5A3eu4ZsF3SY1felyaEQ Dj70VgUqYye8Y/ZOPqTNQloWywDOCjzPm4N++4ix2H1qhsf63Uu8DGdEMgVov0Sb d8ti+fWXkD57xU69dcx6/t5hSaXI83iwrXN+8FZu3sIWnKwr5bCusam2yFrUIkOT Q0lFnuSaMf/v3eGNtSWnRDwrOuxR11e+OLVvdzzDhQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeekhedgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne goufhushhpvggtthffohhmrghinhculdegledmnecujfgurhephffvvefufffkjghfgggt sehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcuofgtifhrrghthhcuoehphhhilh hiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrfgrthhtvghrnheptdfg hfegjeeugeehudetleevvdejgeeugeduvdefgfdufffhhfeufedvkeegfffgnecuffhomh grihhnpehgihhtlhgrsgdrtghomhdpughishgtohhurhhsvgdrghhrohhuphdprggtmhdr ohhrghdpghhithhhuhgsrdhiohdpuhhtrghhrdgvughupdihohhuthhusggvrdgtohhmpd hgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 15 Oct 2022 18:12:28 -0400 (EDT) From: Philip McGrath To: zimoun , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: [bug#58231] [PATCH 2/2] packages: Raise an exception for invalid 'license' values. Date: Sat, 15 Oct 2022 18:12:19 -0400 Message-ID: <3209515.oiGErgHkdL@bastet> In-Reply-To: <87mta320kf.fsf@gnu.org> References: <20221001162058.8214-1-ludo@gnu.org> <87tu4crnad.fsf@gmail.com> <87mta320kf.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6456230.G0QQBjFxQf"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, On Monday, October 10, 2022 10:52:16 AM EDT Ludovic Courtès wrote: > Hi, > > zimoun skribis: > > On sam., 01 oct. 2022 at 18:20, Ludovic Courtès wrote: > >> [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [66.111.4.25 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [66.111.4.25 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 2.0 URI_DOTEDU Has .edu URI X-Debbugs-Envelope-To: 58231 Cc: 58231@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart6456230.G0QQBjFxQf Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath Cc: 58231@debbugs.gnu.org Date: Sat, 15 Oct 2022 18:12:19 -0400 Message-ID: <3209515.oiGErgHkdL@bastet> In-Reply-To: <87mta320kf.fsf@gnu.org> Hi, On Monday, October 10, 2022 10:52:16 AM EDT Ludovic Court=C3=A8s wrote: > Hi, >=20 > zimoun skribis: > > On sam., 01 oct. 2022 at 18:20, Ludovic Court=C3=A8s wro= te: > >> ;; A package. > >> (define-record-type* > >> package make-package > >> @@ -574,7 +607,8 @@ (define-record-type* > >> (sanitize validate-texinfo)) ; one-line descript= ion > >> (description package-description > >> (sanitize validate-texinfo)) ; one or two > >> paragraphs > >> - (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 > >> =20 > >> (default %supported-systems)) > >=20 > > This change is the core, IIUC. The question is: does it make sense to > > have something similar for all the fields? > >=20 > > 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? >=20 > I think eventually we should have contracts rather than home-made type > checks like this (Cc=E2=80=99ing Philip). >=20 Definitely agreed that contracts are The Right Thing, though `string?` by itself would in fact be a contract. I'm planning to get back to trying to write a basic `(guix contracts)` libr= ary once I've finished my current project, a `racket-build-system` (for which I= 've finally started writing code, as opposed to planning and shaving many yaks: https://gitlab.com/philip1/guix-racket-experiment/). I had started a fairly direct port of Racket's contract system, though with= the intention of starting out with as little as possible. I think I'd more or l= ess finished the representation of "blame" objects. However, one thing that gave me pause was some of the advice I got on . Matthias Felleisen wrote: > I will also say that as much as I like ho [higher-order] contracts and u= se them > extensively, > making everything a function is bad for any future optimization. >=20 > Michael B[allantyne] Cameron M and I are thinking of designing a hosted c= ontract DSL > on top, via Michael=E2=80=99s special-purpose expanders, and experimentin= g with a > classical optimizer, perhaps even using Leif=E2=80=99s nano-passes (adapt= ed for > syntax of course). Robby Findler, the mastermind of Racket's contract system, later added in p= art: > If I were to get to redo racket/contract, the one big change I'd make is = to > design a (macro-based) DSL for contracts instead of going with a > combinator-based approach. Although you won't need to do it for a > minimum-viable product, the opportunity to, at a later date, look at an > entire contract at compile time and generate better code for it is probab= ly > going to be useful. >=20 > [...] >=20 > That said, you definitely want to allow arbitrary predicates to just be > contracts without having to type a lot of stuff, as that's turned out to = be > super useful. > > [...] This came as a surprise, though the explanations made sense. In Racket, I h= ave a reasonably good sense of how I would implement the kind of DSL they describ= e, either using the framework Ballantyne, King, and Felleisen set out in https://dl.acm.org/doi/abs/10.1145/3428297 (open-access) or manually along = the lines Alexis King explains in a series of blog posts: 1. https://lexi-lambda.github.io/blog/2018/04/15/reimplementing-hackett-s-= type-language-expanding-to-custom-core-forms-in-racket/ 2. https://lexi-lambda.github.io/blog/2018/09/13/custom-core-forms-in-rack= et-part-ii-generalizing-to-arbitrary-expressions-and-internal-definitions/ 3. https://lexi-lambda.github.io/blog/2018/10/06/macroexpand-anywhere-with= =2Dlocal-apply-transformer/ However, I have no idea how to implement such a thing in Guile, and I think= it would be arduous, perhaps even impossible, without `local-expand` and some = of the other features from "Macros that Work Together: Compile-Time Bindings, Partial Expansion, and Definition Contexts" () and relat= ed papers. I'm also wary of shifting the scope from a minimum viable contract library = to what would amount to a research project trying to improve upon the state-of-the-art contract system. So, despite this advice, I still tentatively think I'd start by doing following the Racket contract library very closely. Still, it reinforces my view that we should start small and initially keep the library as `(guix contracts)` or something (though I don't think it should use any Guix specific in its implementation), rather than trying to make a general-purpo= se library, so we could change things fairly freely as we get a more concrete sense of Guix's needs. (In contrast, Racket tries to maintain an extremely high level of source compatibility with even twenty-year-old code.) > 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= for > fields. >=20 I'm a little unsure about the specific performance hack in this patch, thou= gh. In either Racket or Chez Scheme, I would expect the compiler constant-fold = an application of a record-type predicate to a known constant identifier. It should be able to do this in all of the scenarios where a macro could interpose, and possibly in additional scenarios made visible through previo= us inlining etc. in the compiler. So I would expect handling special cases in a macro to introduce compile-time cost with no run-time benefit. I would expe= ct this to be covered by "The Guaranteed Optimization Clause of the Macro Writ= er's Bill of Rights": https://www.youtube.com/watch?v=3DLIEX3tUliHw =46rom Andy Wingo's message at https://lists.gnu.org/archive/html/guix-devel/2022-03/msg00230.html I've been hoping roughly the same intuitions apply to Guile records, but ma= ybe that's not true? For example, I'm not sure that Guile allows assignment to imported identifiers for which no assignment appeared in their exporting modules (but the chaos that would ensue from `(set! license:gpl3.0+ "not a license")` seems like a great example of why that's such a useful rule). =2DPhilip --nextPart6456230.G0QQBjFxQf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmNLMEMACgkQygNjjfo/ HHoCBQ/9E6AQUfg/54uFx78rXPlypImtCqXr72QIZcRKBhF5r0TJ6YseYSJmL7QX Dl4jZwgMla9PjnF0qXCBohASVpEvMb017gWOmeY4+C3IcYzd+axKAdLw7+7/i4LI 6EaVZYv9eO3USnr9UyOTH/pNiFwL5jnEaJ6zaTwjmIg7iAJOUv/Jpck2sZ5Z59ed 8tly7ZLBXvvIMhZsFNQVk0H68PjjbcFNjUJQbhqjWqrf2clcFippI9jOfF3laJVc oVYuLCC0iJlue9Kqu2sV2mLJ2GMy0czJkAravYggE+9GVUlkiHmFU5vkQWHPOLgt EJhzHrOv0rBhQwYLERe6TcodMm9m//3yGYn4MZSiGyLwhtTFgRVFsI2M8Vy8tOHg LV86V2Fsxy9zqUjPdjW4Z6blnXyTbQGN9wzwvfkJft1hvgFFrwIodZR+H5Oo6riZ unUQCyBFXl23tmwVpi+dUhkCcAzFh3FDdEQ3GJbwmWYqKwcMFHoSxDczDs5USzPS mnH1/9oXBstzK40K9mXaKcQL+WJzA9QD2tcc4rcwun8G4LRv39S2Y2MKGMiYeCYg xnZwZVJsQ0BRphwt7XkB50DZVQbRZGQ1AZuiKANZ/HwUkZiW4Y1AMhTo7EzV+g1l cuW9MDbGYUAoZJv4JLs6mignKrn5oyVpJCAg1ZGgc1QrVyQtCJc= =u1R3 -----END PGP SIGNATURE----- --nextPart6456230.G0QQBjFxQf-- From unknown Sat Jul 12 12:27:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 13 Nov 2022 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator