From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id +Dp+MD4CjWbD1wAAe85BDQ:P1 (envelope-from ) for ; Tue, 09 Jul 2024 09:26:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id +Dp+MD4CjWbD1wAAe85BDQ (envelope-from ) for ; Tue, 09 Jul 2024 11:26:22 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; 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=1720517182; 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; bh=MkJNcDpZhmhaFCD2feMXZl5aRfyw/ONG74aVd7QwheY=; b=hu0unBCSh96l9Bk0Dy0bHePdSpF3zRD2hIk71E09+g5IFnT51PmrGBhDxYkwTIz9kVvgsh DHEO+IOeJk/SV6SOtca5r17UlKm0wTCBU34Ly9/FYONAgHnDP6wNg9ULrFcr9Nxo1a8qtN wF6G14m+L+FojBCUpwvwNE8CIMF7vjC2GmLcJUIxIQSvDUz7EfHm0OZRvEzXjg0tQWlbJe DY5lW3jEuwAl14Yo0RyE7qVvNiBr3Q8z8B1ne1CyI61PXG/c7+TVbJJu1HbJY4KFikV3ZT 5H4PkILA1V9Hk+8JgXP8Ayvp0vnz5dJ2NRlzfUkvAiJ510SY5dINRCreK8kEOQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720517182; a=rsa-sha256; cv=none; b=HRHTMDYEa5Oa9b7Yn+Ga2FxfxcaqCnMl02v3wB2yjEtptORsH1Oe+mdRVhptY2ke4P2kw/ 76QuDNwU8r+hzuL5YMa7bOjkgWOBqW20A2zcetl5QCsLWwaX5jCh2zh8iKulSK0VkRXX2h JtSka513HPZHYwN9HMfApB6m+v+sT648KjEGrjXlu288u/7qFFmh2FfnrgaO96LmvNQidx vigq2Od/hPFxiwgdWXE1/lfDzxWvE/heWPlET08j9zfVxblKBM/mVrViTYk80yjcQ2R6QD vhWDCusXCdEQcB17cnllKMgNGEUGTX0XqMymMl67qywZ4TENVTgnAe6QqlXRcg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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 64B7B33E59 for ; Tue, 9 Jul 2024 11:26:22 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR76l-0006m3-HW; Tue, 09 Jul 2024 05:25: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 1sR76j-0006lu-SE for guix-patches@gnu.org; Tue, 09 Jul 2024 05:25:57 -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 1sR76j-0003H6-Jp for guix-patches@gnu.org; Tue, 09 Jul 2024 05:25:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sR76n-0007c5-VS for guix-patches@gnu.org; Tue, 09 Jul 2024 05:26: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: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 09 Jul 2024 09:26: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: Efraim Flashner Cc: 70985@debbugs.gnu.org Received: via spool by 70985-submit@debbugs.gnu.org id=B70985.172051715029246 (code B ref 70985); Tue, 09 Jul 2024 09:26:01 +0000 Received: (at 70985) by debbugs.gnu.org; 9 Jul 2024 09:25:50 +0000 Received: from localhost ([127.0.0.1]:52155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sR76c-0007be-0l for submit@debbugs.gnu.org; Tue, 09 Jul 2024 05:25:50 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sR76Y-0007bV-H6 for 70985@debbugs.gnu.org; Tue, 09 Jul 2024 05:25:48 -0400 Received: from localhost (unknown [89.207.175.27]) by mira.cbaines.net (Postfix) with ESMTPSA id F1B2227BBE2; Tue, 9 Jul 2024 10:25:08 +0100 (BST) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id a35962b0; Tue, 9 Jul 2024 09:25:07 +0000 (UTC) From: Christopher Baines In-Reply-To: (Efraim Flashner's message of "Sun, 7 Jul 2024 19:57:43 +0300") References: <9f11c96f25ba0f8f0c63ad3d6f5d6295035e7cc7.1720195563.git.mail@cbaines.net> <0c15a853521c4a9cfa8f4c3558e3aee9fb0a9d91.1720195563.git.mail@cbaines.net> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Tue, 09 Jul 2024 11:25:04 +0200 Message-ID: <87zfqq9atr.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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-Queue-Id: 64B7B33E59 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -7.99 X-Spam-Score: -7.99 X-TUID: 5op4/+sG1xpb --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Efraim Flashner writes: > On Fri, Jul 05, 2024 at 06:06:02PM +0200, Christopher Baines wrote: >> * gnu/packages/rust.scm (make-rust-sysroot/implementation): Guard against >> 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=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-targ= et-error >> + (package (libc-for-target= 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 t= arget))) > ,(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-winpthreads)= )) > ,@(package-native-inputs base-rust))) 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. I'd also maybe stick with modify-inputs, as at least that avoids the older inputs style. If I've followed your first email correctly, are you thinking of something like this? (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" target) 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))))) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmaNAfBfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfA0w/+KryaTEjkoqd0m2JxgaqddlGDOAlOHRrj dAHBE6VlG95UQWje1ldZXqt+Hc/SARcYptaPxJx8mrFPu46LtCpoYnd0w46HOKmR Y7q09JNt8mljokuXgm9bxDVVKsecMQVpJB9l90Z7JDr+RB/Ye1qayIykl6kQzQfX JeX5nhzjCh1gJJrlx4fibpMK3QQtIUpYpl01mXEp1mb3B7VU2kNd8NzCKuyL+haX pjzz4Bplkd4v+uCml3vFLf6+X7Hd6Y7JoYMtiahYaDSPY4O/mSMBkj3dDaJ5oqlI 2+qFphB/d8wYvHLJlra26wKhauqkXzJ/FxvqD+/WU8dySiiq7pLEtwjmkqKS5R8n L7oXERX60x9WTSdCsiGC+fDbFd12t9i6AqxsjQESuiPC1ynEjDoCZXixj0oSIWSa mrzBfG8dPE+uS8XSokV4WYQ6AZZ9CrDFM9GmjHx7m6DeB8w3hCWBGIphd3RaHJ0u YMcCo8p5IIaJI77GOyOOrSu9ET5yY5lsykEi5M8HFVCAVjNgCEivc1ZchtErVhWM ZYSAGqaDOm+J+Z9XBi/6t698dVc+MrYhBK3sg0OwIeuXWatKDAp+q7ttJqWuZbQr le1csf/2UUB5wBmuTfb6Q4ypmzxRmD5pXngME/QRbnws+559nWNUPtvcvgWw7sD3 22YxSNnDvjQ= =LkWP -----END PGP SIGNATURE----- --=-=-=--