Hi Ludo,

Am 30.04.21 um 12:45 schrieb Ludovic Courtès:

Uh.  More generally, Rust packages kinda create a “shadow dependency
graph” via #:cargo-inputs & co., which breaks all the tools that are
unaware of it.  It was discussed several times on this list, and
apparently it’s unfortunately unavoidable at this time.  :-/

Maybe we can get rid of #:cargo-inputs at least:

guix/build-system/cargo.scm says: "Although cargo does not permit cyclic dependencies between crates,
however, it permits cycles to occur via dev-dependencies"

So we could change #:cargo-inputs into normal inputs and get at least part of the dependencies right.

I'm aware of the "special treatment" of cargo-inputs. Anyhow we could apply the following changes to the cargo build-system:

Benefits up to here:

Drawbacks up to here:

About "pre-built" crate: Given the many possible ways to build crates (e.g. switching on and off "features", different crate types), we might never be able to provide pre-built packages for all cases. Thus we might end up always providing the source, even if we manage to make cargo pick of pre-built artifacts.

About the output name: Rust has a notion of "rlib" (a specialized .a file), which seems to be the pre-built artifacts we are seeking. Thus the proposed name.

WDYT?

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |