Subject: bug#30395: ‘gcc’ doesn't compile with LD_LIBRARY_PATH="$HOME/.guix-profile/lib"

From: Mathieu Lirzin <[email-masked]>
Date: Sun, 18 Feb 2018 22:51:46 +0100

[email-masked] (Ludovic Courtès) writes:

> Mathieu Lirzin <[email-masked]> skribis:
>
>> [email-masked] (Ludovic Courtès) writes:
>>
>>> How come this ‘gconv-modules’ file doesn’t exist?  I have it here.
>>> I have:
>>>
>>> $ guix hash -r /gnu/store/5x9zxdmxphmprlchfl3a2y8w5ykcwkjc-glibc-2.25
>>> 03la0p9pigf6r33px5nckky9fxvrynvw1fgn9v2l04zlys7k3k2y
>>> $ wget -q -O - https://berlin.guixsd.org/5x9zxdmxphmprlchfl3a2y8w5ykcwkjc.narinfo | grep NarHash
>>> NarHash: sha256:03la0p9pigf6r33px5nckky9fxvrynvw1fgn9v2l04zlys7k3k2y
>>>
>>>
>>> What about you?
>>
>> $ guix hash -r /gnu/store/5x9zxdmxphmprlchfl3a2y8w5ykcwkjc-glibc-2.25
>> guix hash: error: lstat: Aucun fichier ou dossier de ce type: "/gnu/store/5x9zxdmxphmprlchfl3a2y8w5ykcwkjc-glibc-2.25"
>>
>> There is no corresponding store item, so it seems logical that the
>> ‘gconv-modules’ are not found.  :-) 
>
> Oh!  Now your mission, if you accept it, will be to find where that
> 5x9zxdmxphmprlchfl3a2y8w5ykcwkjc-glibc-2.25 comes from.

I am not clear regarding what to search for, so let me reason at loud.
The following command allows me to find the corresponding derivation:

  $ find /gnu/store -name '*.drv' -exec grep 5x9zxdmxphmprlchfl3a2y8w5ykcwkjc {} +
  → /gnu/store/xhg66izrd1ijnaqzk8zxrfn6i5lwgqdi-glibc-2.25.drv

Next to see what packages refers to this derivation I run this:

  $ guix gc --referrers /gnu/store/xhg66izrd1ijnaqzk8zxrfn6i5lwgqdi-glibc-2.25.drv
  → /gnu/store/1msbfj9jljqm3zj17fwq0gqzw4vww7h8-glibc-2.25.drv

This corresponds to 38kr8xi7nib8rx8xr4gi0w0d8knyca3k-glibc-2.25 found in
the following “bad” strace log:

--8<---------------cut here---------------start------------->8---
30147 open("/gnu/store/38kr8xi7nib8rx8xr4gi0w0d8knyca3k-glibc-2.25/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
30147 open("/gnu/store/5x9zxdmxphmprlchfl3a2y8w5ykcwkjc-glibc-2.25/lib/gconv/gconv-modules", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
--8<---------------cut here---------------end--------------->8---

IIUC 38kr8 is a grafted version of 5x9zx.  So what seems to happen is
that there is “something” found in “$HOME/.guix-profile/lib” by the
dynamic loader that contains a reference to '5x9zx' but should be
grafted to refer to '38kr8'.  Is that correct?

So the faulty package should be in the outputs corresponding to the
following list:

  $ guix gc --referrers /gnu/store/1msbfj9jljqm3zj17fwq0gqzw4vww7h8-glibc-2.25.drv
  /gnu/store/2mf7rkp0gs61gffip9k3vzxrqdin2nqw-xdg-mime-database.drv
  /gnu/store/64xh3mr0l597j2dwqsaw4y72563mg2n2-gtk-icon-themes.drv
  /gnu/store/7d6q1y1py9w6f5ikcq16nl147lw41vdm-ca-certificate-bundle.drv
  /gnu/store/8x4mx1vghdgfjcygq34h9160bcvanfd4-manual-database.drv
  /gnu/store/d53hf10ljmnavyhy08wxvd91lmkm04xg-gtk-icon-themes.drv
  /gnu/store/h0khj5wnfskjrw9r3cmp6rsk5ncj29ws-info-dir.drv
  /gnu/store/jamz10xa4hbglbqc49iyj3wp6fm7sq3b-gtk-im-modules.drv
  /gnu/store/lx64j3l2j53sav1gzi2flylm0lp5kvym-profile.drv
  /gnu/store/q28f7j4qn0fgsc5b51cq5jvpixnd1jrs-fonts-dir.drv
  /gnu/store/s01vvhbb2hz76fsch1js5g0p50vbk9y5-xdg-mime-database.drv
  /gnu/store/wdzl6xdrdvy196ia9n0mj7f5v5fiyl2r-xdg-desktop-database.drv

Would it possible to grep in the corresponding outputs?  For now I have
run tried in my profile without success:

$ grep -RU 5x9zxdmxphmprlchfl3a2y8w5ykcwkjc-glibc-2.25 $HOME/.guix-profile

> Perhaps what would help is to diff the “good” and the “bad” strace
> logs.

What would be your methodology?

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37