From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.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 0GkXMUY2kWY6LQAAqHPOHw:P1 (envelope-from ) for ; Fri, 12 Jul 2024 13:57:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0GkXMUY2kWY6LQAAqHPOHw (envelope-from ) for ; Fri, 12 Jul 2024 15:57:26 +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=1720792646; 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=qi9XTxqryKwAGx1K56yJcawaRpCQPwrZ9Uld27UDbjo=; b=Q4xJIxvOJTALnuM2RPYniQo0p5Th1KoEG85M95hDhFnWuYP50fuyN7CCgojBXcta9xSXK5 7f7iHEQMRy1ILuox1+6a9sDu8/xCCX2+GbpNWrdlD426N0dg7hROmYXgvPHcu6hmewviOl kV3VNmTshnAcNVm29ABOVoiNF7HvuR9ov7zAsvmT55TcPBubvXdgQB670edIz4S3mASXGr 2P5w1N+SCI8s0ry8TaBSRv30KDWBUmFiNe3nY+2R6uvvFfjlJNma/ZcsMaoHKoLWpfyFHI QOdfEKkp1NgwT5oTxdT6gkECApzj8bFHHn3KxZGywZ6hfGwIvKBc3O5IqEhu7w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720792646; a=rsa-sha256; cv=none; b=ueiT7xnTFZjecZ2nRoQuaKzrO4xtppk3J6X1QcD0ZgV9GJnh5zIdPUfZzqpu/TILP/PBp7 4Tk/z5nd80qJ3GiMFZbsH8H8ge9U7n5w+JQleB1zwcwJ6Qhdn5mh+AV6Hv7v7rrx/JwHK6 q1ixcMGe9khEth/cBRcd/iAdbIHRB1cjq79u59UI7pFtZgbEvLzS3r4QTjv5nA/I5BFwFq V2hQbIfK1/4WWSJJJCxv9SlPsi/soCaXgYGzkLDYLN07zLLRrYVKFKshFUO/J93zTNzaAs sltuoiGEFJCHs58aPE68gvCCYXXHJd9x63iHk0qZWz7otuI8Qq6a8YzuXIUeKg== 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 6801762FC7 for ; Fri, 12 Jul 2024 15:57:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSGll-0006Ld-Vc; Fri, 12 Jul 2024 09:57:06 -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 1sSGlk-0006E8-8P for guix-patches@gnu.org; Fri, 12 Jul 2024 09:57:04 -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 1sSGli-000565-Kx for guix-patches@gnu.org; Fri, 12 Jul 2024 09:57:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSGli-0001pk-Jv for guix-patches@gnu.org; Fri, 12 Jul 2024 09:57:02 -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: Fri, 12 Jul 2024 13:57:02 +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.17207926027031 (code B ref 70985); Fri, 12 Jul 2024 13:57:02 +0000 Received: (at 70985) by debbugs.gnu.org; 12 Jul 2024 13:56:42 +0000 Received: from localhost ([127.0.0.1]:54548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSGlN-0001pL-Vk for submit@debbugs.gnu.org; Fri, 12 Jul 2024 09:56:42 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSGlL-0001pF-Tz for 70985@debbugs.gnu.org; Fri, 12 Jul 2024 09:56:40 -0400 Received: from localhost (unknown [213.31.211.195]) by mira.cbaines.net (Postfix) with ESMTPSA id C77BC27BBE2; Fri, 12 Jul 2024 14:56:07 +0100 (BST) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id c98b9daf; Fri, 12 Jul 2024 13:56:06 +0000 (UTC) From: Christopher Baines In-Reply-To: (Efraim Flashner's message of "Tue, 9 Jul 2024 18:21:05 +0300") References: <9f11c96f25ba0f8f0c63ad3d6f5d6295035e7cc7.1720195563.git.mail@cbaines.net> <0c15a853521c4a9cfa8f4c3558e3aee9fb0a9d91.1720195563.git.mail@cbaines.net> <87zfqq9atr.fsf@cbaines.net> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Fri, 12 Jul 2024 14:56:04 +0100 Message-ID: <87msmm7lzf.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-Spam-Score: -5.00 X-Spam-Score: -5.00 X-Migadu-Queue-Id: 6801762FC7 X-Migadu-Scanner: mx11.migadu.com X-TUID: d7gCpWD1RHVx --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Efraim Flashner writes: >> 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" targ= et) >> 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-rus= t) >> (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 looked at this further and actually tried building the derivations for different targets, and realised that there needs to be a platform-rust-target set for it to work. So maybe we don't need to bother with the inputs here and can just add a guard at the top, e.g. (define make-rust-sysroot/implementation (mlambda (target base-rust) + (unless (platform-rust-target (lookup-platform-by-target target)) + (raise + (condition + (&package-unsupported-target-error + (package base-rust) + (target target))))) + I've sent a new patch series to this effect. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmaRNfRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfXJA//eECVY4KfonaYw6rMT6K7N2he/Vzdthfn WtILbMmfScaVWbLEwtEwbOKyZbA6XNdYTvKFV27d92I3VSzEVuy75x2h//bL8sYy RlU1T9FyjzkvUCzemUE463wbnQVenMhOo1rgzRCNFpDNfMQUGnJBZ5RxMfK9zq3X Z47lf14A5Bk1wg0y9SLzA4w4j4HNhTkfjp/CF9xBe2XkCIAk87lFrLOelOvht3p3 CI5Lhbb5+E2UD0RfX6QrUsJMMG+YYUZ0s1msOr37vo//8eXRBnOJ4jF301y8wr6u TYZWKK7lB7gARrLA9YXEPP9+8UO2t0smNEPy/3kwtoSoISqInQE8dSXSE4RU4PKl FC2YDjXcpm1gu65DZz94kqGLhKTsKLJ341Rq6gSSgnmJTsctMOqkO8xYUMYrBHGN hUjz96CL40lTxP6huhcNkB2KVAw4ZxEu499Ti73x+osb9d2dES8pvNLXMW/vKErH BpC6wbpm4q5KvI1k57NLNZ7JZbgRb8jkwSmrgu1X5GJVrMwg8QJoAkWPk1CKg+3k BWx4knblQ5uZkWY3s8HzYx4t2OsJ0mGLAiNF6r5A8GKW1YlqEwL8hJBY2rIXfKRJ Hf/S4xfx2/GSD+RhGpUEsIwqZsuB2QuTW+p3BKkLVTxX8NLQ3LcgrP9F85bcMlps jYfPC4qh86Y= =S+In -----END PGP SIGNATURE----- --=-=-=--