mbox

[RFC,0/3] Introduction of cargo-c class and recipe

Message ID cover.1691851365.git.frederic.martinsons@gmail.com
State New
Headers show

Pull-request

https://gitlab.com/fmartinsons/openembedded-core cargo-c-introduction

Message

Frédéric Martinsons Aug. 12, 2023, 2:49 p.m. UTC
From: Frederic Martinsons <frederic.martinsons@gmail.com>

This is an RFC for introducing a new class and recipes that
help building C-ABI compatible header and library around
rust code.

The third patch is not meant to be merged (at least I'm
wondering if this is really usefull in oe-core) but
this could help the review and comment since it
demonstrat how to use the class and for what
purpose.

The following changes since commit 05095c116602d1a8c388cc02afffcc36230138f7:

  qemuboot: Update hardcoded path to match new layout (2023-08-11 13:21:31 +0100)

are available in the Git repository at:

  https://gitlab.com/fmartinsons/openembedded-core cargo-c-introduction

Frederic Martinsons (3):
  rust: add cargo-c recipe
  classes-recipe: add cargo_c.bbclass
  rust: provide examples for C library generation in rust

 meta/classes-recipe/cargo_c.bbclass           |   41 +
 meta/recipes-devtools/rust/cargo-c-crates.inc |  453 ++++
 meta/recipes-devtools/rust/cargo-c_0.9.18.bb  |   22 +
 .../rust/files/0001-Add-Cargo.lock-file.patch | 2180 +++++++++++++++++
 .../rust/rust-c-lib-example-bin_git.bb        |   16 +
 .../rust/rust-c-lib-example-crates.inc        |   79 +
 .../rust/rust-c-lib-example_git.bb            |   15 +
 7 files changed, 2806 insertions(+)
 create mode 100644 meta/classes-recipe/cargo_c.bbclass
 create mode 100644 meta/recipes-devtools/rust/cargo-c-crates.inc
 create mode 100644 meta/recipes-devtools/rust/cargo-c_0.9.18.bb
 create mode 100644 meta/recipes-devtools/rust/files/0001-Add-Cargo.lock-file.patch
 create mode 100644 meta/recipes-devtools/rust/rust-c-lib-example-bin_git.bb
 create mode 100644 meta/recipes-devtools/rust/rust-c-lib-example-crates.inc
 create mode 100644 meta/recipes-devtools/rust/rust-c-lib-example_git.bb

Comments

Richard Purdie Aug. 12, 2023, 10:53 p.m. UTC | #1
On Sat, 2023-08-12 at 16:49 +0200, Frederic Martinsons wrote:
> From: Frederic Martinsons <frederic.martinsons@gmail.com>
> 
> This is an RFC for introducing a new class and recipes that
> help building C-ABI compatible header and library around
> rust code.
> 
> The third patch is not meant to be merged (at least I'm
> wondering if this is really usefull in oe-core) but
> this could help the review and comment since it
> demonstrat how to use the class and for what
> purpose.

We do have meta-selftest in oe-core where it could be added. It is
really helpful to have something to build tests around, at least
initially until we get real world examples and it is no longer
needed...

Cheers,

Richard
Frédéric Martinsons Aug. 13, 2023, 5:56 a.m. UTC | #2
Le dim. 13 août 2023, 00:53, Richard Purdie <
richard.purdie@linuxfoundation.org> a écrit :

> On Sat, 2023-08-12 at 16:49 +0200, Frederic Martinsons wrote:
> > From: Frederic Martinsons <frederic.martinsons@gmail.com>
> >
> > This is an RFC for introducing a new class and recipes that
> > help building C-ABI compatible header and library around
> > rust code.
> >
> > The third patch is not meant to be merged (at least I'm
> > wondering if this is really usefull in oe-core) but
> > this could help the review and comment since it
> > demonstrat how to use the class and for what
> > purpose.
>
> We do have meta-selftest in oe-core where it could be added. It is
> really helpful to have something to build tests around, at least
> initially until we get real world examples and it is no longer
> needed...
>

OK thanks Richard, I'll move these examples in meta-selftest and implement
a oeqa runtime test case (like the rust-hello-world that I removed two
weeks ago)

Cheers,
>
> Richard
>