From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ALTmKDVygGBcOwEAgWs5BA (envelope-from ) for ; Wed, 21 Apr 2021 20:43:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mIl9JDVygGDYCgAAbx9fmQ (envelope-from ) for ; Wed, 21 Apr 2021 18:43:01 +0000 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 24E2E1D61E for ; Wed, 21 Apr 2021 20:43:01 +0200 (CEST) Received: from localhost ([::1]:34134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZHoR-000699-QN for larch@yhetil.org; Wed, 21 Apr 2021 14:42:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZHgk-0005x6-EN for guix-patches@gnu.org; Wed, 21 Apr 2021 14:35:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48234) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZHgk-0002uX-5R for guix-patches@gnu.org; Wed, 21 Apr 2021 14:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZHgk-0005CX-2o for guix-patches@gnu.org; Wed, 21 Apr 2021 14:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47921] [PATCH] build: Fix elf-dynamic-info-soname. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Apr 2021 18:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47921 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Dion Mendel , 47921@debbugs.gnu.org Received: via spool by 47921-submit@debbugs.gnu.org id=B47921.161903005619935 (code B ref 47921); Wed, 21 Apr 2021 18:35:02 +0000 Received: (at 47921) by debbugs.gnu.org; 21 Apr 2021 18:34:16 +0000 Received: from localhost ([127.0.0.1]:59780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZHg0-0005BT-AV for submit@debbugs.gnu.org; Wed, 21 Apr 2021 14:34:16 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:50918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZHfx-0005BJ-FA for 47921@debbugs.gnu.org; Wed, 21 Apr 2021 14:34:14 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by baptiste.telenet-ops.be with bizsmtp id vWaA2400a0mfAB401WaBiK; Wed, 21 Apr 2021 20:34:11 +0200 Message-ID: <92c4f265369735c71c6f358cfee29fb7cc6a38d2.camel@telenet.be> From: Maxime Devos Date: Wed, 21 Apr 2021 20:33:57 +0200 In-Reply-To: <20210421154612.GA956@dm9.info> References: <20210420194429.GB29387@dm9.info> <76bb70d22fed27efd4a15308abdd9e95fb1aa929.camel@telenet.be> <20210421154612.GA956@dm9.info> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-iea5yQ7SNz67mT0nsNvX" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1619030051; bh=FW22FJQ+OTvdkeLlgBAJnVgvN/62EINWMIl1aq9I4zg=; h=Subject:From:To:Date:In-Reply-To:References; b=IPkomk0vRH1sKJQ88JHLQ0hUD3b/0+cA8mG+/kRfWXUAbHedbEwLSyN9SJIwiCPAh vRPqt0VP03I+6PPWbnpeHz6f1eN6F37LMtxfGNqpH0So5C8fUFYKmab3i2tDA1Drnn 3O8EbZfutjbYQjWKh9lJETwt5L+IReRiizfVY6jNQECl6YYn2+DGU0PXEGYVTdrv9w eyQaPQ7gZMb5rcaQU5i3gYJxPI1jwcb406wjCPgMFAO4g+VVVNsBHGW4uE+l4mdHn9 36FlskDVAkLHbmiyD2/S+oh//zivl1gYuoLm/iDgnysERiHrm6DI2S/8J+RvWZ+nKt BbYkkd1Xrp4Vw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619030581; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: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=FW22FJQ+OTvdkeLlgBAJnVgvN/62EINWMIl1aq9I4zg=; b=W9umClIqbH5wg8hMskBYcJaeyVZaLtA6O8t0Adq6KVqMdy6zSnBkNP0fIU2qK52w5PzvQ2 wlDjJ/5LsoGHwIIbcqAIwDNu3o8ylv7bHPG4Tv1+ycAFA2rw+3mW2+sCyrRRzbSKwPi5fb RWIlz+s5/6+j0veKFRn6Yhb1Ee7dFYcpwhwdXCYYIQd34LHpZB3CsU8HJ5USG4o01AVIv/ iJjikSsrshwZ4W+rq/AcQmlB7sbUVpVnj3KJrZgEtvX5h3A30lAZibVgbIryQFum9kFzca ixCX2lUHteNz5y7hYyKdr5j5YXpR/xq55wx03Scal5eKmO+C2/YmtY6q0TmwMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619030581; a=rsa-sha256; cv=none; b=NowA9orYkh6Bsw/cYIryvzD2raRKLvRSSbTFXqToNXdfyibPNYKYCLaouBvq+Q4neIFUnz 4J+l+CzNG6Uos/Lr+gRJpJYF1ouXWg6n3LilcyVSyrvImRPCyKzz2nkQrCMWkm5kxb9CC7 AWURJoX8wqKiLcl1lKrvHc80IDMsfQVncghFDmY9eyC5ySxj5yJDSmlgDlksWFpZj+q0hR 4i2euiPSPzLVgw3rHLTptItLalGtEC3COKVwKix+ZL5MMSbWEq4SSTAkWAKfbsDgOj9QYK 8PIjUUfs0snkNpmXy75N5rDJ6iJCgknnAOo8+GCoyB5nBrwSXOpJ+cyqn1bpUw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=IPkomk0v; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=IPkomk0v; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 24E2E1D61E X-Spam-Score: -3.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: LW4/9ka0T5T7 --=-iea5yQ7SNz67mT0nsNvX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dion Mendel schreef op wo 21-04-2021 om 23:46 [+0800]: > Thanks for the follow up. >=20 > > 1. IIUC, this change would cause a world-rebuild, so this patch would= =20 > > have to applied on core-updates. The subject line should have been > > [PATCH core-updates]: etcetera. >=20 > Are you sure? This patch will modify guix. >=20 > guix graph --type=3Dreverse-package guix > > Only shows a few packages to be rebuilt. I am new to guix so I may be= =20 > wrong about this. If this patch modified something in, say, guix/scripts or gnu/packages, targetting "master" should be perfectly fine. But this patch modifies something under guix/build. Modules under guix/build can be used from the build environment, that is, from within the compilation process of a package. By modifying guix/build/gremlin.scm, a widely-used module in package definitions (used indirectly via gnu-build-system IIRC), practically all packages would be rebuilt. Unless I'm severely mistaken, you can see this for yourself by: 0. start from a checkout of guix *without* your patch 1. # you probably have its dependencies already, but let's make sure ./pre-inst-env guix build hello 2. apply your patch to your local checkout of guix 3. make 4. ./pre-inst-env guix build hello # This will probably rebuild GCC, binutils, etc.! > 2. How did you test this patch? >=20 > Tested in the repl. >=20 > Current behaviour: >=20 > (elf-dynamic-info-soname > (call-with-input-file "/path/to/libz.so.1.2.11" > (compose elf-dynamic-info parse-elf > get-bytevector-all))) > =3D> #< type: 14 value: "libz.so.1" offset: 5764> >=20 > There is no way to extract the value as dynamic-entry is private to the= =20 > module. >=20 > After the patch: >=20 > (elf-dynamic-info-soname > (call-with-input-file "/path/to/libz.so.1.2.11" > (compose elf-dynamic-info parse-elf > get-bytevector-all))) > =3D> "libz.so.1" So you didn't try to build any package with this patch? I would recommend to make sure this patch doesn't break any packages. While you can't test all packages (unless you have a *really big* build farm), I would at least suggest running "./pre-inst-env guix build hello". If that takes too long to complete, don't worry, just interrupt it and let us now you couldn't test it completely. To make sure this new functionality does not break in the future, please write an unit test (in tests/gremlin.scm). > > 3. What does this patch fix? >=20 > Module (guix build gremlin) exports several functions to extract=20 > information from the dynamic section of an elf file. >=20 > elf-dynamic-info-soname is one of these functions. It is not called=20 > anywhere in guix. I would like to use it for packaging, but it is=20 > currently non functioning. Your patch doesn't modify elf-dynamic-info-soname. It modifies elf-dynamic= -info. > > 4. elf-dynamic-info-soname is a record accessor. Did you mean=20 > > elf-dynamic-info? In case I wasn't clear, I was referring to the commit message. In the comm= it message, you say you modified elf-dynamic-info-soname, but you actually mod= ified elf-dynamic-info. =20 > No, I do not mean elf-dynamic-info. See two comments above. > elf-dynamic-info-soname is a record accessor which is currently broken= =20 Record accessors are correct by construction. Perhaps you meant that the "soname" field is initialised incorrectly by elf-dynamic-info? > because it doesn't unwrap an internal structure, namely . = =20 > All the other accessors unwrap this internal structure. I think you can predict my response about accessors here (-:. I'll interpret this as =E2=80=98in all other fields, the internal structure= is unwrapped=E2=80=99. That's a good point! Your patch seems good to me, but the commit message d= oesn't and it has a lack of testing. > This patch brings this accessor into line with the others. You didn't modify the elf-dynamic-info-soname, you modified elf-dynamic-inf= o. See comments above. > > 5. According to the docstring (core-updates, c9a61dff8242612ae8275829a5= ee31ff45ff08b1): > >=20 > > "Return dynamic-link information for ELF as an obje= ct, or > > #f if ELF lacks dynamic-link information." > >=20 > > So this patch actually _introduces_ a bug. Or you need to modify the = docstring > > as well. On second thought, the (revised) patch actually seems correct, and my comme= nt here doesn't make much sense. > No. This patch does not affect elf-dynamic-info. It fixes one of its= =20 > accessors. You modified elf-dynamic-info, so this patch does affect it. elf-dynamic-info is a procedure, so it cannot have any accessors (unless yo= u play weird tricks with Guile's undocumented =E2=80=98applicable structs=E2=80=99= ). The record is . !=3D elf-dynamic-info. Greetings, Maxime. --=-iea5yQ7SNz67mT0nsNvX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYIBwFxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pa3AP0eO1dvfn0dRTqTiWeQYeNbjnHo uojs3GcmouqOm174KQD7BKZGhwJvRAQS2F8rtpY9T8fgmWxBb+CrPMfJqxt6GQY= =E43E -----END PGP SIGNATURE----- --=-iea5yQ7SNz67mT0nsNvX--