From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4MzlDRZC5V6oEQAA0tVLHw (envelope-from ) for ; Sat, 13 Jun 2020 21:16:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id GAfXCRZC5V50WAAAbx9fmQ (envelope-from ) for ; Sat, 13 Jun 2020 21:16:06 +0000 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 E0C0C9409E2 for ; Sat, 13 Jun 2020 21:16:05 +0000 (UTC) Received: from localhost ([::1]:42508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkDVU-000390-S2 for larch@yhetil.org; Sat, 13 Jun 2020 17:16:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkDVL-00038m-LP for guix-devel@gnu.org; Sat, 13 Jun 2020 17:15:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35212) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkDVL-0006dk-6R; Sat, 13 Jun 2020 17:15:55 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45844 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jkDVK-0005Gn-QG; Sat, 13 Jun 2020 17:15:54 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Edouard Klein Subject: Re: A script to check an edit does not break anything References: <87sgf1r5nk.fsf@alice.lan> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 Prairial an 228 de la =?utf-8?Q?R=C3=A9volution?= 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: Sat, 13 Jun 2020 23:15:52 +0200 In-Reply-To: <87sgf1r5nk.fsf@alice.lan> (Edouard Klein's message of "Thu, 11 Jun 2020 17:19:59 +0200") Message-ID: <874krewttj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: eOvIxmwwocpf --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Edouard, Edouard Klein skribis: > Because of the subtle consequences of editing a package are hard to keep > track of, I wrote the attached script (you need sharness to run it, but > with slight modification it can become a standalone script). > > This script goes beyond the instructions of the manual on two fronts: > - First, it not only tries to build the packages, but also to install > them, I think this is probably the first time we have this problem (that I remember of), probably because the Jupyter dependency graph has so many propagated inputs. However, this is definitely something =E2=80=98guix lint=E2=80=99 could che= ck with something along the lines of the patch below. > - Secondly, it does not limit itself to the dependents (as listed by > guix refresh --list-dependents) of the packages one is meddling with, > but to the whole reverse bags (as listed by guix graph > --type=3Dreverse-bag). I think it=E2=80=99s equivalent: =E2=80=98guix refresh -l=E2=80=99 simply s= hows the contour of the graph whereas =E2=80=98guix graph=E2=80=99 lists every node. Thanks for your feedback! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/lint.scm b/guix/lint.scm index 82861b8a27..84ddfd6b73 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -41,6 +41,7 @@ #:use-module (guix upstream) #:use-module (guix utils) #:use-module (guix memoization) + #:use-module (guix profiles) #:use-module (guix scripts) #:use-module ((guix ui) #:select (texi->plain-text fill-paragraph)) #:use-module (guix gnu-maintenance) @@ -84,6 +85,7 @@ check-for-updates check-formatting check-archival + check-profile-collisions lint-warning lint-warning? @@ -970,6 +972,20 @@ descriptions maintained upstream." (with-store store (check-with-store store)))) +(define* (check-profile-collisions package #:key store) + (guard (c ((profile-collision-error? c) + (let ((first (profile-collision-error-entry c)) + (second (profile-collision-error-conflict c))) + (list (make-warning package + (G_ "collision between ~a@~a and ~a@~a") + (list (manifest-entry-name first) + (manifest-entry-version first) + (manifest-entry-name second) + (manifest-entry-version second))))))) + (check-for-collisions (packages->manifest (list package)) + (%current-system)) + '())) + (define (check-license package) "Warn about type errors of the 'license' field of PACKAGE." (match (package-license package) @@ -1349,6 +1365,11 @@ or a list thereof") (description "Report failure to compile a package to a derivation") (check check-derivation) (requires-store? #t)) + (lint-checker + (name 'profile-collisions) + (description "Report collisions that would occur due to propagated inputs") + (check check-profile-collisions) + (requires-store? #t)) (lint-checker (name 'patch-file-names) (description "Validate file names and availability of patches") diff --git a/guix/profiles.scm b/guix/profiles.scm index 25ff146bdf..56ef4c0b91 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -105,6 +105,7 @@ manifest-installed? manifest-matching-entries manifest-search-paths + check-for-collisions manifest-transaction manifest-transaction? diff --git a/guix/ui.scm b/guix/ui.scm index 98b30445c8..2595e44062 100644 --=-=-=--