Re: Exclude checker with package properties [draft PATCH]

2024-06-21 Thread Simon Tournier
Hi Felix,

On Fri, 21 Jun 2024 at 20:37, Felix Lechner  wrote:

> > Is debbugs.gnu.org having issues?
>
> Yes, the community0p server crashed this morning.  Luckily, Debbugs
> appears to be back online and added messages I sent during the outage.
> Maybe yours will get there, too.

Thanks.  Yeah the message reached issues.guix.gnu.org so I guess all
is fine. :-)


> > See attached the patch implementing that.
>
> Thank you!  Do you see a chance we can amend the patch so I can block
> such package definitions from being used by 'guix deploy', 'guix system
> reconfigure' and 'guix home reconfigure'?

My input of this will wait after my holidays. ;-)

Cheers,
simon



Re: Exclude checker with package properties [draft PATCH]

2024-06-21 Thread Simon Tournier
On Fri, 21 Jun 2024 at 19:51, Simon Tournier  wrote:

> 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… :-)

Done here: https://issues.guix.gnu.org/71697#1

Cheers,
simon



Re: Exclude checker with package properties [draft PATCH]

2024-06-21 Thread Development of GNU Guix and the GNU System distribution.
Hi Simon,

On Fri, Jun 21 2024, Simon Tournier wrote:

> Is debbugs.gnu.org having issues?

Yes, the community0p server crashed this morning.  Luckily, Debbugs
appears to be back online and added messages I sent during the outage.
Maybe yours will get there, too.

> See attached the patch implementing that.

Thank you!  Do you see a chance we can amend the patch so I can block
such package definitions from being used by 'guix deploy', 'guix system
reconfigure' and 'guix home reconfigure'?

The new field looks to me like an amendment of the license terms,
especially if the field was added by the author pursuant to the
objections raised in this thread.  I would rather not pollute my systems
with potentially unfree software.

Also, for all the controversy surrounding LLMs, which I read with great
interest, SHW still provides a valuable service by making sure the
sources I depend upon to configure my systems do not disappear.  Due to
my custom patches, I regularly bootstrap Guix.  I cannot be caught in a
situation from which I cannot recover.

Kind regards
Felix



Exclude checker with package properties [draft PATCH]

2024-06-21 Thread Simon Tournier

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.

>From 8cb162bcde91d3b39453de576caadb9a6f8f8733 Mon Sep 17 00:00:00 2001
Message-ID: <8cb162bcde91d3b39453de576caadb9a6f8f8733.1718990517.git.zimon.touto...@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 Żelazny@*
 Copyright @copyright{} 2020 Damien Cassou@*
 Copyright @copyright{} 2020 Jakub Kądziołka@*
@@ -15380,6 +15380,19 @@ Invoking guix lint
 prints a message and the @code{archival} checker stops doing anything until
 that limit has been reset.
 
+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)))
 
-  (parameterize ((%allow-request? skip-when-limit-reached))
-(catch #t
-  (lambda ()
-(match (package-source package)
-  (#f ;no source
-   '())
-  ((and (? origin? origin)
-(= 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=> (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 now.
-;; 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)
+  (= origin-uri (? git-reference? reference)))
+ (define url
+   (git-reference-url reference))
+ (define commit
+   (git-reference-commit