From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Petkov Subject: Re: [PATCH] WIP patches for the rust importer Date: Sun, 1 Dec 2019 20:01:26 -0800 Message-ID: <322B85FF-6EA4-492E-B96A-1F326ADD136E@gmail.com> References: <20191126120408.GL1124@E5400> <1E01C051-2EE5-4050-B826-C60E858AAC2B@flashner.co.il> <0b2db52d687fc2acf34dc1e00618dae7.squirrel@sm.riseup.net> <20191128122255.GT1124@E5400> <8981451ac5d914dd5f53fa928741b846@riseup.net> <20191201085941.GB14869@E5400> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_F3ED1432-ACEA-4F8F-A09C-12381BC7F30D" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:42930) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibctv-0003Ob-Ve for guix-devel@gnu.org; Sun, 01 Dec 2019 23:01:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibctu-0007nS-Hn for guix-devel@gnu.org; Sun, 01 Dec 2019 23:01:31 -0500 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:42606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ibctu-0007lg-8S for guix-devel@gnu.org; Sun, 01 Dec 2019 23:01:30 -0500 Received: by mail-pj1-x1044.google.com with SMTP id o11so1711186pjp.9 for ; Sun, 01 Dec 2019 20:01:29 -0800 (PST) In-Reply-To: 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.org@gnu.org Sender: "Guix-devel" To: Martin Becze Cc: guix-devel@gnu.org, 38408@debbugs.gnu.org --Apple-Mail=_F3ED1432-ACEA-4F8F-A09C-12381BC7F30D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Martin! > On Dec 1, 2019, at 7:17 PM, Martin Becze wrote: >=20 > oh to be more clear. Even with "#:skip-build? #t" on all the rust = libs, > things fail if I omit one optional dependency from somewhere. I'm just > testing on hello-cli but hello-cli inculdes clap which has alot of > optional deps. In ./guix/build-systems/cargo.scm on line 186 it says=20= >=20 > "Cargo requires all transitive crate dependencies' sources to be > available > in its index, even if they are optional (this is so it can generate > deterministic Cargo.lock files regardless of the target platform or > enabled > features). Thus we need all transitive crate dependencies for any = cargo > dev-dependencies, but this is only needed when building/testing a = crate > directly > (i.e. we will never need transitive dev-dependencies for any = dependency > crates)." >=20 > I haven't really dug into the cargo build-system yet but my guess is > that the problem lies there. Allllsooo i totally could have missed > something simple.. idk Yes, this is the primary limitation of packaging rust crates into guix without manually needing to edit the Cargo.toml definition. My opinion is that the easiest (to maintain) method for incorporating rust packages into guix is to bite the bullet and perform a (source) import of all transitive dependencies that a package might need. Manually keeping up with tweaking the Cargo.toml file for every single potential package, across every single published version will make you go mad :) Then the challenge would be how to automate the incremental importing from crates.io (for example, some crates require a = specific x.y.z version of a dependency, some are willing to work with x.y.*, some have ranges, = etc.) and making sure that all packaged crates point to the appropriate = dependencies as they get updated in guix. =E2=80=94Ivan= --Apple-Mail=_F3ED1432-ACEA-4F8F-A09C-12381BC7F30D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = Martin!

On Dec 1, 2019, at 7:17 PM, Martin Becze = <mjbecze@riseup.net> wrote:

oh to be more clear. Even with = "#:skip-build? #t" on all the rust libs,
things fail if I omit one optional dependency from somewhere. = I'm just
testing on = hello-cli but hello-cli inculdes clap which has alot of
optional deps. In = ./guix/build-systems/cargo.scm on line 186 it says 

"Cargo requires all transitive = crate dependencies' sources to be
available
in its index, even if they are optional (this is so it can = generate
deterministic = Cargo.lock files regardless of the target platform or
enabled
features). Thus we need all = transitive crate dependencies for any cargo
dev-dependencies, but this is = only needed when building/testing a crate
directly
(i.e. we will never need transitive dev-dependencies for any = dependency
crates)."

I haven't really dug into the cargo build-system yet but my = guess is
that the = problem lies there. Allllsooo i totally could have missed
something simple.. = idk

Yes, = this is the primary limitation of packaging rust crates into = guix
without manually needing to edit the = Cargo.toml definition.

My opinion is that the easiest (to maintain) method for = incorporating
rust packages into guix is to bite = the bullet and perform a (source)
import of all = transitive dependencies that a package might need.
Manually keeping up with tweaking the Cargo.toml file for = every single
potential package, across every single = published version will make
you go mad :)

Then the challenge would = be how to automate the incremental importing
from = crates.io (for example, = some crates require a specific x.y.z version of
a = dependency, some are willing to work with x.y.*, some have ranges, = etc.)
and making sure that all packaged crates = point to the appropriate dependencies
as they get = updated in guix.

=E2=80=94Ivan
= --Apple-Mail=_F3ED1432-ACEA-4F8F-A09C-12381BC7F30D--