From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: rust-build-system: Unvendor *-sys libraries in phase? Date: Sat, 25 Jan 2020 20:49:59 +0200 Message-ID: <20200125184959.GM1603@E5400> References: <6C5117EB-3049-4DDA-A343-3BDFAFB24CE0@asu.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yaap9KN+GmBP785v" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:60633) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ivQWN-0003SS-I6 for guix-devel@gnu.org; Sat, 25 Jan 2020 13:51:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ivQWM-00016o-EC for guix-devel@gnu.org; Sat, 25 Jan 2020 13:51:03 -0500 Received: from flashner.co.il ([178.62.234.194]:55666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ivQWM-0000WQ-7i for guix-devel@gnu.org; Sat, 25 Jan 2020 13:51:02 -0500 Content-Disposition: inline In-Reply-To: <6C5117EB-3049-4DDA-A343-3BDFAFB24CE0@asu.edu> 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+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: John Soo Cc: Guix-devel --yaap9KN+GmBP785v Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 24, 2020 at 01:49:21PM -0800, John Soo wrote: > Hi guix, >=20 > After working on a few rust packages, it looks like there could be anothe= r step on the process. There are a number of libraries in the crates regis= try that wrap and vendor c libraries - libgit2, openssl, or jemalloc for ex= ample. The wrapping libraries, for reference, are usually called -sys - libgit2-sys for example. >=20 > In the current rust-build-system, the onus of removing the vendored code = falls on the ultimate consumer of the library. So, for instance, cbindgen w= ould have to define a phase to remove the vendored code in a *-sys library = even if that library is a transitive dependency. >=20 > What would you all think about adding a phase to the standard phases of t= he rust-build-system? I=E2=80=99m imagining some phase that would delete th= e vendored code and performed the other necessary steps to use the c librar= ies in /gnu/store. >=20 > Wdyt? IMO the correct way to do it would be in the crate source that we download. We regularly add snippets to remove vendored code, this should be no different. The only real difference is that right now the cargo-build-system is "too smart" and checks the #:cargo-inputs to make sure they actually are crates before untarring them and putting them in the guix-vendor dor. Currently the 'patch-and-rezip phase always uses xz for compression, and crates always use gzip, so we cannot use patches or snippets on crates. IMO the easiest way around this is to unconditionally untar anything in #:cargo-inputs into guix-vendor/ and continue on. Then the only thing left is to set certain environment variables, some of which can probably be moved to the cargo-build-system if they don't require an actual path. LIB(GIT|SSH)2_SYS_USE_PKG_CONFIG can move, JEMALLOC_OVERRIDE and LIBCLANG_PATH can't. --=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 --yaap9KN+GmBP785v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl4sjdQACgkQQarn3Mo9 g1GsEA/8CGZBpVqp6O4mGUvlfFRtuFyhYPtXcWkGlZihcuJvB7yc6B/WxYT+q278 lsl6CBKivukXI11WOIgb8ai/3uHJILuFNfgcjcyT+uTAHGfuPT+Pp0RvrrRaZfYI OqNyqbWsT2dyMGVbUqgliXlnlmfFX3zBcU1wpU9qr3YW1wDeO9SWM1/J4EuE7suV r66/lKqMg5fp/CXM8PQcx43Ejo0zZMz7x53dxEkqrSi80fUJvhlVnBkcAfA2m4ok nsUKGn1QtejZjQQpC4lKYCSs+fXDfowoYkleXJXUfOEXv4BCA/XsC0qplCxD13UE 5ziUwTxLpTTZVslsBBKP34uJnLpEAdSf+wv1pgeRlHONMMbnvRjQBr+N2orZLZXQ XPrUGu1rMcaVPmIXspiZ2agudm6ZQhW8D4rpTI9owOL26+qCFR83kTlH8A1z9rW1 6XVfORCSdq7YOvw4kx7uytbuMJcy00DkXx4L9RKvqF+quaA4IzakDObBbBWniaMM Klq+NMAYeX8Zsvy2b9RdXmOKDWqHHa2s6G7Yrc/Bb+ODGG7A8+MeixW6nXi4vTym Wc29gHQ56CR82w2K7vTqBlm8WfaIPSYiMQaENmIM6arbyNLy6N8+UGxpUcOxOHFV uAGCbq5spDjhymNCQtUypi0huEKMfXz14mPMzICBOJMkrmE6kio= =UN5B -----END PGP SIGNATURE----- --yaap9KN+GmBP785v--