From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#19973: Grafts break debug outputs Date: Tue, 21 Aug 2018 22:53:57 +0200 Message-ID: <87pnybmoey.fsf@gnu.org> References: <878ufh71do.fsf@netris.org> <87a88wrbvk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsDkp-0001os-1o for bug-guix@gnu.org; Tue, 21 Aug 2018 16:59:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsDg6-000892-IH for bug-guix@gnu.org; Tue, 21 Aug 2018 16:55:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:52038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fsDg6-00088A-2v for bug-guix@gnu.org; Tue, 21 Aug 2018 16:55:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fsDg6-0002rK-1J for bug-guix@gnu.org; Tue, 21 Aug 2018 16:55:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87a88wrbvk.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 07 Mar 2017 22:54:39 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Mark H Weaver Cc: 19973@debbugs.gnu.org Hello! ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > 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.). The patches below address this by adding code to update the CRC in the =E2=80=98.gnu_debuglink=E2=80=99 section upon grafting. It uses a simple h= ook mechanism, a simplified version of what Timothy proposed. The =E2=80=98.gnu_debuglink=E2=80=99 hook does nothing for packages that la= ck a =E2=80=9Cdebug=E2=80=9D output. For packages that have a =E2=80=9Cdebug=E2=80=9D output, only ELF = files from bin/, lib/, etc. are considered. Overall the run-time cost should be low. I tested it with guile-ssh on current master (commit bab4dc58f7278e481c7eb8c6f954d6f1751deb23). When running: guix build guile-ssh you see messages like this: updating '.gnu_debuglink' CRC in '/gnu/store/523lgdnmr4x0q7cnn8wr7f2zzcnl= vrpp-guile-ssh-0.11.3/lib/guile/2.2/site-ccache/ssh/tunnel.go' updating '.gnu_debuglink' CRC in '/gnu/store/523lgdnmr4x0q7cnn8wr7f2zzcnl= vrpp-guile-ssh-0.11.3/lib/guile/2.2/site-ccache/ssh/version.go' updating '.gnu_debuglink' CRC in '/gnu/store/523lgdnmr4x0q7cnn8wr7f2zzcnl= vrpp-guile-ssh-0.11.3/lib/libguile-ssh.so.11.0.0' The thing about .go files isn=E2=80=99t very useful (the =E2=80=98strip=E2= =80=99 phase should ignore them in the first place probably). However I=E2=80=99ve confirmed t= hat gdb is happy with the grafted libguile-ssh.so: if you add breakpoints with =E2=80=9Crb guile_ssh=E2=80=9D and then call one of the guile-ssh proc= edures from the REPL, you see that you get proper debugging info and all (don=E2=80=99t forget to =E2=80=9Cset debug-file-directory=E2=80=9D upfront.) That=E2=80=99s it! It=E2=80=99s a relief to fix a 3-year old bug. :-) Next we can fix build IDs similarly (see ), and maybe the Racket CRC issue that Timothy and Chris looked at recently, and maybe the Java manifest issue as well (is it still relevant?). Thanks, Ludo=E2=80=99.