From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aNpCOXeCdWCgZQEAgWs5BA (envelope-from ) for ; Tue, 13 Apr 2021 13:37:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aJP/MXeCdWBkHQAAbx9fmQ (envelope-from ) for ; Tue, 13 Apr 2021 11:37:27 +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 5799E1111C for ; Tue, 13 Apr 2021 13:37:27 +0200 (CEST) Received: from localhost ([::1]:50012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWHMD-0005E4-QS for larch@yhetil.org; Tue, 13 Apr 2021 07:37:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWHLr-0004zK-37 for guix-patches@gnu.org; Tue, 13 Apr 2021 07:37:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWHLq-0004nc-2f for guix-patches@gnu.org; Tue, 13 Apr 2021 07:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lWHLp-0001H3-W0 for guix-patches@gnu.org; Tue, 13 Apr 2021 07:37:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#46399] [PATCH] build-system/cargo: Propagate crates across builds. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Apr 2021 11:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46399 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "pelzflorian (Florian Pelz)" Cc: 46399@debbugs.gnu.org Received: via spool by 46399-submit@debbugs.gnu.org id=B46399.16183137894828 (code B ref 46399); Tue, 13 Apr 2021 11:37:01 +0000 Received: (at 46399) by debbugs.gnu.org; 13 Apr 2021 11:36:29 +0000 Received: from localhost ([127.0.0.1]:59045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWHLI-0001Fn-PO for submit@debbugs.gnu.org; Tue, 13 Apr 2021 07:36:29 -0400 Received: from flashner.co.il ([178.62.234.194]:55438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWHLG-0001Fb-Nz for 46399@debbugs.gnu.org; Tue, 13 Apr 2021 07:36:27 -0400 Received: from localhost (unknown [31.210.177.71]) by flashner.co.il (Postfix) with ESMTPSA id E2489405C9; Tue, 13 Apr 2021 11:36:20 +0000 (UTC) Date: Mon, 12 Apr 2021 09:40:17 +0300 From: Efraim Flashner Message-ID: References: <20210209105843.13230-1-efraim@flashner.co.il> <20210411151052.ckjjpbrpqgfp43tl@pelzflorian.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cAcawkTHnLZa8BNk" Content-Disposition: inline In-Reply-To: <20210411151052.ckjjpbrpqgfp43tl@pelzflorian.localdomain> 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618313847; 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=gjhHvo4ZPzJbNNYz/opuu78Wn+dbv6ZHDJZMvdofcjw=; b=LFl2WpneyP+T6RvsIjN0jukDBFOngqzWACC0XkD5bzrv5V7v4kS4VuogVkjLvr1fAZ2/hR UdsKXP1zm0coGYHBVnnDOA0pMPFkXEK3v6iWM2uFNngxzXixkyYxdfkkRcXo6F/AGDCqt+ I4sxA1OjBgqeQsEGKEbs6CkGSR1iPZIjbxPHP6HzyznsOdclViZ/lG9WRJKctl/3g47Hpv E5gOpWsz/aZarZmV8Eh2daGcDAd+gg7WeK5wZP4EYH/5bC8o4fIRMBkwPQ0pHKti1Sc6ap HpXGesVkKq8GGJ6c+dy0EMnj+I9/DxHFKXbP/FdwDS+ANXw2tJmWtgcH4EgU/w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618313847; a=rsa-sha256; cv=none; b=mygF59RfNUlAiF0rBRA5fOgi3aNL6B6qFjuWkckwuUEMZ7FGlO/hS7d/Bc8cYQqmM+mAsw Jl/aZenc1Duu88Q+PULy//g/dQXgFDDbjpCKKKQGit8AjMSf97vyya17mef3keK+7uYZoA pFu2GnmWWh9q8VviUtqSU+Xs1dQWx9JMJDmt0eTz6Oekq4/4RL/1Km51k/X+QTq1cxB4N5 Y8D5lcftayDIsVs4FfiW0qyx1buYhLe79C6V9THdiz4kxFovbhdttZl462ySn/1/TKgD4s dQwxu4CmO3hEfUxwpyO2Tow4QhsWsuYN8Y62rh3UfJq8EFYzuRb9vMqZsiH3aQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.04 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 5799E1111C X-Spam-Score: -3.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: E93JorlUogtd --cAcawkTHnLZa8BNk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 11, 2021 at 05:11:21PM +0200, pelzflorian (Florian Pelz) wrote: > Hello Efraim! >=20 > Thank you for improving Rust development with Guix. I have a question > about this change to doc/guix.texi when translating. Sorry for > noticing so late just before the string freeze. >=20 > On Tue, Feb 09, 2021 at 12:58:43PM +0200, Efraim Flashner wrote: > > diff --git a/doc/guix.texi b/doc/guix.texi > > index 7d18703283..0d153a1470 100644 > > --- a/doc/guix.texi > > +++ b/doc/guix.texi > > [=E2=80=A6] > > @@ -7437,8 +7437,10 @@ supports builds of packages using Cargo, the bui= ld tool of the > > It adds @code{rustc} and @code{cargo} to the set of inputs. > > A different Rust package can be specified with the @code{#:rust} param= eter. > > =20 > > -Regular cargo dependencies should be added to the package definition v= ia the > > -@code{#:cargo-inputs} parameter as a list of name and spec pairs, wher= e the > > +Regular cargo dependencies should be added to the package definition s= imilarly > > +to other packages; those needed only at build time to native-inputs, o= thers to > > +inputs. If you need to add source-only crates then you should add the= m to via > > +the @code{#:cargo-inputs} parameter as a list of name and spec pairs, = where the > > spec can be a package or a source definition. Note that the spec must > > evaluate to a path to a gzipped tarball which includes a @code{Cargo.t= oml} > > file at its root, or it will be ignored. Similarly, cargo dev-depende= ncies >=20 > I have no experience in Rust. Do I understand correctly that > source-only crates among the inputs should be added both to inputs and > to #:cargo-inputs? Is the >=20 > > +inputs. If you need to add source-only crates then you should add the= m to via >=20 > a typo which should read =E2=80=9Cadd them too=E2=80=9D instead of =E2=80= =9Cadd them to=E2=80=9D? I went back and refreshed myself with what I wrote there. source-only crates should be added to both regular inputs and to #:cargo-inputs. Actually converting the ~1000 rust packages to actually make good use of the changes will allow us to drop nearly all the #:cargo-inputs and just use regular inputs, but until then we still need the propagated source magic that comes from #:cargo-inputs. Yes, definitely a typo, it should be "add them too". > I look at the subsequent change > f35ab79e033aa8e4955e9c9100c74ecbb3ce4d0b to rust-wayland-commons >=20 > > diff --git a/gnu/packages/crates-graphics.scm b/gnu/packages/crates-gra= phics.scm > > index d67e9dc02f..7dde00ffdb 100644 > > --- a/gnu/packages/crates-graphics.scm > > +++ b/gnu/packages/crates-graphics.scm > > @@ -2415,8 +2415,11 @@ the wayland protocol, client side.") > > (arguments > > - `(#:skip-build? #t > > - #:cargo-inputs > > + `(#:cargo-inputs > > (("rust-nix" ,rust-nix-0.18) > > ("rust-once-cell" ,rust-once-cell-1) > > - ("rust-smallvec" ,rust-smallvec-1) > > - ("rust-wayland-sys" ,rust-wayland-sys-0.28)))) > > + ("rust-smallvec" ,rust-smallvec-1)))) > > + (inputs > > + `(("rust-nix" ,rust-nix-0.18) > > + ("rust-once-cell" ,rust-once-cell-1) > > + ("rust-smallvec" ,rust-smallvec-1) > > + ("rust-wayland-sys" ,rust-wayland-sys-0.28))) > > (home-page "https://github.com/smithay/wayland-rs") >=20 > and do not understand why rust-wayland-sys is only part of inputs but > rust-once-cell is also among the cargo-inputs. Also the inputs are > empty for older versions of rust-wayland-commons. #:cargo-inputs are "magic" in that they propagate their own #:cargo-inputs to future builds. The changes to the cargo-build-system mimic this so we can use regular inputs and not #:cargo-inputs. rust-wayland-sys-0.28 has enough of its dependencies converted that it can be used as just an input but rust-once-cell-1 hasn't yet so it still needs to be in #:cargo-inputs. As far as the other versions of rust-wayland-commons, I started by focusing on alacritty so we could remove some of the build phases and move them to the crates which actually needed patching. > Could you clarify what is written in the doc/guix.texi? >=20 > Regards, > Florian I think for now the best option is to add the rust inputs of all types to both inputs and #:cargo-inputs (or native-inputs and #:cargo-development-inputs) and then remove them from #:cargo-inputs when it's possible to do so. Ultimately Someone=E2=84=A2 should revive the wip-rust branch and convert all the crates over in one go and adjust the importer and manual. --=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 --cAcawkTHnLZa8BNk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmBz604ACgkQQarn3Mo9 g1EE2BAAo853e56xlnVuZG/r1qvzIBBZqZS/9EYrD17pRH+cUgQPYsLaYrNzy04r 3j8XPn0t1bOWSiVh08s4OY6kcvvFgNPy8QnAQz319ocvgthh0bXyEKsvvPCFCrQg Np+NSr48r8ZVu6blZhWL+fZ3SAWLB69Yyb6gQZy5P/0EsnulJdNfSgOEB4rfmzh8 OMr1a5B6cv3GnJLS7x7K3QSGWxSxMDoHTX8oj0Ze8PQLrH8J8n9joujte+xOhQGx WgDVm09Xrk/1iXXjvCIzbPQ3JIvDZ+a92sU91IYkwV6S9G2D7O/vJGIN9IKExfJP BfZgoWH2mk2U0HKunhLY9z9Ot6JgUi6WuX7tXQXE5cNN4kktLqTA3f7fEUSwyK2L Q8O8WsnSqmkUuECyVY/tQTDGHDdl92dgqldol3cCKJ4KJPFYR21p9H/SZsYgk76C uEbGZW+Q1rYD+Fc9hVTlzX6Y766suuGr4CuhTW4rHYUOo/Pa1nPfHFjsz2ZIx0tD G7jRSXiJtiTPsYCTbTS/DnHaWKLxAXlO+ZukUXPeqmWWAs7bVBbhFf8YFHK6FHHd unWeinAJiUCSlYFTIOqx/yHFry5ozab0GaF/1nGDBCbskyJGhSIoHUuoVgKg5bie O2keEzAgI+KjUlSlaRBF112GEmYcJeLGJUGxoDpzxW7B4p26JHo= =zcEO -----END PGP SIGNATURE----- --cAcawkTHnLZa8BNk--