From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Petkov Subject: Re: [PATCH] WIP patches for the rust importer Date: Tue, 3 Dec 2019 18:40:37 -0800 Message-ID: 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> <322B85FF-6EA4-492E-B96A-1F326ADD136E@gmail.com> <785501a89e81d30db021047529e7262e@riseup.net> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_D518F4AF-0895-48A5-AF2A-7DA9A874CD1C" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53466) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icKb3-0002sJ-QI for guix-devel@gnu.org; Tue, 03 Dec 2019 21:41:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icKau-00009L-SO for guix-devel@gnu.org; Tue, 03 Dec 2019 21:40:53 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:35412) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icKau-0008FV-GR for guix-devel@gnu.org; Tue, 03 Dec 2019 21:40:48 -0500 Received: by mail-pl1-x643.google.com with SMTP id s10so2503476plp.2 for ; Tue, 03 Dec 2019 18:40:44 -0800 (PST) In-Reply-To: <785501a89e81d30db021047529e7262e@riseup.net> 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=_D518F4AF-0895-48A5-AF2A-7DA9A874CD1C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Martin, > On Dec 2, 2019, at 3:10 PM, Martin Becze wrote: >=20 > When you say source import of the transitive dependencies, do you mean > that all the rust libs should just be source only or do you mean the = top > level package should have to declare all the transitive dependencies? All rust libs should be source only imports, but each package definition should only declare dependencies on the crates it consumes directly and guix should figure out the rest (in other words, I=E2=80=99d expect = there to be a=20 one-to-one mapping between a Cargo.toml and a package definition). For example, if crate foo depends on crate bar which depends on crate baz, I=E2=80=99d expect the definitions to look like: (define-public rust-foo (package (name =E2=80=9Crust-foo") (source-input `((=E2=80=9Cbar=E2=80=9D ,bar))))) (define-public rust-bar (package (name =E2=80=9Crust-bar") (source-input `((=E2=80=9Cbaz=E2=80=9D ,baz))))) (define-public rust-baz (package (name =E2=80=9Crust-baz"))) But while building foo (assuming it is some kind of application), guix would ensure that bar and baz are available in the build environment. IMO this direction would be the most maintainable in the long term. =E2=80=94Ivan= --Apple-Mail=_D518F4AF-0895-48A5-AF2A-7DA9A874CD1C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = Martin,

On Dec 2, 2019, at 3:10 PM, Martin Becze = <mjbecze@riseup.net> wrote:

When you say source import of = the transitive dependencies, do you mean
that all the rust libs should just be source only or do you = mean the top
level package = should have to declare all the transitive dependencies?

All rust libs = should be source only imports, but each package = definition
should only declare dependencies on the crates it = consumes directly and
guix should figure out the rest (in = other words, I=E2=80=99d expect there to be a 
one-to-one = mapping between a Cargo.toml and a package definition).

For example, if crate foo depends on crate bar = which depends on crate
baz, I=E2=80=99d expect the definitions = to look like:

(define-public = rust-foo
  (package
    (name = =E2=80=9Crust-foo")
    (source-input `((=E2=80=9Cbar=E2= =80=9D ,bar)))))

(define-public = rust-bar
  (package
    (name = =E2=80=9Crust-bar")
    (source-input `((=E2=80=9Cbaz=E2= =80=9D ,baz)))))

(define-public = rust-baz
  (package
    (name = =E2=80=9Crust-baz")))

But while building foo (assuming it is some kind of = application), guix
would ensure that bar and baz = are available in the build environment.

IMO this direction would be the most = maintainable in the long term.

=E2=80=94Ivan
= --Apple-Mail=_D518F4AF-0895-48A5-AF2A-7DA9A874CD1C--