From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +BTYKT/oeGINpgAAbAwnHQ (envelope-from ) for ; Mon, 09 May 2022 12:09:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oOqbKT/oeGIdKwEAauVa8A (envelope-from ) for ; Mon, 09 May 2022 12:09:03 +0200 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 4DA033E17B for ; Mon, 9 May 2022 12:09:03 +0200 (CEST) Received: from localhost ([::1]:50012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no0K6-00043d-DQ for larch@yhetil.org; Mon, 09 May 2022 06:09:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no0Dz-00083N-CU for guix-devel@gnu.org; Mon, 09 May 2022 06:02:43 -0400 Received: from flashner.co.il ([178.62.234.194]:45414) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no0Dx-0006bF-CS for guix-devel@gnu.org; Mon, 09 May 2022 06:02:43 -0400 Received: from localhost (unknown [37.46.46.12]) by flashner.co.il (Postfix) with ESMTPSA id B8A4340147; Mon, 9 May 2022 10:02:39 +0000 (UTC) Date: Mon, 9 May 2022 13:02:06 +0300 From: Efraim Flashner To: Maxime Devos Cc: guix-devel@gnu.org Subject: Re: Packaging rust crates without compiling dependencies again for every dependent (wasting build time) Message-ID: Mail-Followup-To: Maxime Devos , guix-devel@gnu.org References: <5150e37c32f636a50574359fb0d1a3fbfc836367.camel@telenet.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6gFa5HXK3rnnKjmQ" Content-Disposition: inline In-Reply-To: <5150e37c32f636a50574359fb0d1a3fbfc836367.camel@telenet.be> 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 Received-SPF: pass client-ip=178.62.234.194; envelope-from=efraim@flashner.co.il; helo=flashner.co.il X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652090943; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=iaOXfg3w5Nh9XkOWaYLJKw6uVwQcz3am8qGvooRJbJk=; b=hmlsUqD00xrLI2Zh8lGQfh1CQ18L/pJo10kMySX7PK+1RzcbQ7U4VqNjzgXI+Ac85XbDVp a7Tl+1HgKktffShcGyeXBmJYTXbLpCJMYsCNhd4v/C37jFsSVBtCWRyZU8zyV5X2tVjBCR SICp+V+EYwHFF9QOMdTqlEQFWbVMyQ7A5cPqochrPa/D17yc0pKEGn6rY0XFWr4J4bc8v9 j+IZ34y9p4nM9BQmMr38MBye3baMPsR6BhCI+UUAuGd8jyqBACjwMV2mRXNRZ2rTZXl9wR gX/RMVeijl+n6focNoFA3eUXADWeW5KPZqmHmxIMdxqXsK+utuuqLNkCHydvhw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652090943; a=rsa-sha256; cv=none; b=TJq7dR6YJvPX9MIcRyJHPutIKNj4BPrEMJdFEt5pRbqArVktyEcT92X27DkAJVpJk+6gjV 9MMZ5EcQ/+TIZ1fewWeScPTFJvJnrMSyXphiTnu/9CTGRyrlvX6QrSyW945Tqt/C+JKaGW OGYcqI0a75frOmxKc6AQW+c5bIDunb+HljNxGHuQ4kP+SEyZGrPbhpkjD75cGPJ0HwHdsh SHsGpC1ONTyiQzkiqLN7BXBAETdbBPsdI6DQuvZu77B1mo6W8NizN0Wb7zvNkPEIAouT9w lSZT3olFh5hB9KIuwz84eOhSomz3Z5jQke3nGGD/zIPkKZzaAhwsguGwuGdpbA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.90 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4DA033E17B X-Spam-Score: -4.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: 32agolBdsKth --6gFa5HXK3rnnKjmQ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 30, 2022 at 11:29:25AM +0200, Maxime Devos wrote: > Hi various distributions packaging rust things (^), >=20 > Currently, most (all?) distributions seem to package =E2=80=98source-only > crates=E2=80=99, which when =E2=80=98compiled=E2=80=99, just copy some so= urce code to a > location. This works, but the downside is that if both a package X and > a package Y depends on rust-Z, then rust-Z will effectively be compiled > twice: when building X, but also when building Y. >=20 > This seems a waste of compilation time to me, so I've been writing a > build tool =E2=80=98antioxidant=E2=80=99 (*) for the distribution Guix th= at avoids > double compilation, at > ). >=20 > To avoid the double compilation things, antioxidant calls the > underlying rustc by itself instead of cargo, and it reads and > interprets Cargo.toml by itself instead of letting cargo do that. >=20 > Currently, it's rather Guix-specific, but in principle it should be > possible to turn it in some binary 'antioxidant' that could be used on > other distributions as well if someone is interested in that, e.g. > something like >=20 > $ # (not implemented yet!) > $ antioxidant configure --prefix=3D$HOME/extra-software -Lcrate=3D/usr/li= b/crates -L/usr/lib -Lcrate=3D$HOME/extra-software/lib/crates --features=3D= x,y,z > $ antioxidant make > $ antioxidant make check > $ antioxidant make install DESTDIR=3D... # this does not install source c= ode, only the compiled crates >=20 > (*) A =E2=80=98build system=E2=80=99, in Guix terminology. >=20 > Currently, it can succesfully compile 'hexyl', 'sniffglue' and all > their dependencies. I'm working on addressing limitations that > prevent antioxidant from compiling other binaries (currently trying > to make 'agate' and all its dependencies compile). >=20 > Greetings, > Maxime. >=20 > (^) If you are reading this from guix-devel@: some of the distributions I > intend to contact have a no-crossposting policy, so I'm first sending thi= s to > guix-devel@, then sending some mails to individual distributions with a l= ink > to this e-mail. This is really really cool! Thanks for sharing it. I noticed that there are a number of crates that you remove unconditionally, would it help if we patched them out of the crates that are in Guix? I'm glad you found a use for (target-64bit?), it seemed too useful to not have in Guix :) It took me less than 3 minutes to download and build all the sources for the three packages! It looks to be faster than building the packages straight, and with the benefit of incremental compilation. --=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 --6gFa5HXK3rnnKjmQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmJ45psACgkQQarn3Mo9 g1FqVg/9Hf/tCdFIM9BYMyD6ulI8lgBZN0w0c+psuEPh4J4UVxDEoxFb7/7VUkBX WdbyjM7SyjoRWfUwRt2baOceR4LRc0fmc0/ZFCfQmnwEPe4z6gxnDjMHIpWYVhbk apAFxpAnoqdwXD5sNXeXGUqwcaKE9OA4gfqpFumUxbB9uOTNOIE8sstbkEgFDcwL L8PSdpY7VvNV/NaalJj+rPCt9ErfMkDMdBtaTQq2+5Yzk3ppUA3WHV87smmJNYg9 MTG1AkNtQgNmxKIRXIqzKO4bYakT45i8TnePPo5ygXLTTC9PN6l0VJFutn51OV8w FYXOt1xcR29SfqhtYUCAmg2ffrUXL8N/2oDC6k1Hy7ktNQBXJOiQ+G95QeELO2th viCKORHxZ9YfAraWYGYjQFWsz05u4/oMTh++jPLEksaE6ZhIChoilvRM3qiwNo6c MwWIMDlcZ64GddC6fh+n6qj5zee9DZAOFjPj6ZCpFz2ppeL6U/Z07+eb0Scj310Q G8St6WLmrLxfh/n4ur/f1ziDUeNAWmU3YtuwCQRaECFCSSwFy5JQi7/Bcu5mMokx GS3ANF2gU0Y71OwLhpw+sxJsgUm605jdK0RUYViNx999YkCYbGq9NK0YDbc/EWeB gqTYQ8+AW9mpAx6+5UpOWh+4rfOfBaBPw4jd3E+tn+lw+5lSocU= =m28P -----END PGP SIGNATURE----- --6gFa5HXK3rnnKjmQ--