From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CJE+KMb6e2ApTQEAgWs5BA (envelope-from ) for ; Sun, 18 Apr 2021 11:24:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8D8CI8b6e2CZfwAA1q6Kng (envelope-from ) for ; Sun, 18 Apr 2021 09:24:22 +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 492D61FF89 for ; Sun, 18 Apr 2021 11:24:21 +0200 (CEST) Received: from localhost ([::1]:35462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lY3fA-00006a-DE for larch@yhetil.org; Sun, 18 Apr 2021 05:24:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lY3ex-0008W4-8f for guix-devel@gnu.org; Sun, 18 Apr 2021 05:24:07 -0400 Received: from flashner.co.il ([178.62.234.194]:49640) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lY3et-0005Es-9B for guix-devel@gnu.org; Sun, 18 Apr 2021 05:24:07 -0400 Received: from localhost (unknown [31.210.177.125]) by flashner.co.il (Postfix) with ESMTPSA id F06A740336; Sun, 18 Apr 2021 09:24:00 +0000 (UTC) Date: Sun, 18 Apr 2021 12:23:24 +0300 From: Efraim Flashner To: Chris Marusich Subject: Re: bug#47615: [PATCH 0/9] Add 32-bit powerpc support Message-ID: Mail-Followup-To: Chris Marusich , 47615@debbugs.gnu.org, guix-devel@gnu.org References: <8735vo1yhm.fsf_-_@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rHtMyZq0tCMyjznr" Content-Disposition: inline In-Reply-To: <8735vo1yhm.fsf_-_@gmail.com> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Received-SPF: pass client-ip=178.62.234.194; envelope-from=efraim@flashner.co.il; helo=flashner.co.il X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org, 47615@debbugs.gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618737861; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=Aoq+tpjDgByYFRB9pdEkKk6X4TPtMoHgSWR9Q8WUQ40=; b=k/m+aDvvoBk0hCwb94TvNEG1Zze3gRVQ0eukRt+mN54glwHH+WZ6qpX9yy1z13Vp2VaNUb Hd4pawNoudfvpObGwmvJhF8bszdjhQL0Rr8YAOC77hGpdcnCvaHO9FEIraeKbaVKKlz8xm uac5YhLy3PGt8p0rDI2qQU7yvlDRFxtPULYXPNlCm0qiS43O1aHbdUiFBluFb+HCFX/8KV CjYIfPy5E7zJL3sR756UN7bKPNSECZjr3TDbTC6y6g+fpCmDCspEftUfWJJH1mwaoKdtSO 13kEj4QVvFLzyTMGRrpT/l8NXtg/28AlrB3+kkNLEVpjPPijr2taZWUuoX1Hdg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618737861; a=rsa-sha256; cv=none; b=FMeogW8t/8RjSOp0rqHturfbzNikklD/yAjrP3aily5oYnNPrkynNVkTZRUcopB6mHIHnb 9b9kjUY1JZgwax/KmthRSVgD2MMIjD3NQJeUts8Kmr1zPZcd9xbTnmzYSKflkAreNIdLfv PPRz6YOtlkZ0YgJGuSedY3JoORMybwJ5iEp5A3W+g6eEKFuncgMlwziAXwpHu/IglX1p+N NReE7rL0uZskJMyaZKARJOPVlCkT/mOSG37KCqCgIxy4qXfSuzBlzBe7YmyRHaE//c/QSd QHUE/yidhVEizxeaJ+WReHVYb45UqBFXOe0+HdLNFnpGaL1BO1VsH2k0AmZhyg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -4.04 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 492D61FF89 X-Spam-Score: -4.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: 8zx+Fhw/nTv3 --rHtMyZq0tCMyjznr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 17, 2021 at 12:51:01PM -0700, Chris Marusich wrote: > Efraim Flashner writes: >=20 > > * gnu/packages/base.scm (binutils)[arguments]: Add phase on > > powerpc-linux to adjust the test suite. > > * gnu/packages/commencement.scm (binutils-boot0)[arguments]: Move custom > > phases after inherited arguments. Add phase on powerpc-linux to adjust > > the test suite. >=20 > Nits: adjust the test suite to do what? The message would be clearer if > it explained the purpose of the adjustment. You could also name the > phases you added/moved, for extra clarity, if you want to. >=20 > > diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm > > index dbb7c619fe..b9fc0a6e29 100644 > > --- a/gnu/packages/base.scm > > +++ b/gnu/packages/base.scm > > @@ -531,7 +531,16 @@ change. GNU make offers many powerful extensions = over the standard utility.") > > =20 > > ;; Make sure 'ar' and 'ranlib' produce archi= ves in a > > ;; deterministic fashion. > > - "--enable-deterministic-archives"))) > > + "--enable-deterministic-archives") > > + ,@(if (string=3D? (%current-system) "powerpc-linux") > > + `(#:phases > > + (modify-phases %standard-phases > > + (add-after 'unpack 'disable-rust-libiberty-test > > + (lambda _ > > + (substitute* "libiberty/testsuite/Makefile.in" > > + ((" check-rust-demangle ") "")) > > + #t)))) > > + '()))) >=20 > What's the problem? Presumably the test fails; a comment here could > clarify that. >=20 > If it's a test failure, has the issue been reported upstream? I'll check to see if I can find something upstream. If not I'll report it. FWIW Debian disables the test suite for powerpc. https://sources.debian.org/src/binutils/2.36.1-6/debian/rules/#L537 > > (synopsis "Binary utilities: bfd gas gprof ld") > > (description > > diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.= scm > > index 7c39a84008..f707a01d30 100644 > > --- a/gnu/packages/commencement.scm > > +++ b/gnu/packages/commencement.scm > > @@ -2653,7 +2653,22 @@ exec " gcc "/bin/" program > > #:modules ((guix build gnu-build-system) > > (guix build utils) > > (ice-9 ftw)) ; for 'scandir' > > + > > + ;; #:phases gets modified for powerpc-linux in binutils, > > + ;; so #:phases here needs to be after the inherited one. > > + ,@(substitute-keyword-arguments (package-arguments binutils) > > + ((#:configure-flags cf) > > + `(cons ,(string-append "--target=3D" (boot-triplet)) > > + ,cf))) > > + > > #:phases (modify-phases %standard-phases > > + ,@(if (string=3D? (%current-system) "powerpc-linux") > > + '((add-after 'unpack 'disable-rust-libiberty-test > > + (lambda _ > > + (substitute* "libiberty/testsuite/Makefile= =2Ein" > > + ((" check-rust-demangle ") "")) > > + #t))) > > + '()) > > (add-after 'install 'add-symlinks > > (lambda* (#:key outputs #:allow-other-keys) > > ;; The cross-gcc invokes 'as', 'ld', etc, withou= t the > > @@ -2667,12 +2682,8 @@ exec " gcc "/bin/" program > > (with-directory-excursion (string-append out "= /bin") > > (for-each (lambda (name) > > (symlink name (remove-triplet-pr= efix name))) > > - (scandir "." has-triplet-prefix?))= ))))) > > + (scandir "." has-triplet-prefix?))= ))))))) > > =20 > > - ,@(substitute-keyword-arguments (package-arguments binutils) > > - ((#:configure-flags cf) > > - `(cons ,(string-append "--target=3D" (boot-triplet)) > > - ,cf))))) > > (inputs (%boot0-inputs)))) > > =20 > > (define libstdc++-boot0 >=20 > I think you can put all of this in the substitute-keyword-arguments > form, which would (1) eliminate the need for a comment, (2) eliminate > the need to worry about the order of the keyword arguments, and (3) > eliminate the need to duplicate the new phase in two package > definitions: >=20 > (define binutils-boot0 > (package > (inherit binutils) > (source (bootstrap-origin (package-source binutils))) > (name "binutils-cross-boot0") > (arguments > `(#:guile ,%bootstrap-guile > #:implicit-inputs? #f >=20 > #:modules ((guix build gnu-build-system) > (guix build utils) > (ice-9 ftw)) ; for 'scandir' >=20 > ,@(substitute-keyword-arguments (package-arguments binutils) > ((#:configure-flags cf) > `(cons ,(string-append "--target=3D" (boot-triplet)) > ,cf)) > ;; The presence of '%standard-phases as the default value here= is > ;; important. It ensures that even when (package-argument > ;; binutils) does not already contain the #:phases keyword > ;; argument, the substitution will occur. If you omit a defau= lt > ;; value and (package-arguments binutils) does not contain the > ;; #:phases keyword argument (e.g., on an x86_64-linux system), > ;; then the substitution will not occur, and no phases at all = will > ;; be added. > ((#:phases phases '%standard-phases) > `(modify-phases ,phases > ,@(if (string=3D? (%current-system) "powerpc-linux") > '((add-after 'unpack 'disable-rust-libiberty-test > (lambda _ > (substitute* "libiberty/testsuite/Makefile.in" > ((" check-rust-demangle ") "")) > #t))) > '()) > (add-after 'install 'add-symlinks > (lambda* (#:key outputs #:allow-other-keys) > ;; The cross-gcc invokes 'as', 'ld', etc, without the > ;; triplet prefix, so add symlinks. > (let ((out (assoc-ref outputs "out")) > (triplet-prefix (string-append ,(boot-triplet) "= -"))) > (define (has-triplet-prefix? name) > (string-prefix? triplet-prefix name)) > (define (remove-triplet-prefix name) > (substring name (string-length triplet-prefix))) > (with-directory-excursion (string-append out "/bin") > (for-each > (lambda (name) > (symlink name (remove-triplet-prefix name))) > (scandir "." has-triplet-prefix?))))))))))) >=20 > (inputs (%boot0-inputs)))) >=20 > I played with this in the REPL, and it seems to produce the desired > result (e.g., inspect by running ,pp (package-arguments binutils-boot0) > or similar at the REPL). However, I didn't actually try building > anything with it. >=20 > What do you think? >=20 I like the way you've done it (and the comment). The fewer places with copy/pasted code the better. I'm building it again now to see about the tests. With your changes I only need to add the phase in (gnu packages base). --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --rHtMyZq0tCMyjznr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmB7+okACgkQQarn3Mo9 g1EQkg/9GRxYnGSA5LQF07oguQ4z9DX5FygpdR6gK0YiAcE5cBioqcLhRTd/DTxS TtILEp6L8Or7fEBj3tGqLtAQ+f36UBlR8vCUSgV5GBrnGH1/X0ciZwRaCS0oHI4n TC06OIYqRw/rP4/OLthlycK/iFsjvuMOtNupnwv/jYOtD9NdGiGtJfLMbDlmnXtC DTCcoLI/3gSH7FGDb/9sPDT5j4UBsL09FTSHD0VJukomyw4lkHbR+QGHXpOw5P8d bXNpZjLWfqQPkMpHkxDzSNjjyEWhkWbX+h6t+EU4GA2OmAAswe/3Vtj0oQ+BXX9D Qt1I9o4WxOpfZ1OlViZ0/ZiwpbWvq3UT0MTwjUEQxaA9riu7FZl0/k5bSYG0s5Tp N29jS4uSf5n9hvGJIetY3Us/KfTCqIObh2rBtTrA8A2ilOCXsZFP0F6XxAsfyi+I /qU5Ai/atGhb21WxpRbDLJk470Z7iK53BJjp88UyPS4LnkaNnVANoEZVD/vVipFz 600GnC68Rl7lPGoPytm7b+MX8J/OIWyaii4I48lXjX7sDYB302LlYOEd6gBvm23X Eh606bpGJUMQwV0BjylobDS8dZ+QaGSK2Vctk72TTovlcst4vkxsqplulGo6Ejjn N2JIdhnHwLGatDuqzAqILlHEF0hXO97rdSFYfvYs6F8zfS3G5KE= =bk7N -----END PGP SIGNATURE----- --rHtMyZq0tCMyjznr--