From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>, Ivan Petkov <ivanppetkov@gmail.com>
Subject: Re: #:cargo-inputs don't honor --with-input
Date: Sat, 1 May 2021 11:20:51 +0200 [thread overview]
Message-ID: <1ea7cf3d-b75f-c47a-9730-406ecc610e7c@crazy-compilers.com> (raw)
In-Reply-To: <87eeesgif0.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2787 bytes --]
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:
*
The cargo build-system copies the "pre-built crate" (more on this
below) into a new output called "rlib" or "crate". There already is
a phase "packaging" which only needs to be changed to use the other
output.
*
All of today's #:cargo-inputs will be changed into normal inputs
using the "rlib/crate" output. (To avoid duplicate assoc-rec keys we
might need to change the name/keys, but this should be a minor issue.)
*
If required, the cargo build-system can easily identify former
#:cargo-inputs by being inputs from a "rlib/crate" output.
Benefits up to here:
* The dependency graph would be much more complete - although
"#:cargo-development-inputs" would still be missing.
* Package transformation options would work -again except for
"#:cargo-development-inputs".
* If(!) we actually manage to make cargo pick "pre-built" crates,
package definition will already be adjusted to use them.
|Drawbacks up to here:|
* ||Since the "packaging" phase copies the source, there is not much
benefit in having a "rlib/crate" output yet. Actually, when a
"rlib/crate" output needs to be build, the user will end up with two
copies of the source (one from the git-checkout, one from packaging)
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 |
[-- Attachment #2: Type: text/html, Size: 3811 bytes --]
next prev parent reply other threads:[~2021-05-01 9:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 13:32 #:cargo-inputs don't honor --with-input Hartmut Goebel
2021-04-30 10:45 ` Ludovic Courtès
2021-05-01 9:20 ` Hartmut Goebel [this message]
2021-05-10 7:53 ` Efraim Flashner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ea7cf3d-b75f-c47a-9730-406ecc610e7c@crazy-compilers.com \
--to=h.goebel@crazy-compilers.com \
--cc=guix-devel@gnu.org \
--cc=ivanppetkov@gmail.com \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.