From: Ivan Petkov <ivanppetkov@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 35318@debbugs.gnu.org, Chris Marusich <cmmarusich@gmail.com>
Subject: [bug#35318] [PATCH] Update cargo-build-system to expand package inputs
Date: Tue, 21 May 2019 19:48:24 -0700 [thread overview]
Message-ID: <43DF2996-1DEA-40CD-92FC-B27433F63AE7@gmail.com> (raw)
In-Reply-To: <87pnocq5kz.fsf@gnu.org>
Hi Ludo!
> On May 20, 2019, at 12:38 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> +(define (package-cargo-deps p)
>> + (apply
>> + (lambda* (#:key (cargo-deps '()) #:allow-other-keys)
>> + cargo-deps)
>> + (package-arguments p)))
>
> It’s surprising style. It seems redundant with the ‘inputs’ field, but
> IIUC, the main difference here is that you can simply name dependencies,
> even if there’s no Guix package for it, right?
That’s one benefit, the other is that we’re defining our own new semantics
on the cargo-specific inputs here to be treated like propagated-inputs, but
without actually making the store install them when a Rust binary is substituted.
>> +(define (package-cargo-dev-deps p)
>> + (apply
>> + (lambda* (#:key (cargo-dev-deps '()) #:allow-other-keys)
>> + cargo-dev-deps)
>> + (package-arguments p)))
>
> As a rule of thumb, please avoid abbreviations in identifiers (info
> "(guix) Coding Style"). So that would be
> ‘package-development-dependencies’ or something like that.
Thanks for the tip, I’ll update these names.
Since the actual cargo documentation actually refers to “dev-dependencies”
do you think it’s better to use “cargo-dev-dependencies” (for consistency that
Rust programmers might be used to), or stick with “cargo-development-dependencies”
(for Guix consistencies)?
>> +(define (crate-transitive-deps inputs)
>> + "Return the closure of INPUTS when considering the 'cargo-deps' and
>> +'cargod-dev-deps' edges. Omit duplicate inputs, except for those
>> +already present in INPUTS itself.
>> +
>> +This is implemented as a breadth-first traversal such that INPUTS is
>> +preserved, and only duplicate extracted inputs are removed.
>> +
>> +Forked from ((guix packages) transitive-inputs) since this extraction
>> +uses slightly different rules compared to the rest of Guix (i.e. we
>> +do not extract the conventional inputs)."
>
> Perhaps call it ‘crate-closure’?
Sure that works, I’ll rename this!
>> +(define (expand-crate-sources cargo-deps cargo-dev-deps)
>> + "Extract all transitive sources for CARGO-DEPS and CARGO-DEV-DEPS along their
>> +'cargo-deps' edges.
>
> Maybe s/cargo-deps/inputs/ and s/cargo-dev-deps/development-inputs/?
>
> I’d prefer to stick to the same terminology as in the rest of the code
> if we’re talking about the same sort of input lists.
I can rename this as well.
>
> That’s it. :-)
>
> Thank you for improving Rust support!
Happy to help :)
—Ivan
next prev parent reply other threads:[~2019-05-22 2:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-19 5:34 [bug#35318] [PATCH] Update cargo-build-system to expand package inputs Ivan Petkov
2019-05-04 16:40 ` Ivan Petkov
2019-05-04 18:31 ` Danny Milosavljevic
2019-05-04 21:09 ` Ivan Petkov
2019-05-06 8:00 ` Ludovic Courtès
2019-05-06 16:04 ` Ivan Petkov
2019-05-09 23:17 ` Ivan Petkov
2019-05-15 6:08 ` Ivan Petkov
2019-05-15 12:44 ` Ludovic Courtès
2019-05-20 1:00 ` Ivan Petkov
2019-05-20 19:38 ` Ludovic Courtès
2019-05-22 2:48 ` Ivan Petkov [this message]
2019-06-08 18:44 ` Chris Marusich
2019-06-08 23:33 ` Ivan Petkov
2019-06-09 23:53 ` Ivan Petkov
2019-06-12 1:14 ` bug#35318: " Chris Marusich
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=43DF2996-1DEA-40CD-92FC-B27433F63AE7@gmail.com \
--to=ivanppetkov@gmail.com \
--cc=35318@debbugs.gnu.org \
--cc=cmmarusich@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.