From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0MxeGNVzzmUsGAEA62LTzQ:P1 (envelope-from ) for ; Thu, 15 Feb 2024 21:28:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 0MxeGNVzzmUsGAEA62LTzQ (envelope-from ) for ; Thu, 15 Feb 2024 21:28:05 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Df8EULbL; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Df8EULbL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=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=1708028885; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: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=RakyD7nvQ58pL2xLMUKv7TWCrx3JQ+ANV2TOyS6DD6o=; b=NtcmGrO1F9SWFw88fWuZ5PYy/jr0qdemwZiqbCnlT/tPNxxJPtrfVWqP2aUfVswqJTdW7V WpTrxO10klTLw0XzhvwZ2LuTL0lvu0E2wGLOjZHMHsU6h3D5J+dFjuVMvgUjowXZyrIFOO yWg0LFbSpU2m6BZseh9xBiZVKMUTUWCtM8T2iw3XyCXT1xzmNerMBtFttbGkFmAGkFXtxk 3zJxvgbYDQPZEUyrL2hd0oR2oSiBGCgtf0EqrcXZXzcT1PqXCF+LdGH0S6MiGAOfzwzk22 SALevg/lPGy9wNmVoQFqOAdkH8kOBo8GgWArCPVHehPezuD/9250A2d3RWAizQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Df8EULbL; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Df8EULbL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=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-Seal: i=1; s=key1; d=yhetil.org; t=1708028885; a=rsa-sha256; cv=none; b=p0V1huYPkJwSGZhK98s/ijR3fHISlGwcJ5CeN5yVMIu1eL0LBWJ4dglOeQgu0mDbNe56IB /c4y4yIiVLibMZ7Og0r0BuQ5cxpDi2BjXBB95ShiEVYmoixV8Wy5O24eisL/o46P7RNjIx BCRbf+QdhwuwmYq1ncDQpBHBTAASBHKjCGjbu5zu/zKKzL4J53sPlO8i0LUSDkeo6CL6Gi tO5wm6Glqeu6p5IkuIIRSBw1izNDY14lnpiBdJ0e20vRhBPzgO0rarrlwuiHIeFHcGhnLd ae285Ik49i2PDITwdQiBQ6Y+bHiqGY20ovUkNJcqIYI+cfKdcWHJQvb7TFFkRQ== 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 35CF645405 for ; Thu, 15 Feb 2024 21:28:04 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raiKg-0007I2-2y; Thu, 15 Feb 2024 15:27:46 -0500 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 1raiKf-0007Hl-1j for guix-patches@gnu.org; Thu, 15 Feb 2024 15:27:45 -0500 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 1raiKe-0007r5-PA for guix-patches@gnu.org; Thu, 15 Feb 2024 15:27:44 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1raiKx-0007Dz-HK; Thu, 15 Feb 2024 15:28:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69170] [PATCH rust-team 01/46] build-system: cargo: Add #:cargo-native-inputs argument. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Thu, 15 Feb 2024 20:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69170 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69170@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz>, Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 69170-submit@debbugs.gnu.org id=B69170.170802885627438 (code B ref 69170); Thu, 15 Feb 2024 20:28:03 +0000 Received: (at 69170) by debbugs.gnu.org; 15 Feb 2024 20:27:36 +0000 Received: from localhost ([127.0.0.1]:57212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raiKV-00078N-Hs for submit@debbugs.gnu.org; Thu, 15 Feb 2024 15:27:36 -0500 Received: from wolfsden.cz ([37.205.8.62]:36066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1raiKT-000786-E6 for 69170@debbugs.gnu.org; Thu, 15 Feb 2024 15:27:34 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id C067828CEC0; Thu, 15 Feb 2024 20:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1708028833; bh=uVKcm2mXlYB/7CQ8hzIm9tCfBQ3A6sw10FkMEOCAudY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Df8EULbLDtdZifxBQ8DlwCjkaiZAkY75sQ8fQfu5Tumf7Ulkg2N8sCPm29h4vDoWr tzW5xYZJT0+ob+pGUSyU7xz1gHKoHs6UV0uudTLMD9QnGc3Y/tE+kN3EljkAXWIbUh lJlA8j9ovpMIFQlzkhYLcRvkECdccollGwkLVLOMwWWw0JHXRD+tTcb7Xrs8jc3hMx pzSViF9mlxthCjWrEsWbM7QtT70O32qkbkIUYCB8vTWKFhzhLI78FQNb6yMKmRA8av D7oDPfychpgui0ZXhRRk6AJnMfuBIjKrvF4h6IMxL3ntWk6MUmeXQPc/mg9Yu25Lcx G5fK4QJj3SYVcP/UjzHMEE6VyH8Z7g+AvDJufv4KmSvlHFViDjkIYxKQBKkpnONLKM 4R299+a7xwYsNMRRwbPbLySzpJepvdWnubcc1lbe6fn2Kimdo6K+zEHrgiZXfJLA63 SawvloG7paoBz0vCXaaQpxVosiK1+fH6rTmpNM15kxPPMDG8r8IznuJAHIAEqwwt0h 6DxJEnaX/Dpk3Q9t79fs+FPfWiC2wwjpW28wTbOU9OdSkBj4ayRCqg7CEuGGW4cSML xgbihkeqpQSKoiMZ6rKxepcRGvb3qJoXeapSF/60mYj9zyERRbZGnngzC5q4BXyzyW q8gRJLaeNnwZbruv3zTKec24= Received: from localhost (unknown [193.32.127.154]) by wolfsden.cz (Postfix) with ESMTPSA id 6092528DC16; Thu, 15 Feb 2024 20:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1708028833; bh=uVKcm2mXlYB/7CQ8hzIm9tCfBQ3A6sw10FkMEOCAudY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Df8EULbLDtdZifxBQ8DlwCjkaiZAkY75sQ8fQfu5Tumf7Ulkg2N8sCPm29h4vDoWr tzW5xYZJT0+ob+pGUSyU7xz1gHKoHs6UV0uudTLMD9QnGc3Y/tE+kN3EljkAXWIbUh lJlA8j9ovpMIFQlzkhYLcRvkECdccollGwkLVLOMwWWw0JHXRD+tTcb7Xrs8jc3hMx pzSViF9mlxthCjWrEsWbM7QtT70O32qkbkIUYCB8vTWKFhzhLI78FQNb6yMKmRA8av D7oDPfychpgui0ZXhRRk6AJnMfuBIjKrvF4h6IMxL3ntWk6MUmeXQPc/mg9Yu25Lcx G5fK4QJj3SYVcP/UjzHMEE6VyH8Z7g+AvDJufv4KmSvlHFViDjkIYxKQBKkpnONLKM 4R299+a7xwYsNMRRwbPbLySzpJepvdWnubcc1lbe6fn2Kimdo6K+zEHrgiZXfJLA63 SawvloG7paoBz0vCXaaQpxVosiK1+fH6rTmpNM15kxPPMDG8r8IznuJAHIAEqwwt0h 6DxJEnaX/Dpk3Q9t79fs+FPfWiC2wwjpW28wTbOU9OdSkBj4ayRCqg7CEuGGW4cSML xgbihkeqpQSKoiMZ6rKxepcRGvb3qJoXeapSF/60mYj9zyERRbZGnngzC5q4BXyzyW q8gRJLaeNnwZbruv3zTKec24= From: Tomas Volf <~@wolfsden.cz> Date: Thu, 15 Feb 2024 21:26:14 +0100 Message-ID: <3142134916e56f2b51bf3f496c3b2d9d3a4ac541.1708028701.git.~@wolfsden.cz> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: 4.02 X-Spam-Score: 4.02 X-Migadu-Queue-Id: 35CF645405 X-Migadu-Scanner: mx13.migadu.com X-TUID: R2IMVNccaHbU If crate A used by application B needs some package (for example protobuf in my case) during a build, there was no way to propagate the information. The application B would need to explicitly add (native-inputs). And each user of crate A would need to do that. I think that is not optimal, therefore this commit adds new #:cargo-native-inputs argument to the cargo-build-system. It allows propagating native dependencies to users of the crates. * guix/build-system/cargo.scm (package-cargo-native-inputs): New procedure. (lower): New keyword argument cargo-native-inputs. (lower)[private-keywords]: Add #:cargo-native-inputs. (lower)[bag]: Use cargo-native-inputs. * doc/guix.texi: Document it. Change-Id: I39c35db4d17842cd7633cf2c1b7d90b74de07679 --- doc/guix.texi | 4 +++- guix/build-system/cargo.scm | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index bb0af26d93..3d43ed6dd5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9428,7 +9428,9 @@ Build Systems evaluate to a path to a gzipped tarball which includes a @code{Cargo.toml} file at its root, or it will be ignored. Similarly, cargo dev-dependencies should be added to the package definition via the -@code{#:cargo-development-inputs} parameter. +@code{#:cargo-development-inputs} parameter. Additionally, if some +native dependencies are required during a build of a dependent package, +you can use @code{#:cargo-native-inputs} to specify such packages. In its @code{configure} phase, this build system will make any source inputs specified in the @code{#:cargo-inputs} and @code{#:cargo-development-inputs} diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm index c029cc1dda..170a1f70b6 100644 --- a/guix/build-system/cargo.scm +++ b/guix/build-system/cargo.scm @@ -207,6 +207,12 @@ (define (package-cargo-development-inputs p) cargo-development-inputs) (package-arguments p))) +(define (package-cargo-native-inputs p) + (apply + (lambda* (#:key (cargo-native-inputs '()) #:allow-other-keys) + cargo-native-inputs) + (package-arguments p))) + (define (crate-closure inputs) "Return the closure of INPUTS when considering the 'cargo-inputs' and 'cargod-dev-deps' edges. Omit duplicate inputs, except for those @@ -308,13 +314,14 @@ (define* (lower name (rust-sysroot (default-rust-sysroot target)) (cargo-inputs '()) (cargo-development-inputs '()) + (cargo-native-inputs '()) #:allow-other-keys #:rest arguments) "Return a bag for NAME." (define private-keywords `(#:rust #:inputs #:native-inputs #:outputs - #:cargo-inputs #:cargo-development-inputs + #:cargo-inputs #:cargo-development-inputs #:cargo-native-inputs #:rust-sysroot ,@(if target '() '(#:target)))) @@ -338,6 +345,14 @@ (define* (lower name ,@(if target '() inputs) ;,@inputs + ,@(apply append + cargo-native-inputs + (map (match-lambda + ((tag pkg) + (package-cargo-native-inputs pkg))) + (crate-closure (append cargo-inputs + cargo-development-inputs)))) + ,@(if target ;; Use the standard cross inputs of ;; 'gnu-build-system'. -- 2.41.0