From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YLwZC1dbU2RANAAASxT56A (envelope-from ) for ; Thu, 04 May 2023 09:14:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CLkVC1dbU2RwdgEA9RJhRA (envelope-from ) for ; Thu, 04 May 2023 09:14:31 +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 B3FA43974A for ; Thu, 4 May 2023 09:14:30 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puTA2-0004wf-7n; Thu, 04 May 2023 03:13:54 -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 1puT9z-0004wP-9Y for guix-devel@gnu.org; Thu, 04 May 2023 03:13:51 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puT9w-0005a9-0m for guix-devel@gnu.org; Thu, 04 May 2023 03:13:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=5Bs7zMxC4rP+GfvoHXf66HvhnbaHlb1w0HBYzuxojxo=; b=IMMt6Z6dn9QbZVSLrYVnMyAARoBWJBwIrIiRGW3u7BltLL59/qak3v+8 yM/08VvCuXvJvVVvnu8xlSkXJrzObiQ4OG25C6Lu+lik0p77ovwggWTuh ABc8uLhJR94r87wX0/W/ycq2MeUeT2lbn/sZ0Ld+nsQoiPV1RX/VYe6UK 0=; X-IronPort-AV: E=Sophos;i="5.99,249,1677538800"; d="scan'208,223";a="106177782" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2023 09:13:42 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer , Simon Tournier Cc: =?utf-8?Q?Bj=C3=B6rn_H=C3=B6fling?= , guix-devel@gnu.org, Lars-Dominik Braun Subject: Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json References: <20230312220021.22bfff4f@tangletp> <878rfwgbng.fsf@gnu.org> <86lej8y75p.fsf@gmail.com> <87cz3t44hi.fsf_-_@inria.fr> <86pm7sb7vf.fsf@gmail.com> <87354oqdal.fsf@gmail.com> <87v8hg9lct.fsf@gmail.com> <875y9c9963.fsf@gmail.com> <87v8hb9o74.fsf@inria.fr> <871qjy51zo.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 15 =?utf-8?Q?Flor=C3=A9al?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Ver =?utf-8?Q?=C3=A0?= soie 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: Thu, 04 May 2023 09:13:41 +0200 In-Reply-To: <871qjy51zo.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 02 May 2023 08:52:59 -0400") Message-ID: <87jzxovaai.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=192.134.164.83; envelope-from=ludovic.courtes@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683184471; a=rsa-sha256; cv=none; b=GMwl6Sngcz9kUFb9jIT1zCq/Q8ZOUfB518VMKGdm20hl6op5GhDoZ9p524hWpUvSALPVwb CTlTL30fdjikjnWzt6MQlpQf8chZUcf58xnlsT80R+HyzYGIGuF/oNdiaTZKjO6fqIL0g/ jJXeO8KSeKjj5t7wYsX5yiRS5Z1axnHIdjgmD1f50HAc28bauIwQendGQ+X8SIIPh67DRv e6P/UL/GbAdnANiij6uIGVzLFCU2ht2sreca/xaEhAOIS9lTF76vq4oMCZy+PVh74vitoU Sa3PNFmi3mpW3HlFEEmA8DvKshDVqKXV+gtuJAatrelqOu8lrSi8lhNyQrYZUw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=inria.fr header.s=dc header.b=IMMt6Z6d; dmarc=pass (policy=none) header.from=inria.fr; 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=1683184471; 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=5Bs7zMxC4rP+GfvoHXf66HvhnbaHlb1w0HBYzuxojxo=; b=gP40Qdti4O/X8t8JLp4U6g7Iji84YQ3LHjTq55QOSFZlVBTCzTw7jA6utJftAKPh4BoPuO cyKXh4oN8xY889J2wYNaK89WGlsC/7HC25WTu/N0nnRVYTw4D84vuaKQIHjQzXztvDI2fM E/tIVInIFltgwGEXrNIGk47i1LOdvMowqiWNrHcVuYjFJ/hfRc95NBOK5t1z8Z9u9Xg2S4 5i8XlavJ+cBBIm2Jsj3Qo+V79jqHtV+/Ix/etFFBugqrWG3HBmLoLUQxeGWD34TmbJd/St 8HaWE3X7abziLSnvXbvBZo7/vpAkMPYuzJ7DrWC/M7mCt2d94on0Wh99b/Ntxg== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=inria.fr header.s=dc header.b=IMMt6Z6d; dmarc=pass (policy=none) header.from=inria.fr; 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: -3.70 X-Spam-Score: -3.70 X-Migadu-Queue-Id: B3FA43974A X-TUID: K+0m5V9LSaat --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello! Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >> So I guess as a matter of policy, we should try and find other ways to >> express this so we don=E2=80=99t lose track of origins. > > Thanks for explaining, it makes sense. One way to tip package writers > in the right direction would be to add a warning when such a situation > occurs upon running 'guix lint'. How about the attached patch? --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix lint -c archival ruby-sorbet-runtime racket gnu/packages/ruby.scm:14081:12: ruby-sorbet-runtime@0.5.10610.2023010617452= 0-1fa668010: source is not an origin, it cannot be archived --8<---------------cut here---------------end--------------->8--- (The version string of this package looks way too long.) Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-lint-archival-Warn-against-non-origin-package-source.patch Content-Transfer-Encoding: quoted-printable Content-Description: the patch >From 153cb8e5782946bd0c9de22022a475ae9fef70ea Mon Sep 17 00:00:00 2001 Message-Id: <153cb8e5782946bd0c9de22022a475ae9fef70ea.1683184269.git.ludo@g= nu.org> From: =3D?UTF-8?q?Ludovic=3D20Court=3DC3=3DA8s?=3D Date: Thu, 4 May 2023 09:09:03 +0200 Subject: [PATCH] lint: archival: Warn against non-origin package sources. Suggested by Maxim Cournoyer and Simon Tournier . * guix/lint.scm (check-archival): Add 'local-file?' clause. Clarify message in case (package-source package) is not an origin. * tests/lint.scm ("archival: not an origin"): New test. --- guix/lint.scm | 11 +++++++---- tests/lint.scm | 11 +++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/guix/lint.scm b/guix/lint.scm index 0ed5b8dc98..72b3f4e7b1 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -1610,11 +1610,11 @@ (define (check-archival package) (parameterize ((%allow-request? skip-when-limit-reached)) (catch #t (lambda () - (match (and (origin? (package-source package)) - (package-source package)) + (match (package-source package) (#f ;no source '()) - ((=3D origin-uri (? git-reference? reference)) + ((and (? origin?) + (=3D origin-uri (? git-reference? reference))) (define url (git-reference-url reference)) (define commit @@ -1680,9 +1680,12 @@ (define (check-archival package) ((? content?) '()))) '())) + ((? local-file?) + '()) (_ (list (make-warning package - (G_ "unsupported source type") + (G_ "\ +source is not an origin, it cannot be archived") #:field 'source))))) (match-lambda* (('swh-error url method response) diff --git a/tests/lint.scm b/tests/lint.scm index ce22e2355a..b91bd053c5 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2012, 2013 Cyril Roelandt ;;; Copyright =C2=A9 2014, 2015, 2016 Eric Bavier -;;; Copyright =C2=A9 2014-2022 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2014-2023 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2015, 2016 Mathieu Lirzin ;;; Copyright =C2=A9 2016 Hartmut Goebel ;;; Copyright =C2=A9 2017 Alex Kost @@ -43,7 +43,8 @@ (define-module (test-lint) #:use-module (guix lint) #:use-module (guix ui) #:use-module (guix swh) - #:use-module ((guix gexp) #:select (gexp local-file gexp?)) + #:use-module ((guix gexp) + #:select (gexp local-file computed-file gexp?)) #:use-module ((guix utils) #:select (call-with-temporary-directory)) #:use-module ((guix import hackage) #:select (%hackage-url)) #:use-module ((guix import stackage) #:select (%stackage-url)) @@ -1298,6 +1299,12 @@ (define (package-with-phase-changes changes) '() (check-formatting (dummy-package "x"))) =20 +(test-assert "archival: not an origin" + (warning-contains? "not an origin" + (check-archival + (dummy-package + "x" (source (computed-file "x-src" #t)))))) + (test-assert "archival: missing content" (let* ((origin (origin (method url-fetch) base-commit: 44d70440944aa47e5f37493346e560f38907d777 --=20 2.39.2 --=-=-=--