From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uAXzK8KbWWIKFAEAgWs5BA (envelope-from ) for ; Fri, 15 Apr 2022 18:22:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AL2mKMKbWWKu2AAAauVa8A (envelope-from ) for ; Fri, 15 Apr 2022 18:22:26 +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 52AA413E3A for ; Fri, 15 Apr 2022 18:22:23 +0200 (CEST) Received: from localhost ([::1]:43234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfOiB-0006Ai-6O for larch@yhetil.org; Fri, 15 Apr 2022 12:22:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfOhv-0006Aa-7u for bug-guix@gnu.org; Fri, 15 Apr 2022 12:22:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nfOhu-0005oU-To for bug-guix@gnu.org; Fri, 15 Apr 2022 12:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nfOhu-0002cN-Gv for bug-guix@gnu.org; Fri, 15 Apr 2022 12:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#54728: [PATCH 2/2] gnu: valgrind: fix ld.so symbols not found Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 15 Apr 2022 16:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54728 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Denis 'GNUtoo' Carikli Received: via spool by 54728-submit@debbugs.gnu.org id=B54728.165003970410033 (code B ref 54728); Fri, 15 Apr 2022 16:22:02 +0000 Received: (at 54728) by debbugs.gnu.org; 15 Apr 2022 16:21:44 +0000 Received: from localhost ([127.0.0.1]:60172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfOhc-0002bl-HO for submit@debbugs.gnu.org; Fri, 15 Apr 2022 12:21:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfOhZ-0002bR-Kj for 54728@debbugs.gnu.org; Fri, 15 Apr 2022 12:21:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfOhT-0005hp-VC; Fri, 15 Apr 2022 12:21:35 -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=jF2C2MoEd5W52aB9xLof0cALg4HWvRz3cgWHRJT+wqM=; b=oltnfzwhvwGv8kwexHi/ 2h+hc63A+aHKEsCYho1m9dEcIc4jlHHMlK59v5S8OD4YoT54chF9AiBME8BSahJYcfdrnqPbdoW2P GTmXl/DSGO4lTLHkBL9FeNay6mCmoO1Z2lIjUVuvPZms7qrzqJuqIDYonLR60kqfJg77ohWeD8GUD pIsOu99yTns0etTaLb9b0ZwkWEakQK8MUSKP1jEmgcog3njmWgUDfNaqeW26MQ63Jsur113kAuzZ3 Sv6EwZJmgN6mHRdurW/glpLvxQ3IQOCkwOqiaedsiFhWYvTjih0KCa+Gt1qflWX5tYRA0zWI/knxy dYSFIWTDJNBy4w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55935 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfOhT-0001Pz-IR; Fri, 15 Apr 2022 12:21:35 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220415012611.6edbf92c@primarylaptop.localdomain> <20220414233012.13243-1-GNUtoo@cyberdimension.org> <20220414233012.13243-2-GNUtoo@cyberdimension.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 Germinal an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 15 Apr 2022 18:21:33 +0200 In-Reply-To: <20220414233012.13243-2-GNUtoo@cyberdimension.org> (Denis Carikli's message of "Fri, 15 Apr 2022 01:30:12 +0200") Message-ID: <87czhi48s2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Cc: 54728@debbugs.gnu.org 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=1650039743; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: 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=jF2C2MoEd5W52aB9xLof0cALg4HWvRz3cgWHRJT+wqM=; b=jeP/VxS9yTOyL+Mn5duqm4awOq4U4crZM3M3kpUXilyNCD9A6yU04bwI+lKFEkg444jNAU 3F9OAJTIsm6Zve2euq68YzUyVPlPyimDqGTK0fXezKMwkAHgU/9NA16ga+ODD3yWuUmsbu lpH0vmUBCX+POLLNbpMwaNXDI49Yfo5s/lBk3TPQImQh2jQ9Bc8hi8LxgjSIiuBPx+d31o WPW6kw7W+lG4Tn+EFIVdxIlAx/OSLszn1rWeFjtL1wK4zdpVVG5jju5mSFSC4/gwL+SyEu S8hI66vh3YUnsMrthgLMdPJJ/YvckIt/bsJl0oCWt6VJJoJFjU2UvM2r5hEFMg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650039743; a=rsa-sha256; cv=none; b=rrw4LjpvvFTIvsw6Z1ZBtWBsXTuktNd8lIOwQ9aVxaosyRvMjVEMKuhL9gmSnnxS1vxr6A 9UdwgYmVjSMo2FntMngcX8F0NieZIY4no0Wcp8tpZ/3++73JYFu1gCX9bp6CfBGFTtrp78 9irRighC1/g8tEepPQt23cAGbKsoludGw1g87E/MOetn8se1QGmHf32+Z7QIUYce5fEgQ1 C6bgJ39634Edr/B/o3sGSQNjfvmP1i78Nqozrb0SjbdK0RxUGLo4n7ww9Daa/FjDB6kpuA /4g8JqDWXoycyyaJV5lERURulvxlbVeheGrNB+O5Pds6Ah4g4AeltPEh8Fu0WQ== 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=oltnfzwh; 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: -2.74 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=oltnfzwh; 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: 52AA413E3A X-Spam-Score: -2.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: L+0asb1+ZTwP Hello! Denis 'GNUtoo' Carikli skribis: > (define-public valgrind/interactive > - (package/inherit > - valgrind > - (inputs > - ;; GDB is needed to provide a sane default for `--db-command'. > - `(("gdb" ,gdb))) > - (properties '()))) > + (package/inherit valgrind > + (inputs > + ;; GDB is needed to provide a sane default for `--db-command'. > + `(("gdb" ,gdb) > + ("libc:debug" ,(@@ (gnu packages commencement) glibc-final) "debu= g"))) Rather: ("libc: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 'build '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") > + (("/usr/lib/debug") > + (string-append > + (assoc-ref %build-inputs "libc:debug") > + "/lib/debug"))) > + ;; We also need to account for the bigger path in > + ;; the malloc-ed variables > + (substitute* ' > + ("coregrind/m_debuginfo/readelf.c") > + (("VG_\\(strlen\\)\\(buildid\\) \\+ 33") > + (string-append > + "VG_(strlen)(buildid) + " > + (number->string > + (+ (string-length > + (string-append > + (assoc-ref %build-inputs "libc:debug") > + "/lib/debug")) > + (string-length "/.build-id//.debug") > + 1))))) > + (substitute* ' > + ("coregrind/m_debuginfo/readelf.c") > + ((string-append > + "VG_\\(strlen\\)\\(objdir\\) \\+ " > + "VG_\\(strlen\\)\\(debugname\\) \\+ 64") > + (string-append > + "VG_(strlen)(objdir) + VG_(strlen)(debugname) + " > + (number->string > + (+ (string-length > + (string-append > + (assoc-ref > + %build-inputs > + "libc:debug") > + "/lib/debug")) > + (string-length > + "/usr/lib/debug") > + 1))))) I find this patch-as-code snippet rather difficult to follow; it might also break easily if minor things change in those C files. How about making it an actual patch? In the patch, you=E2=80=99d have placeholders for the store file names, like @LIBC_DEBUG_DIRECTORY@; the phase would replace those placeholders with =E2=80=98substitute*=E2=80=99. How does that sound? Thanks, Ludo=E2=80=99.