All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard Purdie" <richard.purdie@linuxfoundation.org>
To: "Andreas Müller" <schnitzeltony@gmail.com>,
	bitbake-devel@lists.openembedded.org
Cc: alex.kanavin@gmail.com, randy.macleod@windriver.com,
	ross.burton@arm.com,  Paul Barker <pbarker@konsulko.com>
Subject: Re: [bitbake-devel] [RFC-cargo-fetcher 0/3] Suggest a first step
Date: Thu, 11 Feb 2021 17:51:21 +0000	[thread overview]
Message-ID: <133107bffad3c5bbaab27aa1b2aa8a9a93778f2f.camel@linuxfoundation.org> (raw)
In-Reply-To: <20210207150147.31011-1-schnitzeltony@gmail.com>

On Sun, 2021-02-07 at 16:01 +0100, Andreas Müller wrote:
> This is a first version of a cargo fetcher. It mimics cargo fetch means
> it creates cargo cache in ${DL_DIR}/cargo. As mentioned in comments the
> proxy-thingy was stolen from npmsw for shrinkwrap files.
> 
> First approach was to parse Cargo.toml for projects that don't ship a
> Cargo.lock (crates for rustlibs should do this) but that was skipped:
> An unknown magic inside cargo detects which libs are avaiable: Blindly
> followin -> download explodedc [1]
> 
> As proof of concept I did (no meta-rust in layers to avoid surprises):
> 
> * add a simple cargo-fetch.bbclass to oe-core [2]
> * adapt a pure rust recipe 'spotifyd' to new fetcher [3-4]
> * moved console to source of spotifyd and did
>   > export CARGO_HOME="<DL_DIR>/cargo"
>   > export CARGO_TARGET_DIR="<B>"
>   > cargo build --frozen
>   --> project was build without issues
> 
> Please review carefully because I am aware that:
> 
> * my python could be better
> * the 'one cache for all in download area thingy' might cause issues I do not
>   see yet
> 
> Am also aware that this is not more than a first step. Once this makes it in,
> further TODOs are:
> 
> * Merge latest meta-rust -> oe-core (latest: There were some riscv adjustments
>   recently - and I am not sure if these are in the poky-contrib of Alex/Ross)
> * Add documentation / tests / devtool-support / ??
> 
> [1] https://github.com/schnitzeltony/mimic-cargo-fetcher/blob/master/test.py
> [2] https://github.com/schnitzeltony/openembedded-core/blob/cargo-fetcher/meta/classes/cargo-fetch.bbclass
> [3] https://github.com/schnitzeltony/meta-musicians/blob/cargo-fetcher/recipes-streaming/spotify/spotifyd.bb
> [4] https://github.com/schnitzeltony/meta-musicians/blob/cargo-fetcher/recipes-streaming/spotify/spotifyd/Cargo.lock


Thanks for putting this together. Out of interest how does it compare
to the code in meta-rust?

I'm hoping Paul Barker and Randy MacLeod can take a look at this as
they've done a lot more work in the area than I have.

Cheers,

Richard


      parent reply	other threads:[~2021-02-11 17:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 15:01 [RFC-cargo-fetcher 0/3] Suggest a first step Andreas Müller
2021-02-07 15:01 ` [RFC-cargo-fetcher 1/3] Add a fetcher for cargo crate index Andreas Müller
2021-02-07 15:01 ` [RFC-cargo-fetcher 2/3] Add parser for toml configuration files Andreas Müller
2021-02-07 15:01 ` [RFC-cargo-fetcher 3/3] Add a fetcher for cargo crates Andreas Müller
2021-02-11 17:51 ` Richard Purdie [this message]

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=133107bffad3c5bbaab27aa1b2aa8a9a93778f2f.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=alex.kanavin@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=pbarker@konsulko.com \
    --cc=randy.macleod@windriver.com \
    --cc=ross.burton@arm.com \
    --cc=schnitzeltony@gmail.com \
    /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.
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.