Subject: Re: bug#19973: Grafts break debug outputs

From: [email-masked] (Ludovic Courtès)
Date: Tue, 07 Mar 2017 22:54:39 +0100

Mark H Weaver <[email-masked]> skribis:

> mhw@jojen:~$ guix build guile
> guix build: warning: ambiguous package specification `guile'
> guix build: warning: choosing guile-2.0.11 from gnu/packages/guile.scm:110:2
> /gnu/store/3lhr8q28q6f59774di9av7ncy09jd55d-guile-2.0.11
> /gnu/store/rgv3fvy6xqp6966rfh8v6fv7m48abcbh-guile-2.0.11-debug
> mhw@jojen:~$ guix package -I guile
> guile	2.0.11	out	/gnu/store/3lhr8q28q6f59774di9av7ncy09jd55d-guile-2.0.11
> guile	2.0.11	debug	/gnu/store/rgv3fvy6xqp6966rfh8v6fv7m48abcbh-guile-2.0.11-debug
> mhw@jojen:~$ ls -l .guix-profile/lib/debug/gnu/store/
> total 8
> lrwxrwxrwx 12 root guixbuild 128 Dec 31  1969 122jv790mv2mlnylbrbzav65vghbw93n-guile-2.0.11 -> /gnu/store/rgv3fvy6xqp6966rfh8v6fv7m48abcbh-guile-2.0.11-debug/lib/debug/gnu/store/122jv790mv2mlnylbrbzav65vghbw93n-guile-2.0.11
> lrwxrwxrwx 15 root guixbuild 127 Dec 31  1969 3g20rdmnavpblsmgppyl8jhg67nidhjk-glibc-2.20 -> /gnu/store/hrny2whqg9c3m0klyfpbmmcyiir9yf8m-gcc-toolchain-4.9.2/lib/debug/gnu/store/3g20rdmnavpblsmgppyl8jhg67nidhjk-glibc-2.20
>
> I guess GDB can't find the debugging information because
> 122jv790mv2mlnylbrbzav65vghbw93n-guile-2.0.11 is the name of the guile
> directory *before* grafting.

I wonder if the problem you described here still exists today.

However, one very likely problem is that .debug files include a CRC of
the binary they correspond to (info "(gdb) Separate Debug Files"), and
that CRC is not updated when we graft things.

We could change our grafting code to specifically address this problem
(using (guix elf) & co.).

Similar issue with build IDs: <https://bugs.gnu.org/25752>.

Ludo’.