From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id GOITLuhVjWZQBQAAe85BDQ:P1 (envelope-from ) for ; Tue, 09 Jul 2024 15:23:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id GOITLuhVjWZQBQAAe85BDQ (envelope-from ) for ; Tue, 09 Jul 2024 17:23:20 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="Hid/24Vh"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720538600; 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-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=K7Jrbs0wSU9PZM8TNYU0yzqqP42bVqpt4u7MhJAfFps=; b=SLNA0Cc1VWw0RcI9WLS1l+PC49BCyaoBOS1d00PKVulHSPgI5kl9QYRcB9ZMonzitEI4EF cTX14bECWtJa7DHXDQ9WODr4NTfuvqOUg/4yHSdFz6M3ZM/UhogLksKj8jgAmFYs3SKCUt mWeTtpgTv+Sxi5xnuJzZIl9+1McWldO6EyiywSoYhbTlIMan0okr4vCMaESiFJ/XhAjBGl wkDSziKANJBRZ2oZHd2REg5CIKYw/ddCDXoxO5Yt7oh/r0tkblOh81s0cYCVSEnIS8OtyO 6ZkkYUkf/N5p3ouJLtFaKq4aTw3czbnfkDKQAt7QipI4EhXLdoZEVS0EJfdZ8w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720538600; a=rsa-sha256; cv=none; b=syrl444cto1lL7qdNTD90eVWQzulZcmZfBmO3as5ViRf4auSf4FheOt95+MjV+eUYyWqp0 OHz0/50QJ3MpPPwFOqQY55RAaLzwSOVimiUnp0P8Ft8HXMnMAfdbk1ViuaKIt828TNCpZ+ AFdAbdYlTaNFXLnFdULvg3xxzINRnmddsEXHWl7ydqjK2HQTNbElhUHU7RXa4s0uM4n85j Jx4RjulfrLoSJyhIrQ4ue+NjXNAF3RgTlIO2zmOw3aeRejSx7c23xdjylVto5BqIuPfu/a QtlJsvnW3IiLsHOhMiEDSPAGfp/lQLSXZqJU1ea9RoNp5EDmofXa1enNFm957A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="Hid/24Vh"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" 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 5978D7E16F for ; Tue, 09 Jul 2024 17:23:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRCgF-0001yf-Ci; Tue, 09 Jul 2024 11:22:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRCgC-0001xB-VB for guix-patches@gnu.org; Tue, 09 Jul 2024 11:22:56 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRCgC-0005FI-Lq for guix-patches@gnu.org; Tue, 09 Jul 2024 11:22:56 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sRCgH-00068u-Uv for guix-patches@gnu.org; Tue, 09 Jul 2024 11:23:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70985] [PATCH v2 5/6] gnu: rust: Guard against cross-libc returning #f. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 09 Jul 2024 15:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70985 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 70985@debbugs.gnu.org Received: via spool by 70985-submit@debbugs.gnu.org id=B70985.172053854223565 (code B ref 70985); Tue, 09 Jul 2024 15:23:01 +0000 Received: (at 70985) by debbugs.gnu.org; 9 Jul 2024 15:22:22 +0000 Received: from localhost ([127.0.0.1]:53903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRCfd-000681-Ev for submit@debbugs.gnu.org; Tue, 09 Jul 2024 11:22:21 -0400 Received: from mail-qt1-f173.google.com ([209.85.160.173]:42187) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRCfb-00067m-8O for 70985@debbugs.gnu.org; Tue, 09 Jul 2024 11:22:20 -0400 Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-447e2d719afso19437361cf.0 for <70985@debbugs.gnu.org>; Tue, 09 Jul 2024 08:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720538468; x=1721143268; darn=debbugs.gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=K7Jrbs0wSU9PZM8TNYU0yzqqP42bVqpt4u7MhJAfFps=; b=Hid/24Vhege2wLRA1QtQolNuvNS1Mb0pMyrbFN8MdYA6pmO/Y2VXE5Apidf7ioRVlZ w+OGKvG6pgvThoRRwQhihGTu/ekdyeXoOopDQFxim2N0EosFwsPOEW8UgGvXdO3DkMT9 eCJTWBabyBDSTmK7FKoo8BVHj4LjIdZLHtgasI+DqE5Pnj5E7Cf0L1awaar/9FA0EcFs WIEChMli/w0YLk4xplhlpkKm90PO7YL521VJdb5o2MHRocF0TFUwAhXmSNDgNtGPAXP6 gD/NG5Q8h7BOBrHnvTY6+ntE8VpvfUAscZJr4TWmshuuUwgIDrTHJ8uMYJDq/U1AnHsz Tpiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720538468; x=1721143268; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=K7Jrbs0wSU9PZM8TNYU0yzqqP42bVqpt4u7MhJAfFps=; b=qzhdrrLZJTDod8rJzxaJIlW8YaxJum1tCxe7YwiPKjJDJTWywQt4KIy9KPUzFpGYna 7fucikcUOAGc1SNSWf+IU7KrIhTfSgccjwXUXh5eqXKdFfMUUunswNOEecyRu9ZjNKCY k7G3+JTtW1e/6VIEhv98p2uvceRCbKQProqXy1LgenVOn8ydHaBBuv9xF+3xho11/Qyp YkIEi5XzkNPNz42aQBvfaE3EGuvWaxF+RT8YPj/dnf7te3tY1DedI/AgWIv2R7WvpgPu LgNl1pdd8n+Z4CjMC60KBNsMYdkadqV+VuEZS56gbSEzJ9Q6bUgVOBt+03uWKz8xuhwG risA== X-Gm-Message-State: AOJu0YwYOQT4meaDsO7+mlMommwoZG6HaNmtdSiS60teoCn7lgeoU7r+ A3FquG/LJTVyEz1bsHC3tNv5RDIz6L2HDNMs3y3gkTr5K1bmM4Jv X-Google-Smtp-Source: AGHT+IHe/T8H5NsLalk1DEPUzOr7W9RnLHKysfjtR1NiPg3HLNpuqXqUHHSx0xR4Z/fZ0L4vSW2heg== X-Received: by 2002:ac8:530b:0:b0:447:e532:b36b with SMTP id d75a77b69052e-447fc42160dmr37156321cf.21.1720538467627; Tue, 09 Jul 2024 08:21:07 -0700 (PDT) Received: from localhost (ool-ad039216.dyn.optonline.net. [173.3.146.22]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79f190b7a60sm104398285a.134.2024.07.09.08.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 08:21:07 -0700 (PDT) Date: Tue, 9 Jul 2024 18:21:05 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Christopher Baines , 70985@debbugs.gnu.org References: <9f11c96f25ba0f8f0c63ad3d6f5d6295035e7cc7.1720195563.git.mail@cbaines.net> <0c15a853521c4a9cfa8f4c3558e3aee9fb0a9d91.1720195563.git.mail@cbaines.net> <87zfqq9atr.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CbG5KfAan0mHUEKf" Content-Disposition: inline In-Reply-To: <87zfqq9atr.fsf@cbaines.net> 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 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.50 X-Spam-Score: -2.50 X-Migadu-Queue-Id: 5978D7E16F X-Migadu-Scanner: mx11.migadu.com X-TUID: 4CbxmOK36r08 --CbG5KfAan0mHUEKf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 09, 2024 at 11:25:04AM +0200, Christopher Baines wrote: > Efraim Flashner writes: >=20 > > On Fri, Jul 05, 2024 at 06:06:02PM +0200, Christopher Baines wrote: > >> * gnu/packages/rust.scm (make-rust-sysroot/implementation): Guard agai= nst > >> cross-libc returning #f. > >>=20 > >> Change-Id: Ia0d5c889c6f5cd3478ad985c79feb9ba1c472c29 > >> --- > >> gnu/packages/rust.scm | 10 ++++++++-- > >> 1 file changed, 8 insertions(+), 2 deletions(-) > >>=20 > >> diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm > >> index a385344473..f1de34b277 100644 > >> --- a/gnu/packages/rust.scm > >> +++ b/gnu/packages/rust.scm > >> @@ -73,7 +73,9 @@ (define-module (gnu packages rust) > >> #:use-module (ice-9 match) > >> #:use-module (ice-9 optargs) > >> #:use-module (srfi srfi-1) > >> - #:use-module (srfi srfi-26)) > >> + #:use-module (srfi srfi-26) > >> + #:use-module (srfi srfi-34) > >> + #:use-module (srfi srfi-35)) > >> =20 > >> ;; This is the hash for the empty file, and the reason it's relevant = is not > >> ;; the most obvious. > >> @@ -1464,7 +1466,11 @@ (define make-rust-sysroot/implementation > >> (modify-inputs (package-native-inputs base-rust) > >> (prepend (cross-gcc target > >> #:libc (cross-libc target= )) > >> - (cross-libc target) > >> + (or (cross-libc target) ; could be #f > >> + (raise (condition > >> + (&package-unsupported-ta= rget-error > >> + (package (libc-for-targ= et target)) > >> + (target target))))) > >> (cross-binutils target))))) > >> (properties > >> `((hidden? . #t) > >> --=20 > >> 2.45.2 > > > > This will probably work: > > > > (native-inputs > > `((,(string-append "gcc-cross-" target) ,(cross-gcc target > > #:libc (cross-libc= target))) > > ,(when (false-if-exception (cross-libc target)) > > `(,(string-append "glibc-cross-" target) ,(cross-libc target)= )) > > (,(string-append "binutils-cross-" target) ,(cross-binutils target)) > > ,(when (target-mingw? target) > > (if (string=3D? "i686-w64-mingw32" target) > > `("mingw-w64-i686-winpthreads" ,mingw-w64-i686-winpthreads) > > `("mingw-w64-x86_64-winpthreads" ,mingw-w64-x86_64-winpthread= s))) > > ,@(package-native-inputs base-rust))) >=20 > Thanks for taking a look. In the latest patches cross-libc isn't > changing to raise an exception (as that ended up being too complicated), > so I'm not sure the false-if-exception is going to work. false-if-exception should work. We use it a couple of times in golang packaging to skip the tests if we're building with gccgo. (unless ;; The tests fail when run with gccgo. (false-if-exception (search-input-file inputs "/bin/gccgo")) (apply (assoc-ref %standard-phases 'check) args))))))) > I'd also maybe stick with modify-inputs, as at least that avoids the > older inputs style. >=20 > If I've followed your first email correctly, are you thinking of > something like this? >=20 > (native-inputs > (if (target-mingw? target) > (modify-inputs (package-native-inputs base-rust) > (prepend (cross-gcc target > #:libc (cross-libc target)) > (cross-binutils target) > (if (string=3D? "i686-w64-mingw32" targe= t) > mingw-w64-i686-winpthreads > mingw-w64-x86_64-winpthreads))) > (modify-inputs (or (and=3D> (cross-libc target) > (lambda (x-libc) > (modify-inputs > (package-native-inputs base-rust) > (prepend x-libc)))) > (package-native-inputs base-rust)) > (prepend (cross-gcc target > #:libc (cross-libc target)) > (cross-binutils target))))) Thanks, I hate it :) That said, if it works then it's fine. (I lose my confidence from (cross-libc target) getting renamed to x-libc) I played around with it a bit more. The problem is that we can only logic our way around before modify-inputs or inside prepend/append/delete, so options are a bit limited as to what we can do. I came up with the following, which I think should also work: (native-inputs (modify-inputs (package-native-inputs base-rust) (prepend (cross-binutils target)) (prepend (cond ((and (target-mingw? target) (target-x86-32? target)) mingw-w64-i686-winpthreads) ((and (target-mingw? target) (target-x86-64? target)) mingw-w64-x86_64-winpthreads) ((or (target-linux? target) (target-hurd? target)) (cross-libc target)) ;; We need something, and duplicating cross-binutils ;; doesn't cause any problems. (#t (cross-binutils target)))) (prepend (cross-gcc target #:libc (cross-libc target))))) I don't like the '#t' branch of the cond, but it doesn't seem to break anything. And we're explicit about who gets cross-libc. I would like something like the following to work, but some of the inputs get lost (native-inputs (modify-inputs (package-native-inputs base-rust) (prepend (cond ((and (target-mingw? target) (target-x86-32? target)) (cross-gcc target #:libc (cross-libc target)) mingw-w64-i686-winpthreads (cross-binutils target)) ((and (target-mingw? target) (target-x86-64? target)) (cross-gcc target #:libc (cross-libc target)) mingw-w64-x86_64-winpthreads (cross-binutils target)) ((or (target-linux? target) (target-hurd? target)) (cross-gcc target #:libc (cross-libc target)) (cross-libc target) (cross-binutils target)) (else (cross-gcc target #:libc (cross-libc target)) (cross-binutils target)))))) --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --CbG5KfAan0mHUEKf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmaNVVcACgkQQarn3Mo9 g1FelhAAuaFjSYlTyOfHjTwrp1mWT+xSiTxnfwsZEGw68ks0OGrI4X1wslazOBMp X9zlImVGJwmFSAASzmcEnLYnYbUn5dDMzUPw4qqbLatEFxBoayePXXbj+doFfb9S hP5JlZn2JFUuzsrvDtIgFNbQ9kKPu6RPKq2nLcZrh3+4Aq2TbRXEzUeJP1zd5oWS t5N2L6daYkdZ0k+erIXaaT15MyFQN5ZE3/HAkg91WCgwDlyy3h6an2YvmiXhGX6R W2ovVBr7cIIXEi6UaZbKcL9rq+WTTypm7xISV2gLht5rChYmMfN2Hs+ki8TsIs/F xSkmeEpFoJOK6rvWUwWjVcPwyW7ZFaFCsbRg9XiSp6lCgpTVnXA3BdaszXg4kHIi PY6tFXq7itIRLOfCi+Q52OpJWgIk1IMhNHMO1gEpNyF96BkT9OTYtVJgjIhqXZz+ BCbe7bCcu3Y/4vYCr2yQTxATYUEUivmkweTbIEvmeBKwLfnBI0cwLYqFus15ebjv APlmO6Z0dlVciAYImSMjOC97KcT3ZA/hABR4rsCQjv/I1y5tUG9ZcNlIDeoGRBuX kI7iEZ/cNbZ745hw1CLK+KLFnaVsQtBUs3AafCIGe9vL9BBIRRzu3qwwcTnrvkRW xOb430PNsm1ksJzUu10b/OEzI3dNF0vduuHzCC8vIyy9XZi4zkw= =EJ7r -----END PGP SIGNATURE----- --CbG5KfAan0mHUEKf--