From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:51352) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3ccJ-0004Nb-L3 for guix-patches@gnu.org; Mon, 17 Feb 2020 04:23:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3ccI-0000Uy-E7 for guix-patches@gnu.org; Mon, 17 Feb 2020 04:23:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60251) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3ccI-0000Uh-Am for guix-patches@gnu.org; Mon, 17 Feb 2020 04:23:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j3ccI-0002Un-7q for guix-patches@gnu.org; Mon, 17 Feb 2020 04:23:02 -0500 Subject: [bug#39640] [PATCH] doc: Document packaging guidelines for Rust crates. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:51268) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3cbq-0003wU-1Q for guix-patches@gnu.org; Mon, 17 Feb 2020 04:22:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3cbo-0008L2-RF for guix-patches@gnu.org; Mon, 17 Feb 2020 04:22:33 -0500 Received: from flashner.co.il ([178.62.234.194]:53758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j3cbo-0008KU-Lt for guix-patches@gnu.org; Mon, 17 Feb 2020 04:22:32 -0500 From: Efraim Flashner Date: Mon, 17 Feb 2020 11:21:59 +0200 Message-Id: <20200217092159.776-1-efraim@flashner.co.il> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39640@debbugs.gnu.org Cc: Efraim Flashner * doc/contributing.texi (Rust Crates): New section. --- doc/contributing.texi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/doc/contributing.texi b/doc/contributing.texi index c6586a2adf..2fb641f0c5 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -347,6 +347,7 @@ needed is to review and apply the patch. * Python Modules:: A touch of British comedy. * Perl Modules:: Little pearls. * Java Packages:: Coffee break. +* Rust Crates:: Beware of oxidation. * Fonts:: Fond of fonts. @end menu =20 @@ -665,6 +666,39 @@ are also prepended by @code{perl-}. Such modules te= nd to have the word prefix. For instance, @code{libwww-perl} becomes @code{perl-libwww}. =20 =20 +@node Rust Crates +@subsection Rust Crates + +@cindex rust +Rust programs standing for themselves are named as any other package, us= ing the +lowercase upstream name. + +To prevent namespace collisions we prefix all other rust packages with t= he +@code{rust-} prefix. The name should be changed to lowercase as appropr= iate and +dashes should remain in place. + +In the rust ecosystem it is common for multiple incompatable versions of= a +package to be used at any given time, so all packages should have a vers= ioned +suffix. If a package has passed version 1.0.0 then just the major versi= on +number is sufficient (e.g.@: rust-clap-2), otherwise the version suffix = should +contain the major and minor version (e.g.@: rust-rand-0.6). + +Because of the difficulty in reusing rust packages as pre-compiled input= s for +other packages the @xref{cargo-build-system} presents the @code{#:cargo-= inputs} +and @code{cargo-development-inputs} keywords as build-system arguments. = It +would be helpful to think of these as similar to @code{propagated-inputs= } and +@code{native-inputs}. Rust @code{dependencies} and @code{build-dependen= cies} +should go in @code{#:cargo-inputs}, and @code{dev-dependencies} should g= o in +@code{#:cargo-development-inputs}. If a rust package links to other lib= raries +then the standard placement in @code{inputs} and the like should be used= . + +Care should be taken to ensure the correct version of dependencies are u= sed; to +this end we try to refrain from skipping the tests or using @code{#:skip= -build?} +when possible. Of course this is not always possible, as the package ma= y be +developed for a different Operating System, depend on features from the = Nightly +Rust compiler, or the test suite may have atrophied since it was release= d. + + @node Java Packages @subsection Java Packages =20 --=20 2.25.0