From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id CCSuB+K9dWaYlwAAqHPOHw:P1 (envelope-from ) for ; Fri, 21 Jun 2024 17:52:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id CCSuB+K9dWaYlwAAqHPOHw (envelope-from ) for ; Fri, 21 Jun 2024 19:52:34 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ffBHEMdK; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718992353; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0h1YqwhvPOMdGfCxw0a6UE5P4gwFF9NAmpC5br+SuJk=; b=uGUsq8yywg0qKSiVnnjUruriZgam34LfS5rfbjhsoQL+QHznHw2qIAeJ1o90dhKel3fDJE fJN+1xPECV6cAvCl8c1Nst8/OA65QdqyQY7hg2CmYJdd+ocK+nWZhPwcQNejSA93tEVjS5 2YngoySAPry+euZQjeK3R4Bm1quo1GbzZCJFLFcTgbgS3onkNtupvv6T5heJKXnxf4mn2P qMbbuzqHwusWf1VvUS9+6Schdtpp/jiraQXejDzGmjxipTi9qwAVXRAd45kM+Jr2sTy8Mt YFyn19yvxsjqbG2iq9nqTKO1QYv5WkdnckOu5qgBzUraa+eIOVGrf89zaI7deQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718992353; a=rsa-sha256; cv=none; b=ttkgQEtWGUXzIWH1SPae46Er28PW10vd7HwQDRGHs3oyKIvOca6N9eWGWMrwOu8nt2Al7L 5ysSJZqF0b4fiGeJbrHTvTLBxxpZ7tQQ8IOeolTbbkEE9m8eyOIOytnrLU8PG+dXTQzCsf 9AqigiRvzH4enz+38iJ4JrhAeIB0zVd1BRb+c6hCKb5Qw28cOYhSsqXvIWXb77PIiAS9dN e1J8TvHKKMBZz5LjGR1EE/V5WqYAsqA3qhVd/jXvq+e4Qyt8NMwRMbbGqTk4R1gN95AZZA AxAZZFaAnccccgeyjfhPY91ZgCx2lkK9Zj3LMXa6lexQlYhuxP3q1b9NizWvkQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ffBHEMdK; 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" 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 B25D91B2DE for ; Fri, 21 Jun 2024 19:52:33 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKiQN-0001YA-Ud; Fri, 21 Jun 2024 13:51:47 -0400 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 1sKiQM-0001Xj-0L for guix-devel@gnu.org; Fri, 21 Jun 2024 13:51:46 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKiQK-00030y-2V for guix-devel@gnu.org; Fri, 21 Jun 2024 13:51:45 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4210f0bb857so2929705e9.1 for ; Fri, 21 Jun 2024 10:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718992302; x=1719597102; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=0h1YqwhvPOMdGfCxw0a6UE5P4gwFF9NAmpC5br+SuJk=; b=ffBHEMdKr6xJlOQy0y6JLjJijMiTbRG+YyshzgJ2Q3zM1Kgb0cXJVVfvF1K7GY6oQu qTbkiNPuiOe3eM08f0mOe6t81Q2kHSgtLy0eqxWXVDHODDSKw+PsJdSXxDGgo57jmC2h lHq/CpaeDTi3q/lCFTdcXpxW9xMtOW/67hHoOzqU3mMx3lg4NdQ4sd+TgDdIzkFErBdu 9sF4NqvsnVs8jzg1tq9kFKLVPC7M8bxRDxSxp/OfVaqx7XhgR7OW80VT+YQs3KHjLVec x6936qZONjUOnVWPua0Ztr66v7UEgVSDLMQ5TJSeGVkflk7YO/OaLlYRWecs7F4swff2 bBXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718992302; x=1719597102; h=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=0h1YqwhvPOMdGfCxw0a6UE5P4gwFF9NAmpC5br+SuJk=; b=ipAt+RYJHWoEPsmK3I2t3DQjaRIgNQFVSd2b7UySonNSHnZsxef6//h7MXtyYvTQpi 8Ttp/HMRQ4IFx5ejfg4Zaqj6VykP7LhR2rYAIcLxkgZZcBVSApyv5ZKzXZ+yjhMfl8w6 gDxE+WNWCsG57U80IlCFz/7Y6x0LpNfgJF0vNPjQ61y24K3pLX1RBzpibkrR0vOszunw HAUtSCsVhwWRd2mAAQc68lVG/Y6H41XLmxtuYOIzwFdOOqRVt7e0KfMwUgRD3uJyHgyp o9CSYwE+vSigMpDnQKo9GFbwWQtNxz96XqGdZF4dWZxlnvkXA47hKaQF9GglcfSl0RmH n1Kw== X-Gm-Message-State: AOJu0YyF3k+H2NBZc8JQE95DOiBbGWjeT3VM50GPhtmCnl1mKHpshzmQ 1GJ70AsVTSFcsbxHRKrJljrRjY/mTRL2FbIUrgx/PBo3o1crE+TNzUvNoQ== X-Google-Smtp-Source: AGHT+IH9g9Hec0ps61iQ6lz8sBThe6uXZhfxgwL9KP3F0xkxNwQ5qfPKGa+kt3EfpH/Qorz35pvtxw== X-Received: by 2002:a05:600c:3b9c:b0:421:de31:76 with SMTP id 5b1f17b1804b1-4247529f031mr66687435e9.3.1718992302084; Fri, 21 Jun 2024 10:51:42 -0700 (PDT) Received: from lili ([89.207.175.12]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-424817ab01asm36945555e9.20.2024.06.21.10.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 10:51:40 -0700 (PDT) From: Simon Tournier To: Dale Mellor , Ekaitz Zarraga , Andreas Enge Cc: guix-devel@gnu.org Subject: Exclude checker with package properties [draft PATCH] In-Reply-To: <8c9da9051b126ed3ef25905bd0ec166c7c54818d.camel@rdmp.org> References: <20240618113717.4a6bad2b@fannys.me> <8734pa5mlx.fsf@meson> <077b1a0fdec4d0f30209c28d75dc40811c77a4a9.camel@rdmp.org> <24a0a840a595dfba7c145e5f207fef532ceb16d6.camel@rdmp.org> <8c9da9051b126ed3ef25905bd0ec166c7c54818d.camel@rdmp.org> Date: Fri, 21 Jun 2024 19:51:29 +0200 Message-ID: <87iky2yyji.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: B25D91B2DE X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.71 X-Spam-Score: -9.71 X-TUID: ypKz92wkHWhF --=-=-= Content-Type: text/plain On Fri, 21 Jun 2024 at 09:41, Dale Mellor wrote: > `-x archival` does it, but it is too easy to forget [...] > at least there should be a flag in the package definition. See attached the patch implementing that. --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-guix-lint-Honor-no-archival-package-property.patch Content-Transfer-Encoding: quoted-printable Content-Description: p.patch >From 8cb162bcde91d3b39453de576caadb9a6f8f8733 Mon Sep 17 00:00:00 2001 Message-ID: <8cb162bcde91d3b39453de576caadb9a6f8f8733.1718990517.git.zimon.= toutoune@gmail.com> From: Simon Tournier Date: Fri, 21 Jun 2024 19:17:57 +0200 Subject: [PATCH] guix: lint: Honor 'no-archival?' package property. * guix/lint.scm (check-archival): Skip the checker if the package is marked. * doc/guix.texi: Document it. Change-Id: I2e21b60ee4f02255f298740a2e9ebb1717e490ff --- doc/guix.texi | 15 ++++- guix/lint.scm | 154 ++++++++++++++++++++++++++------------------------ 2 files changed, 93 insertions(+), 76 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 769ca1399f..5c1cb89686 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -71,7 +71,7 @@ Copyright @copyright{} 2019 Alex Griffin@* Copyright @copyright{} 2019, 2020, 2021, 2022 Guillaume Le Vaillant@* Copyright @copyright{} 2020 Liliana Marie Prikler@* -Copyright @copyright{} 2019, 2020, 2021, 2022, 2023 Simon Tournier@* +Copyright @copyright{} 2019, 2020, 2021, 2022, 2023, 2024 Simon Tournier@* Copyright @copyright{} 2020 Wiktor =C5=BBelazny@* Copyright @copyright{} 2020 Damien Cassou@* Copyright @copyright{} 2020 Jakub K=C4=85dzio=C5=82ka@* @@ -15380,6 +15380,19 @@ Invoking guix lint prints a message and the @code{archival} checker stops doing anything until that limit has been reset. =20 +Sometimes it is not desired to send a request for archiving each time +@command{guix lint} is run. The package might be marked to skip the +@code{archival} checker by honoring the @code{no-archival?} property in +package definition: + +@lisp +(define-public python-scikit-learn + (package + (name "python-scikit-learn") + ;; @dots{} + (properties '((no-archival? . #t))))) +@end lisp + @item cve @cindex security vulnerabilities @cindex CVE, Common Vulnerabilities and Exposures diff --git a/guix/lint.scm b/guix/lint.scm index 68d532968d..4c33ec6598 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -1717,84 +1717,88 @@ (define (check-archival package) (lookup-directory-by-nar-hash (content-hash-value hash) (content-hash-algorithm hash))) =20 - (parameterize ((%allow-request? skip-when-limit-reached)) - (catch #t - (lambda () - (match (package-source package) - (#f ;no source - '()) - ((and (? origin? origin) - (=3D origin-uri (? git-reference? reference))) - (define url - (git-reference-url reference)) - (define commit - (git-reference-commit reference)) - (define hash - (origin-hash origin)) - - (match (or (lookup-by-nar-hash hash) - (if (commit-id? commit) - (or (lookup-revision commit) - (lookup-origin-revision url commit)) - (lookup-origin-revision url commit))) - ((or (? string?) (? revision?)) - '()) - (#f - ;; Revision is missing from the archive, attempt to save it. - (save-package-source package)))) - ((? origin? origin) - (if (and=3D> (origin-hash origin) ;XXX: for ungoogled-= chromium - content-hash-value) ;& icecat - (let ((hash (origin-hash origin))) - (match (or (lookup-by-nar-hash hash) - (lookup-content (content-hash-value hash) - (symbol->string - (content-hash-algorithm hash)= ))) - (#f - ;; If ORIGIN is a version-control checkout, save it no= w. - ;; If not, check whether HASH is in the Disarchive - ;; database ("Save Code Now" does not accept tarballs). - (if (vcs-origin origin) - (save-package-source package) - (match (lookup-disarchive-spec hash) - (#f - (list (make-warning package - (G_ "source not archived on= Software \ + (if (not (assq 'no-archival? (package-properties package))) + (parameterize ((%allow-request? skip-when-limit-reached)) + (catch #t + (lambda () + (match (package-source package) + (#f ;no source + '()) + ((and (? origin? origin) + (=3D origin-uri (? git-reference? reference))) + (define url + (git-reference-url reference)) + (define commit + (git-reference-commit reference)) + (define hash + (origin-hash origin)) + + (match (or (lookup-by-nar-hash hash) + (if (commit-id? commit) + (or (lookup-revision commit) + (lookup-origin-revision url commit)) + (lookup-origin-revision url commit))) + ((or (? string?) (? revision?)) + '()) + (#f + ;; Revision is missing from the archive, attempt to save i= t. + (save-package-source package)))) + ((? origin? origin) + (if (and=3D> (origin-hash origin) ;XXX: for ungoogle= d-chromium + content-hash-value) ;& icecat + (let ((hash (origin-hash origin))) + (match (or (lookup-by-nar-hash hash) + (lookup-content (content-hash-value hash) + (symbol->string + (content-hash-algorithm has= h)))) + (#f + ;; If ORIGIN is a version-control checkout, save it = now. + ;; If not, check whether HASH is in the Disarchive + ;; database ("Save Code Now" does not accept tarball= s). + (if (vcs-origin origin) + (save-package-source package) + (match (lookup-disarchive-spec hash) + (#f + (list (make-warning package + (G_ "source not archived = on Software \ Heritage and missing from the Disarchive database") - #:field 'source))) - (directory-ids - (match (find (lambda (id) - (not (lookup-directory id))) - directory-ids) - (#f '()) - (id - (list (make-warning package - (G_ "\ + #:field 'source))) + (directory-ids + (match (find (lambda (id) + (not (lookup-directory id))) + directory-ids) + (#f '()) + (id + (list (make-warning package + (G_ "\ Disarchive entry refers to non-existent SWH directory '~a'") - (list id) - #:field 'source)))))))) - ((? content?) - '()) - ((? string? swhid) - '()))) - '())) - ((? local-file?) - '()) - (_ - (list (make-warning package - (G_ "\ + (list id) + #:field 'source)))))))) + ((? content?) + '()) + ((? string? swhid) + '()))) + '())) + ((? local-file?) + '()) + (_ + (list (make-warning package + (G_ "\ source is not an origin, it cannot be archived") - #:field 'source))))) - (match-lambda* - (('swh-error url method response) - (swh-response->warning package url method response)) - ((key . args) - (if (eq? key skip-key) - '() - (with-networking-fail-safe - (G_ "while connecting to Software Heritage") - '() - (apply throw key args)))))))) + #:field 'source))))) + (match-lambda* + (('swh-error url method response) + (swh-response->warning package url method response)) + ((key . args) + (if (eq? key skip-key) + '() + (with-networking-fail-safe + (G_ "while connecting to Software Heritage") + '() + (apply throw key args))))))) + (list + (make-warning package + (G_ "skip archiving as marked by package"))))) =20 (define (check-haskell-stackage package) "Check whether PACKAGE is a Haskell package ahead of the current base-commit: bc8a41f4a8d9f1f0525d7bc97c67ed3c8aea3111 --=20 2.41.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Well, thinking about indeed it could helpful in some context to specify the checkers to exclude at the package definition level. Other said, this patch could be generalized. Work in progress=E2=80=A6 :-) Cheers, simon PS: I am on the train and the network connection is poor=E2=80=A6 I have se= nt the guix-patches but it does not appear. Hum, weird?! Is debbugs.gnu.org having issues? Because the issue rings a bell=E2=80=A6 but I do not find the message. --=-=-=--