unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#64861] [PATCH] guix: Add lint check for guix as propagated-input
@ 2023-07-25 18:04 Karl Hallsby via Guix-patches via
  2023-07-25 18:26 ` Christopher Baines
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Hallsby via Guix-patches via @ 2023-07-25 18:04 UTC (permalink / raw)
  To: 64861
  Cc: Karl Hallsby, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Ricardo Wurmus,
	Simon Tournier, Tobias Geerinckx-Rice

* guix/lint.scm (new check): Run lint check warning user if the provided
package uses guix as a propagated-input.

Passing guix as a propagated-input is problematic when users install a package
into their profiles. This can cause the guix propagated by the package to be
used in preference of the real one in $HOME/.config/. It was first noticed on
IRC with https://logs.guix.gnu.org/guix/2023-07-22.log#044534, and reproduced
with a different package https://logs.guix.gnu.org/guix/2023-07-25.log#054737.
---
 guix/lint.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/guix/lint.scm b/guix/lint.scm
index d173563e51..5fae34ca22 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -575,6 +575,16 @@ (define (check-input-labels package)
                 (inputs ,package-inputs)
                 (propagated-inputs ,package-propagated-inputs))))
 
+(define (check-guix-propagated-inputs package)
+  (if (and (not (null? (package-propagated-inputs package)))
+           (not (memq (@ (gnu packages package-management) guix)
+                      (package-propagated-inputs package))))
+      (list
+       (make-warning package
+                     (G_ "are you sure guix should be a propagated-input?")
+                     #:field 'propagated-inputs))
+      '()))
+
 (define (report-wrap-program-error package wrapper-name)
   "Warn that \"bash-minimal\" is missing from 'inputs', while WRAPPER-NAME
 requires it."
@@ -1884,6 +1894,10 @@ (define %local-checkers
      (name        'input-labels)
      (description "Identify input labels that do not match package names")
      (check       check-input-labels))
+   (lint-checker
+     (name        'warn-guix-propagated-inputs)
+     (description "Emit warning if guix package is propagated-input")
+     (check       check-guix-propagated-inputs))
    (lint-checker
      (name        'wrapper-inputs)
      (description "Make sure 'wrap-program' can finds its interpreter.")

base-commit: 9ff1e7652a407b88a3eeeab6a67261f6fee40807
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-07 15:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-25 18:04 [bug#64861] [PATCH] guix: Add lint check for guix as propagated-input Karl Hallsby via Guix-patches via
2023-07-25 18:26 ` Christopher Baines
2023-07-25 18:41   ` Karl G. Hallsby via Guix-patches via
2023-08-20 20:58   ` Ludovic Courtès
2023-09-07 14:22     ` Simon Tournier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).