Subject: bug#31458: closed (Re: [bug#31458] [PATCH] union: Do not warn about harmless collissions.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 17 May 2018 08:51:02 +0000

Your bug report

#31458: [PATCH] union: Do not warn about harmless collissions.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
31458: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31458
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#31458] [PATCH] union: Do not warn about harmless collissions.
From: [email-masked] (Ludovic Courtès)
To: Danny Milosavljevic <[email-masked]>
Cc: [email-masked]
Date: Thu, 17 May 2018 10:50:45 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Danny,

Danny Milosavljevic <[email-masked]> skribis:

> On Wed, 16 May 2018 10:57:57 +0200
> [email-masked] (Ludovic Courtès) wrote:

[...]

>> > Shouldn't there be a profile hook for it instead?  There doesn't seem to be one.  
>> 
>> Maybe, yes, though I’m not sure how that’d work (and would it be fast
>> enough?).
>
> I wrote one in bug 31462.  Seems to be quite fast.  But let's think about whether
> we want it, and whether we want it in addition to the wrapper.
>
> (libreoffice works with it now FWIW)

Awesome!

>> This seems to be orthogonal to this patch, though: we can remove the
>> collision warnings for these files today, because there’s nothing users
>> can do about them and they’re effectively harmless, and later on, if we
>> have better gschemas.compiled handling, we can always let them through
>> again.
>
> Yeah, I just wanted to make sure we are not hiding them if they are the only
> indication that something will break horribly with the program.
> (see libreoffice)

Sure, that makes sense.  In this particular case the gschemas.compiled
collision did not tell us much: some applications (e.g., Evince) would
work fine because they used glib-or-gtk-build-system, while others
(e.g., LibreOffice) would fail.

> But since the wrapper needs gschemas.compiled, we can't use it as indicator
> for missing-glib-or-gtk-build-system anyway, so:
>
> LGTM!

Alright, committed!  :-)

Thank you,
Ludo’.

Subject: [PATCH] union: Do not warn about harmless collissions.
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Cc: Ludovic Courtès <[email-masked]>
Date: Tue, 15 May 2018 10:31:19 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Until now we'd get pointless messages like:

  warning: collision encountered:
    /gnu/store/…-gtk-icon-themes/share/icons/hicolor/icon-theme.cache
    /gnu/store/…-inkscape-0.92.3/share/icons/hicolor/icon-theme.cache
  warning: choosing /gnu/store/…-gtk-icon-themes/share/icons/hicolor/icon-theme.cache

* guix/build/union.scm (%harmless-collisions): New variable.
(warn-about-collision): Honor it.
---
 guix/build/union.scm | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/guix/build/union.scm b/guix/build/union.scm
index 24b366af4..fff795c4d 100644
--- a/guix/build/union.scm
+++ b/guix/build/union.scm
@@ -81,14 +81,23 @@ identical, #f otherwise."
                                    (or (eof-object? n1)
                                        (loop))))))))))))))
 
+(define %harmless-collisions
+  ;; This is a list of files that are known to collide, but for which emitting
+  ;; a warning doesn't make sense.  For example, "icon-theme.cache" is
+  ;; regenerated by a profile hook which shadows the file provided by
+  ;; individual packages, and "gschemas.compiled" is made available to
+  ;; applications via 'glib-or-gtk-build-system'.
+  '("icon-theme.cache" "gschemas.compiled"))
+
 (define (warn-about-collision files)
   "Handle the collision among FILES by emitting a warning and choosing the
 first one of THEM."
-  (format (current-error-port)
-          "~%warning: collision encountered:~%~{  ~a~%~}"
-          files)
   (let ((file (first files)))
-    (format (current-error-port) "warning: choosing ~a~%" file)
+    (unless (member (basename file) %harmless-collisions)
+      (format (current-error-port)
+              "~%warning: collision encountered:~%~{  ~a~%~}"
+              files)
+      (format (current-error-port) "warning: choosing ~a~%" file))
     file))
 
 (define* (union-build output inputs
-- 
2.17.0