GNU bug report logs - #73434
[PATCH] lint: Check for minimal variants.

Previous Next

Package: guix-patches;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Mon, 23 Sep 2024 08:00:03 UTC

Severity: normal

Tags: patch

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73434 in the body.
You can then email your comments to 73434 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#73434; Package guix-patches. (Mon, 23 Sep 2024 08:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Efraim Flashner <efraim <at> flashner.co.il>:
New bug report received and forwarded. Copy sent to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org. (Mon, 23 Sep 2024 08:00:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: guix-patches <at> gnu.org
Cc: Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH] lint: Check for minimal variants.
Date: Mon, 23 Sep 2024 10:56:01 +0300
* guix/lint.scm (check-inputs-should-use-a-minimal-variant): New
procedure.
(%local-checkers): Add it.

Change-Id: Ifbf808063e4e125c7070505a8a6215128d84b40b
---
 guix/lint.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index 7612832a5a6..8c6c20c7237 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;; Copyright © 2017 Alex Kost <alezost <at> gmail.com>
 ;;; Copyright © 2017, 2021 Tobias Geerinckx-Rice <me <at> tobias.gr>
-;;; Copyright © 2017, 2018, 2020 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2017, 2018, 2020, 2024 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2020 Chris Marusich <cmmarusich <at> gmail.com>
 ;;; Copyright © 2020 Timothy Sample <samplet <at> ngyro.com>
@@ -96,6 +96,7 @@ (define-module (guix lint)
   #:export (check-description-style
             check-inputs-should-be-native
             check-inputs-should-not-be-an-input-at-all
+            check-inputs-should-use-a-minimal-variant
             check-input-labels
             check-wrapper-inputs
             check-patch-file-names
@@ -598,6 +599,21 @@ (define (check-inputs-should-not-be-an-input-at-all package)
          (package-input-intersection (package-direct-inputs package)
                                      input-names))))
 
+(define (check-inputs-should-use-a-minimal-variant package)
+  ;; Emit a warning if some inputs of PACKAGE should likely be replaced
+  ;; with their minimal variant.
+  (let ((input-names '("bash"
+                       "cmake"
+                       "gettext")))
+    (map (lambda (input)
+           (make-warning
+            package
+            (G_ "'~a' should probably switched for its minimal variant")
+            (list input)
+            #:field 'inputs))
+         (package-input-intersection (package-direct-inputs package)
+                                     input-names))))
+
 (define (check-input-labels package)
   "Emit a warning for labels that differ from the corresponding package name."
   (define (check input-kind package-inputs)
@@ -1978,6 +1994,10 @@ (define %local-checkers
      (name        'inputs-should-not-be-input)
      (description "Identify inputs that shouldn't be inputs at all")
      (check       check-inputs-should-not-be-an-input-at-all))
+   (lint-checker
+     (name        'inputs-should-be-minimal)
+     (description "Identify inputs that should use their minimal variant")
+     (check       check-inputs-should-use-a-minimal-variant))
    (lint-checker
      (name        'input-labels)
      (description "Identify input labels that do not match package names")

base-commit: 41e408eb1f93d96b549d345e2de74143220b7b76
-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





Information forwarded to guix-patches <at> gnu.org:
bug#73434; Package guix-patches. (Mon, 23 Sep 2024 14:12:02 GMT) Full text and rfc822 format available.

Message #8 received at 73434 <at> debbugs.gnu.org (full text, mbox):

From: Suhail Singh <suhailsingh247 <at> gmail.com>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, 73434 <at> debbugs.gnu.org,
 Mathieu Othacehe <othacehe <at> gnu.org>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#73434] [PATCH] lint: Check for minimal variants.
Date: Mon, 23 Sep 2024 10:09:58 -0400
Efraim Flashner <efraim <at> flashner.co.il> writes:

> +(define (check-inputs-should-use-a-minimal-variant package)
> +  ;; Emit a warning if some inputs of PACKAGE should likely be replaced
> +  ;; with their minimal variant.

Should this have been a docstring instead?

-- 
Suhail




Information forwarded to guix-patches <at> gnu.org:
bug#73434; Package guix-patches. (Tue, 24 Sep 2024 07:19:01 GMT) Full text and rfc822 format available.

Message #11 received at 73434 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Suhail Singh <suhailsingh247 <at> gmail.com>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, 73434 <at> debbugs.gnu.org,
 Mathieu Othacehe <othacehe <at> gnu.org>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#73434] [PATCH] lint: Check for minimal variants.
Date: Tue, 24 Sep 2024 10:16:37 +0300
[Message part 1 (text/plain, inline)]
On Mon, Sep 23, 2024 at 10:09:58AM -0400, Suhail Singh wrote:
> Efraim Flashner <efraim <at> flashner.co.il> writes:
> 
> > +(define (check-inputs-should-use-a-minimal-variant package)
> > +  ;; Emit a warning if some inputs of PACKAGE should likely be replaced
> > +  ;; with their minimal variant.
> 
> Should this have been a docstring instead?

I copied the procedure immediately above it and then made changes.
Looking at the other procedures, yes, it looks like it should be a
docstring.  I've changed it locally.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Sun, 29 Sep 2024 16:13:04 GMT) Full text and rfc822 format available.

Notification sent to Efraim Flashner <efraim <at> flashner.co.il>:
bug acknowledged by developer. (Sun, 29 Sep 2024 16:13:04 GMT) Full text and rfc822 format available.

Message #16 received at 73434-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 73434-done <at> debbugs.gnu.org
Subject: Re: bug#73434: Acknowledgement ([PATCH] lint: Check for minimal
 variants.)
Date: Sun, 29 Sep 2024 19:11:15 +0300
[Message part 1 (text/plain, inline)]
Patch pushed

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Oct 2024 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 314 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.