From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id gLVANBPeeGK6ZAEAbAwnHQ (envelope-from ) for ; Mon, 09 May 2022 11:25:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qJr3MxPeeGLhGgEAauVa8A (envelope-from ) for ; Mon, 09 May 2022 11:25:39 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 45F953D29F for ; Mon, 9 May 2022 11:25:39 +0200 (CEST) Received: from localhost ([::1]:60252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnze5-0004n9-Rk for larch@yhetil.org; Mon, 09 May 2022 05:25:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnzdX-0004lY-6u for bug-guix@gnu.org; Mon, 09 May 2022 05:25:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnzdW-0000gj-TV for bug-guix@gnu.org; Mon, 09 May 2022 05:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnzdW-0008M9-Q4 for bug-guix@gnu.org; Mon, 09 May 2022 05:25:02 -0400 Subject: bug#54728: Valgrind not working out of the box due to stripped ld.so Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Date: Mon, 09 May 2022 09:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 54728 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Denis 'GNUtoo' Carikli Cc: 54728-done@debbugs.gnu.org, maximedevos@telenet.be Mail-Followup-To: 54728@debbugs.gnu.org, ludo@gnu.org, GNUtoo@cyberdimension.org Received: via spool by 54728-done@debbugs.gnu.org id=D54728.165208829432097 (code D ref 54728); Mon, 09 May 2022 09:25:02 +0000 Received: (at 54728-done) by debbugs.gnu.org; 9 May 2022 09:24:54 +0000 Received: from localhost ([127.0.0.1]:56054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnzdO-0008Lc-3Z for submit@debbugs.gnu.org; Mon, 09 May 2022 05:24:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnzdM-0008LQ-8Q for 54728-done@debbugs.gnu.org; Mon, 09 May 2022 05:24:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnzdG-0000eJ-Fm; Mon, 09 May 2022 05:24:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=LdSs3hlsS4s2CapCb+tCqKwtzoUOoPuZhz37QFWpyJA=; b=TfEERsVdVm/una84upgn as3Y3RTAq+8va1atu2ltCfbdIdpBV08ENvAHYVfpk2IGVg8lGOOstp0gYcbSQYXFCVm10bduZPEzM KWeGz79ct5qBOM/PGHwL0OtI2ieSOSflY0IsaP50le+v8Vs3NR7l+EahmdzOtIXgs3KfbEgWsbkxM hLFfXqLtRK3Vw8qc7NBwCy3vAdbfKV43vBBeuMPFkrIInhNHDPCO+DCYr6EdRf74aQCnwYKql+18X oytxT1Yq8B1em8RpGeUUe73S00/ZPo5ZKQW7J/EZPgCC3gA9bO+ZSwNnlwfTUtuEmQwLpHwNlvTZu 8RKaRZt8ErxlsQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=44914 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnzdG-0007HF-2j; Mon, 09 May 2022 05:24:46 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <2d69d3b032cea71f038fad9bacd7d060d323c110.camel@telenet.be> <20220426013913.20117-1-GNUtoo@cyberdimension.org> <20220426013913.20117-3-GNUtoo@cyberdimension.org> Date: Mon, 09 May 2022 11:24:44 +0200 In-Reply-To: <20220426013913.20117-3-GNUtoo@cyberdimension.org> (Denis Carikli's message of "Tue, 26 Apr 2022 03:39:13 +0200") Message-ID: <87czgnrrc3.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652088339; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-to:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=LdSs3hlsS4s2CapCb+tCqKwtzoUOoPuZhz37QFWpyJA=; b=atICk1O7TrJn8VttR5qoXiDFrMwmrM/OBHSsfSCBjfAHuGHBb6PLrOvHcYOg8q5cAAGFLK fMpGOJMWfbz3BcpRn0tKt5iT7IGeRAMVsqVk5+RYiVBDKSDfLiUYOd0Xk5yYRXstr2Ure6 +N3WLHWp/ZMjmU4F303tSc+OqPG8xmJy0E1/amjCFVcEt1kWH8GPH/3lZEbeN7oQ/O8N31 HrWwWYEDV03cHZAoblJntVkhRAhquOfIjuh4HI/8u5/2ZlfwGtBpySBH6erCbaBlBhfo9t u4PEHWTu8iUkiZwFEaQwRtZatexqLlkp4wPrdgEiF5qr+L2giYbiYQYi05pzdw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652088339; a=rsa-sha256; cv=none; b=B1QhhaQrLAbOs4S1Pp8zQFetEAxwPI2QE6zgpXNdMTmEC4hEm2490YUxtLJvarjcl8v4S1 3ctCFttSCwx/EiQsoQ+BTvZWMnW/xXSJgLLA1tlqv2aZB+OP3I7SCenPYjDs2ZPrbtzEdl OKeSSZcdG1FKUGcQr+A62dfibgOulu5B/U/1t6lkOMDOFEiEoTmis/YQ+Zh+doCFGPzk46 Z/CDyIoZBDyex05TDacWhur7EvI1te8ZQoZVYem2660nZZhI3OgPGCCcumsIsbQQriNloc H2ZBfhG5uuktAMPD5SqUGSPtxxbIl2e7POburYOElWDlaU5ihFuX0VBhjoweeQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=TfEERsVd; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=TfEERsVd; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 45F953D29F X-Spam-Score: -3.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: dOgDEfFhx4DJ --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Denis, Denis 'GNUtoo' Carikli skribis: > * gnu/packages/valgrind.scm (valgrind/interactive)[native-inputs]: > Add libc:debug > [arguments]: Add patch-default-debuginfo-path phase > [source]: Add patch. > (valgrind-3.18)[source]: Add patch. > > * gnu/packages/commencement.scm (glibc-final): Export variable. > > Signed-off-by: Denis 'GNUtoo' Carikli I had lost track of it, so thanks for pinging. I=E2=80=99ve applied it and confirmed it works. I made the following cosme= tic changes (patch below): =E2=80=A2 removing the =E2=80=98glibc-final=E2=80=99 export, which is unn= ecessary; =E2=80=A2 in phases, refer to the =E2=80=98inputs=E2=80=99 parameter rath= er than the =E2=80=98%build-inputs=E2=80=99 global variable (which is deprecated); =E2=80=A2 avoid repetition of (string-append (assoc-ref =E2=80=A6) "/lib/= debug"); =E2=80=A2 tweak indentation. Thanks! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/valgrind.scm b/gnu/packages/valgrind.scm index 1269e07593..0da011087c 100644 --- a/gnu/packages/valgrind.scm +++ b/gnu/packages/valgrind.scm @@ -95,83 +95,71 @@ (define-public valgrind (define-public valgrind/interactive (package/inherit - valgrind - (version "3.17.0") - (source (origin - (method url-fetch) - (uri (list (string-append "https://sourceware.org/pub/valgrind" - "/valgrind-" version ".tar.bz2") - (string-append "ftp://sourceware.org/pub/valgrind" - "/valgrind-" version ".tar.bz2"))) - (sha256 - (base32 - "18l5jbk301j3462gipqn9bkfx44mdmwn0pwr73r40gl1irkfqfmd")) - (patches (search-patches - "valgrind-enable-arm.patch" - "valgrind-fix-default-debuginfo-path.patch")))) - (inputs - ;; GDB is needed to provide a sane default for `--db-command'. - `(("gdb" ,gdb) - ("glibc:debug" ,(canonical-package glibc) "debug"))) - (arguments + valgrind + (version "3.17.0") + (source (origin + (method url-fetch) + (uri (list (string-append "https://sourceware.org/pub/valgrind" + "/valgrind-" version ".tar.bz2") + (string-append "ftp://sourceware.org/pub/valgrind" + "/valgrind-" version ".tar.bz2"))) + (sha256 + (base32 + "18l5jbk301j3462gipqn9bkfx44mdmwn0pwr73r40gl1irkfqfmd")) + (patches (search-patches + "valgrind-enable-arm.patch" + "valgrind-fix-default-debuginfo-path.patch")))) + (inputs + ;; GDB is needed to provide a sane default for `--db-command'. + `(("gdb" ,gdb) + ("glibc:debug" ,(canonical-package glibc) "debug"))) + (arguments (substitute-keyword-arguments (package-arguments valgrind) - ((#:phases those-phases #~%standard-phases) - #~(let* ((those-phases #$those-phases) - (unpack (assoc-ref those-phases 'unpack))) - (modify-phases - those-phases - (add-before 'configure 'patch-default-debuginfo-path - (lambda _ - ;; This helps Valgrind find the debug symbols of ld.so. - ;; Without it, Valgrind does not work in a Guix shell - ;; container and cannot be used as-is during packages tests - ;; phases - (substitute* ' - ("coregrind/m_debuginfo/readelf.c" - "docs/xml/manual-core-adv.xml" - "docs/xml/manual-core.xml") - (("DEFAULT_DEBUGINFO_PATH") - (string-append (assoc-ref %build-inputs "glibc:debug") - "/lib/debug"))) - ;; We also need to account for the bigger path in - ;; the malloc-ed variables - (substitute* ' - ("coregrind/m_debuginfo/readelf.c") - (("DEBUGPATH_EXTRA_BYTES_1") - (number->string - (+ (string-length - (string-append - (assoc-ref %build-inputs "glibc:debug") - "/lib/debug")) - (string-length "/.build-id//.debug") - 1)))) - (substitute* ' - ("coregrind/m_debuginfo/readelf.c") - (("DEBUGPATH_EXTRA_BYTES_2") - (number->string - (+ (string-length - (string-append - (assoc-ref - %build-inputs - "glibc:debug") - "/lib/debug")) - (string-length - "/usr/lib/debug") - 1))))))))))) - (properties '()))) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-before 'configure 'patch-default-debuginfo-path + (lambda* (#:key inputs #:allow-other-keys) + ;; This helps Valgrind find the debug symbols of ld.so. + ;; Without it, Valgrind does not work in a Guix shell + ;; container and cannot be used as-is during packages tests + ;; phases. + ;; TODO: Remove on the next rebuild cycle, when libc is not + ;; longer fully stripped. + (define libc-debug + (string-append (assoc-ref inputs "glibc:debug") + "/lib/debug")) + + (substitute* '("coregrind/m_debuginfo/readelf.c" + "docs/xml/manual-core-adv.xml" + "docs/xml/manual-core.xml") + (("DEFAULT_DEBUGINFO_PATH") + libc-debug)) + ;; We also need to account for the bigger path in + ;; the malloc-ed variables. + (substitute* '("coregrind/m_debuginfo/readelf.c") + (("DEBUGPATH_EXTRA_BYTES_1") + (number->string + (+ (string-length libc-debug) + (string-length "/.build-id//.debug") + 1)))) + (substitute* '("coregrind/m_debuginfo/readelf.c") + (("DEBUGPATH_EXTRA_BYTES_2") + (number->string + (+ (string-length libc-debug) + (string-length "/usr/lib/debug") + 1)))))))))) + (properties '()))) (define-public valgrind-3.18 (package (inherit valgrind/interactive) (version "3.18.1") (source (origin - (method url-fetch) + (inherit (package-source valgrind/interactive)) (uri (list (string-append "https://sourceware.org/pub/valgrind" "/valgrind-" version ".tar.bz2") (string-append "ftp://sourceware.org/pub/valgrind" "/valgrind-" version ".tar.bz2"))) (sha256 (base32 - "1xgph509i6adv9w2glviw3xrmlz0dssg8992hbvxsbkp7ahrm180")) - (patches (search-patches "valgrind-enable-arm.patch" - "valgrind-fix-default-debuginfo-path.patch")))))) + "1xgph509i6adv9w2glviw3xrmlz0dssg8992hbvxsbkp7ahrm180")))))) --=-=-=--