Collisions between identical files

I’m seeing warnings like this when I build my system:

collision between
`/nix/store/jr7iy1hb1rkrcijd2m8s65q6rjmgmksk-phonon-backend-gstreamer-qt5-4.9.0/share/icons/hicolor/128x128/apps/phonon-gstreamer.png'
and
`/nix/store/ybnyw6g90zfv9iafy6xf4wqjrjkk3005-phonon-backend-gstreamer-qt5-4.9.0/share/icons/hicolor/128x128/apps/phonon-gstreamer.png'

However, those files are identical:

$ diff -s /nix/store/jr7iy1hb1rkrcijd2m8s65q6rjmgmksk-phonon-backend-gstreamer-qt5-4.9.0/share/icons/hicolor/128x128/apps/phonon-gstreamer.png /nix/store/ybnyw6g90zfv9iafy6xf4wqjrjkk3005-phonon-backend-gstreamer-qt5-4.9.0/share/icons/hicolor/128x128/apps/phonon-gstreamer.png
Files /nix/store/jr7iy1hb1rkrcijd2m8s65q6rjmgmksk-phonon-backend-gstreamer-qt5-4.9.0/share/icons/hicolor/128x128/apps/phonon-gstreamer.png and /nix/store/ybnyw6g90zfv9iafy6xf4wqjrjkk3005-phonon-backend-gstreamer-qt5-4.9.0/share/icons/hicolor/128x128/apps/phonon-gstreamer.png are identical

So, I’m wondering what folks think about modifying pkgs/build-support/buildenv/builder.pl to compare the colliding files before reporting the collision? (It would remain silent if the files were identical.)

Of course this would be a mass-rebuild, so I wanted to float the idea here before trying to implement and test it.

1 Like

Might be useful and should be not too hard to implement.

So, I’m wondering what folks think about modifying pkgs/build-support/buildenv/builder.pl to compare the colliding files before reporting the collision? (It would remain silent if the files were identical.)

The code is even there: if ignoreCollisons is false but checkCollisionContents is true, it will only allow collisions with the same content. This is actually the default state.

I guess the logic behind the current settings is that if you only set ignoreCollisions to true, it leaves checkCollisionContents as true, but you don’t strictly need the relatively costly content check, so it doesn’t happen.

Yeah, collisions should be relatively rare, though, so I don’t think paying the expense of the content check is too bad.

Anyway, I opened warn differently about collisions of identical paths by jerith666 · Pull Request #41144 · NixOS/nixpkgs · GitHub for this – thanks for the quick feedback!