From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:54062) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icKbJ-0002yT-Jz for guix-patches@gnu.org; Tue, 03 Dec 2019 21:41:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icKbA-0001Aq-Es for guix-patches@gnu.org; Tue, 03 Dec 2019 21:41:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35338) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icKbA-00015p-9b for guix-patches@gnu.org; Tue, 03 Dec 2019 21:41:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1icKb8-0006XT-8X for guix-patches@gnu.org; Tue, 03 Dec 2019 21:41:02 -0500 Subject: [bug#38408] [PATCH] WIP patches for the rust importer Resent-Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_D518F4AF-0895-48A5-AF2A-7DA9A874CD1C" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) From: Ivan Petkov In-Reply-To: <785501a89e81d30db021047529e7262e@riseup.net> 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> 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: Martin Becze Cc: guix-devel@gnu.org, 38408@debbugs.gnu.org, Efraim Flashner --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--