mbox

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

Message ID cover.1691914589.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. 13, 2023, 8:23 a.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 add examples and test to demonstrate
the usage and the good working of this use case.

Test have been passed with the following in local.conf:

CORE_IMAGE_EXTRA_INSTALL:append = " openssh-sshd openssh-scp cargo rust rust-c-lib-example-bin"
IMAGE_CLASSES += "testimage"
TEST_SUITES = "ping ssh rust"
# To use slirp option in testimage.bbclass
TEST_RUNQEMUPARAMS = "slirp"
TEST_SERVER_IP = "127.0.0.1"
QEMU_USE_SLIRP = "1"

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 (4):
  rust: add cargo-c recipe
  classes-recipe: add cargo_c.bbclass
  rust: provide examples for C library generation in rust
  oeqa/runtime/rust: correct rust test

 .../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 +
 meta/classes-recipe/cargo_c.bbclass           |   41 +
 meta/conf/distro/include/maintainers.inc      |    2 +
 meta/lib/oeqa/runtime/cases/rust.py           |   16 +-
 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 +++++++++++++++++
 9 files changed, 2822 insertions(+), 2 deletions(-)
 create mode 100644 meta-selftest/recipes-devtools/rust/rust-c-lib-example-bin_git.bb
 create mode 100644 meta-selftest/recipes-devtools/rust/rust-c-lib-example-crates.inc
 create mode 100644 meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb
 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

Comments

Richard Purdie Aug. 13, 2023, 10:23 a.m. UTC | #1
On Sun, 2023-08-13 at 10:23 +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 add examples and test to demonstrate
> the usage and the good working of this use case.
> 
> Test have been passed with the following in local.conf:
> 
> CORE_IMAGE_EXTRA_INSTALL:append = " openssh-sshd openssh-scp cargo rust rust-c-lib-example-bin"
> IMAGE_CLASSES += "testimage"
> TEST_SUITES = "ping ssh rust"
> # To use slirp option in testimage.bbclass
> TEST_RUNQEMUPARAMS = "slirp"
> TEST_SERVER_IP = "127.0.0.1"
> QEMU_USE_SLIRP = "1"

In testing it showed:

stdio: WARNING: cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe cargo-c in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not contain a SUMMARY. Please add an entry. [missing-metadata]
stdio: WARNING: cargo-c-native-0.9.18-r0 do_recipe_qa: QA Issue: Recipe cargo-c in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not contain a SUMMARY. Please add an entry. [missing-metadata]
stdio: WARNING: nativesdk-cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe cargo-c in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not contain a SUMMARY. Please add an entry. [missing-metadata]

Cheers,

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

> On Sun, 2023-08-13 at 10:23 +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 add examples and test to demonstrate
> > the usage and the good working of this use case.
> >
> > Test have been passed with the following in local.conf:
> >
> > CORE_IMAGE_EXTRA_INSTALL:append = " openssh-sshd openssh-scp cargo rust
> rust-c-lib-example-bin"
> > IMAGE_CLASSES += "testimage"
> > TEST_SUITES = "ping ssh rust"
> > # To use slirp option in testimage.bbclass
> > TEST_RUNQEMUPARAMS = "slirp"
> > TEST_SERVER_IP = "127.0.0.1"
> > QEMU_USE_SLIRP = "1"
>
> In testing it showed:
>
> stdio: WARNING: cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe cargo-c
> in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-devtools/rust/
> cargo-c_0.9.18.bb does not contain a SUMMARY. Please add an entry.
> [missing-metadata]
> stdio: WARNING: cargo-c-native-0.9.18-r0 do_recipe_qa: QA Issue: Recipe
> cargo-c in
> /home/pokybuild/yocto-worker/a-full/build/meta/recipes-devtools/rust/
> cargo-c_0.9.18.bb does not contain a SUMMARY. Please add an entry.
> [missing-metadata]
> stdio: WARNING: nativesdk-cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe
> cargo-c in
> /home/pokybuild/yocto-worker/a-full/build/meta/recipes-devtools/rust/
> cargo-c_0.9.18.bb does not contain a SUMMARY. Please add an entry.
> [missing-metadata]
>

Thanks Richard, will take care of that soon.

Can you tell me what commands do you run to have that sanity check? It will
avoid me to do the same mistake next time I'll add a recipe.


> Cheers,
>
> Richard
>
Richard Purdie Aug. 13, 2023, 11:22 a.m. UTC | #3
On Sun, 2023-08-13 at 12:48 +0200, Frédéric Martinsons wrote:
> 
> 
> Le dim. 13 août 2023, 12:23, Richard Purdie
> <richard.purdie@linuxfoundation.org> a écrit :
> > On Sun, 2023-08-13 at 10:23 +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 add examples and test to demonstrate
> > > the usage and the good working of this use case.
> > > 
> > > Test have been passed with the following in local.conf:
> > > 
> > > CORE_IMAGE_EXTRA_INSTALL:append = " openssh-sshd openssh-scp
> > > cargo rust rust-c-lib-example-bin"
> > > IMAGE_CLASSES += "testimage"
> > > TEST_SUITES = "ping ssh rust"
> > > # To use slirp option in testimage.bbclass
> > > TEST_RUNQEMUPARAMS = "slirp"
> > > TEST_SERVER_IP = "127.0.0.1"
> > > QEMU_USE_SLIRP = "1"
> > 
> > In testing it showed:
> > 
> > stdio: WARNING: cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe
> > cargo-c in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-
> > devtools/rust/cargo-c_0.9.18.bb does not contain a SUMMARY. Please
> > add an entry. [missing-metadata]
> > stdio: WARNING: cargo-c-native-0.9.18-r0 do_recipe_qa: QA Issue:
> > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > contain a SUMMARY. Please add an entry. [missing-metadata]
> > stdio: WARNING: nativesdk-cargo-c-0.9.18-r0 do_recipe_qa: QA Issue:
> > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > contain a SUMMARY. Please add an entry. [missing-metadata]
> 
> Thanks Richard, will take care of that soon. 
> 
> Can you tell me what commands do you run to have that sanity check?
> It will avoid me to do the same mistake next time I'll add a recipe. 

It should just show up building the recipe (e.g. "bitbake cargo-c")?

There are further build failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/101/builds/6361/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/6484/steps/14/logs/stdio

and the build isn't finished yet so Is suspect there will be more.

Cheers,

Richard
Richard Purdie Aug. 13, 2023, 1:09 p.m. UTC | #4
On Sun, 2023-08-13 at 12:22 +0100, Richard Purdie via
lists.openembedded.org wrote:
> On Sun, 2023-08-13 at 12:48 +0200, Frédéric Martinsons wrote:
> > 
> > 
> > Le dim. 13 août 2023, 12:23, Richard Purdie
> > <richard.purdie@linuxfoundation.org> a écrit :
> > > On Sun, 2023-08-13 at 10:23 +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 add examples and test to demonstrate
> > > > the usage and the good working of this use case.
> > > > 
> > > > Test have been passed with the following in local.conf:
> > > > 
> > > > CORE_IMAGE_EXTRA_INSTALL:append = " openssh-sshd openssh-scp
> > > > cargo rust rust-c-lib-example-bin"
> > > > IMAGE_CLASSES += "testimage"
> > > > TEST_SUITES = "ping ssh rust"
> > > > # To use slirp option in testimage.bbclass
> > > > TEST_RUNQEMUPARAMS = "slirp"
> > > > TEST_SERVER_IP = "127.0.0.1"
> > > > QEMU_USE_SLIRP = "1"
> > > 
> > > In testing it showed:
> > > 
> > > stdio: WARNING: cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe
> > > cargo-c in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-
> > > devtools/rust/cargo-c_0.9.18.bb does not contain a SUMMARY. Please
> > > add an entry. [missing-metadata]
> > > stdio: WARNING: cargo-c-native-0.9.18-r0 do_recipe_qa: QA Issue:
> > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > > contain a SUMMARY. Please add an entry. [missing-metadata]
> > > stdio: WARNING: nativesdk-cargo-c-0.9.18-r0 do_recipe_qa: QA Issue:
> > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > > contain a SUMMARY. Please add an entry. [missing-metadata]
> > 
> > Thanks Richard, will take care of that soon. 
> > 
> > Can you tell me what commands do you run to have that sanity check?
> > It will avoid me to do the same mistake next time I'll add a recipe. 
> 
> It should just show up building the recipe (e.g. "bitbake cargo-c")?
> 
> There are further build failures:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/101/builds/6361/steps/14/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/6484/steps/14/logs/stdio
> 
> and the build isn't finished yet so Is suspect there will be more.

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/5606/steps/15/logs/stdio

not all of those failures are your patches but:

2023-08-13 12:38:57,894 - oe-selftest - INFO - ======================================================================
2023-08-13 12:38:57,894 - oe-selftest - INFO - FAIL: distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase)
2023-08-13 12:38:57,894 - oe-selftest - INFO - ----------------------------------------------------------------------
2023-08-13 12:38:57,894 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/distrodata.py", line 115, in test_maintainers
    self.fail("""
  File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py", line 703, in fail
    raise self.failureException(msg)
AssertionError: 
Unable to find recipes for the following entries in maintainers.inc:
rust-c-lib-example
rust-c-lib-example-bin


and this:

Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/runtime/cases/rust.py", line 31, in test_rust_compile
    self.assertEqual(status, 0, msg=msg)
AssertionError: 127 != 0 : rust compile failed, output: sh: rustc: not found


probably is are, so 2 of the 6 failures. The other 4 are "mine" :/.

Cheers,

Richard
Richard Purdie Aug. 13, 2023, 2:53 p.m. UTC | #5
On Sun, 2023-08-13 at 14:09 +0100, Richard Purdie via
lists.openembedded.org wrote:
> On Sun, 2023-08-13 at 12:22 +0100, Richard Purdie via
> lists.openembedded.org wrote:
> > On Sun, 2023-08-13 at 12:48 +0200, Frédéric Martinsons wrote:
> > > 
> > > 
> > > Le dim. 13 août 2023, 12:23, Richard Purdie
> > > <richard.purdie@linuxfoundation.org> a écrit :
> > > > On Sun, 2023-08-13 at 10:23 +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 add examples and test to demonstrate
> > > > > the usage and the good working of this use case.
> > > > > 
> > > > > Test have been passed with the following in local.conf:
> > > > > 
> > > > > CORE_IMAGE_EXTRA_INSTALL:append = " openssh-sshd openssh-scp
> > > > > cargo rust rust-c-lib-example-bin"
> > > > > IMAGE_CLASSES += "testimage"
> > > > > TEST_SUITES = "ping ssh rust"
> > > > > # To use slirp option in testimage.bbclass
> > > > > TEST_RUNQEMUPARAMS = "slirp"
> > > > > TEST_SERVER_IP = "127.0.0.1"
> > > > > QEMU_USE_SLIRP = "1"
> > > > 
> > > > In testing it showed:
> > > > 
> > > > stdio: WARNING: cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe
> > > > cargo-c in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-
> > > > devtools/rust/cargo-c_0.9.18.bb does not contain a SUMMARY. Please
> > > > add an entry. [missing-metadata]
> > > > stdio: WARNING: cargo-c-native-0.9.18-r0 do_recipe_qa: QA Issue:
> > > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > > > contain a SUMMARY. Please add an entry. [missing-metadata]
> > > > stdio: WARNING: nativesdk-cargo-c-0.9.18-r0 do_recipe_qa: QA Issue:
> > > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > > > contain a SUMMARY. Please add an entry. [missing-metadata]
> > > 
> > > Thanks Richard, will take care of that soon. 
> > > 
> > > Can you tell me what commands do you run to have that sanity check?
> > > It will avoid me to do the same mistake next time I'll add a recipe. 
> > 
> > It should just show up building the recipe (e.g. "bitbake cargo-c")?
> > 
> > There are further build failures:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/101/builds/6361/steps/14/logs/stdio
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/6484/steps/14/logs/stdio
> > 
> > and the build isn't finished yet so Is suspect there will be more.
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/5606/steps/15/logs/stdio
> 
> not all of those failures are your patches but:
> 
> 2023-08-13 12:38:57,894 - oe-selftest - INFO - ======================================================================
> 2023-08-13 12:38:57,894 - oe-selftest - INFO - FAIL: distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase)
> 2023-08-13 12:38:57,894 - oe-selftest - INFO - ----------------------------------------------------------------------
> 2023-08-13 12:38:57,894 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
>   File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/distrodata.py", line 115, in test_maintainers
>     self.fail("""
>   File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py", line 703, in fail
>     raise self.failureException(msg)
> AssertionError: 
> Unable to find recipes for the following entries in maintainers.inc:
> rust-c-lib-example
> rust-c-lib-example-bin
> 
> 
> and this:
> 
> Traceback (most recent call last):
>   File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
>     return func(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^
>   File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
>     return func(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^
>   File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/runtime/cases/rust.py", line 31, in test_rust_compile
>     self.assertEqual(status, 0, msg=msg)
> AssertionError: 127 != 0 : rust compile failed, output: sh: rustc: not found
> 
> 
> probably is are, so 2 of the 6 failures. The other 4 are "mine" :/.
> 

and a reproducibility failure:

https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3355/steps/13/logs/stdio

which leads to:

http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20230813-z_b2j3ha/packages/diff-html/

Cheers,

Richard
Frédéric Martinsons Aug. 13, 2023, 2:57 p.m. UTC | #6
On Sun, 13 Aug 2023 at 15:09, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Sun, 2023-08-13 at 12:22 +0100, Richard Purdie via
> lists.openembedded.org wrote:
> > On Sun, 2023-08-13 at 12:48 +0200, Frédéric Martinsons wrote:
> > >
> > >
> > > Le dim. 13 août 2023, 12:23, Richard Purdie
> > > <richard.purdie@linuxfoundation.org> a écrit :
> > > > On Sun, 2023-08-13 at 10:23 +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 add examples and test to demonstrate
> > > > > the usage and the good working of this use case.
> > > > >
> > > > > Test have been passed with the following in local.conf:
> > > > >
> > > > > CORE_IMAGE_EXTRA_INSTALL:append = " openssh-sshd openssh-scp
> > > > > cargo rust rust-c-lib-example-bin"
> > > > > IMAGE_CLASSES += "testimage"
> > > > > TEST_SUITES = "ping ssh rust"
> > > > > # To use slirp option in testimage.bbclass
> > > > > TEST_RUNQEMUPARAMS = "slirp"
> > > > > TEST_SERVER_IP = "127.0.0.1"
> > > > > QEMU_USE_SLIRP = "1"
> > > >
> > > > In testing it showed:
> > > >
> > > > stdio: WARNING: cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe
> > > > cargo-c in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-
> > > > devtools/rust/cargo-c_0.9.18.bb does not contain a SUMMARY. Please
> > > > add an entry. [missing-metadata]
> > > > stdio: WARNING: cargo-c-native-0.9.18-r0 do_recipe_qa: QA Issue:
> > > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > > > contain a SUMMARY. Please add an entry. [missing-metadata]
> > > > stdio: WARNING: nativesdk-cargo-c-0.9.18-r0 do_recipe_qa: QA Issue:
> > > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > > > contain a SUMMARY. Please add an entry. [missing-metadata]
> > >
> > > Thanks Richard, will take care of that soon.
> > >
> > > Can you tell me what commands do you run to have that sanity check?
> > > It will avoid me to do the same mistake next time I'll add a recipe.
> >
> > It should just show up building the recipe (e.g. "bitbake cargo-c")?
> >
> > There are further build failures:
> >
> >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/101/builds/6361/steps/14/logs/stdio
> >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/6484/steps/14/logs/stdio
> >
> > and the build isn't finished yet so Is suspect there will be more.
>
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/5606/steps/15/logs/stdio
>
> not all of those failures are your patches but:
>
> 2023-08-13 12:38:57,894 - oe-selftest - INFO -
> ======================================================================
> 2023-08-13 12:38:57,894 - oe-selftest - INFO - FAIL:
> distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase)
> 2023-08-13 12:38:57,894 - oe-selftest - INFO -
> ----------------------------------------------------------------------
> 2023-08-13 12:38:57,894 - oe-selftest - INFO -
> testtools.testresult.real._StringException: Traceback (most recent call
> last):
>   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/distrodata.py",
> line 115, in test_maintainers
>     self.fail("""
>   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py",
> line 703, in fail
>     raise self.failureException(msg)
> AssertionError:
> Unable to find recipes for the following entries in maintainers.inc:
> rust-c-lib-example
> rust-c-lib-example-bin
>

I don't understand these, because rust-c-lib-example and
rust-c-lib-example-bin have been added by PATCHV2 (3/4)  in meta-selftest.
./meta-selftest/recipes-devtools/rust/rust-c-lib-example-bin_git.bb
./meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb

Is this because they are in meta-selftest ? Should I remove them from
maintainers.inc ?


> and this:
>
> Traceback (most recent call last):
>   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py",
> line 35, in wrapped_f
>     return func(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^
>   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py",
> line 35, in wrapped_f
>     return func(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^
>   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/runtime/cases/rust.py",
> line 31, in test_rust_compile
>     self.assertEqual(status, 0, msg=msg)
> AssertionError: 127 != 0 : rust compile failed, output: sh: rustc: not
> found
>
> I don't understand this one either, I simply add openssh-scp in require
package to run test_rust_compile since its setup function
copy source on target via scp, rustc is provided by rust recipe and rust
recipe is required to run this test. Any ideas ?


> probably is are, so 2 of the 6 failures. The other 4 are "mine" :/.
>
> Cheers,
>
> Richard
>
>
Frédéric Martinsons Aug. 13, 2023, 3 p.m. UTC | #7
On Sun, 13 Aug 2023 at 16:53, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Sun, 2023-08-13 at 14:09 +0100, Richard Purdie via
> lists.openembedded.org wrote:
> > On Sun, 2023-08-13 at 12:22 +0100, Richard Purdie via
> > lists.openembedded.org wrote:
> > > On Sun, 2023-08-13 at 12:48 +0200, Frédéric Martinsons wrote:
> > > >
> > > >
> > > > Le dim. 13 août 2023, 12:23, Richard Purdie
> > > > <richard.purdie@linuxfoundation.org> a écrit :
> > > > > On Sun, 2023-08-13 at 10:23 +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 add examples and test to demonstrate
> > > > > > the usage and the good working of this use case.
> > > > > >
> > > > > > Test have been passed with the following in local.conf:
> > > > > >
> > > > > > CORE_IMAGE_EXTRA_INSTALL:append = " openssh-sshd openssh-scp
> > > > > > cargo rust rust-c-lib-example-bin"
> > > > > > IMAGE_CLASSES += "testimage"
> > > > > > TEST_SUITES = "ping ssh rust"
> > > > > > # To use slirp option in testimage.bbclass
> > > > > > TEST_RUNQEMUPARAMS = "slirp"
> > > > > > TEST_SERVER_IP = "127.0.0.1"
> > > > > > QEMU_USE_SLIRP = "1"
> > > > >
> > > > > In testing it showed:
> > > > >
> > > > > stdio: WARNING: cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe
> > > > > cargo-c in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-
> > > > > devtools/rust/cargo-c_0.9.18.bb does not contain a SUMMARY. Please
> > > > > add an entry. [missing-metadata]
> > > > > stdio: WARNING: cargo-c-native-0.9.18-r0 do_recipe_qa: QA Issue:
> > > > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > > > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > > > > contain a SUMMARY. Please add an entry. [missing-metadata]
> > > > > stdio: WARNING: nativesdk-cargo-c-0.9.18-r0 do_recipe_qa: QA Issue:
> > > > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
> > > > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
> > > > > contain a SUMMARY. Please add an entry. [missing-metadata]
> > > >
> > > > Thanks Richard, will take care of that soon.
> > > >
> > > > Can you tell me what commands do you run to have that sanity check?
> > > > It will avoid me to do the same mistake next time I'll add a recipe.
> > >
> > > It should just show up building the recipe (e.g. "bitbake cargo-c")?
> > >
> > > There are further build failures:
> > >
> > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/101/builds/6361/steps/14/logs/stdio
> > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/6484/steps/14/logs/stdio
> > >
> > > and the build isn't finished yet so Is suspect there will be more.
> >
> >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/5606/steps/15/logs/stdio
> >
> > not all of those failures are your patches but:
> >
> > 2023-08-13 12:38:57,894 - oe-selftest - INFO -
> ======================================================================
> > 2023-08-13 12:38:57,894 - oe-selftest - INFO - FAIL:
> distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase)
> > 2023-08-13 12:38:57,894 - oe-selftest - INFO -
> ----------------------------------------------------------------------
> > 2023-08-13 12:38:57,894 - oe-selftest - INFO -
> testtools.testresult.real._StringException: Traceback (most recent call
> last):
> >   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/distrodata.py",
> line 115, in test_maintainers
> >     self.fail("""
> >   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py",
> line 703, in fail
> >     raise self.failureException(msg)
> > AssertionError:
> > Unable to find recipes for the following entries in maintainers.inc:
> > rust-c-lib-example
> > rust-c-lib-example-bin
> >
> >
> > and this:
> >
> > Traceback (most recent call last):
> >   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py",
> line 35, in wrapped_f
> >     return func(*args, **kwargs)
> >            ^^^^^^^^^^^^^^^^^^^^^
> >   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py",
> line 35, in wrapped_f
> >     return func(*args, **kwargs)
> >            ^^^^^^^^^^^^^^^^^^^^^
> >   File
> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/runtime/cases/rust.py",
> line 31, in test_rust_compile
> >     self.assertEqual(status, 0, msg=msg)
> > AssertionError: 127 != 0 : rust compile failed, output: sh: rustc: not
> found
> >
> >
> > probably is are, so 2 of the 6 failures. The other 4 are "mine" :/.
> >
>
> and a reproducibility failure:
>
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3355/steps/13/logs/stdio
>
> which leads to:
>
>
> http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20230813-z_b2j3ha/packages/diff-html/


Argh, this makes me remember of
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15090
Do you know if any of cargo based recipe is reproducible ?
Should I add EXCLUDE_FROM_WORLD in cargo-c ?


>
>
> Cheers,
>
> Richard
>
>
Richard Purdie Aug. 13, 2023, 3:05 p.m. UTC | #8
On Sun, 2023-08-13 at 17:00 +0200, Frédéric Martinsons wrote:
> On Sun, 13 Aug 2023 at 16:53, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > 
> > and a reproducibility failure:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3355/steps/13/logs/stdio
> > 
> > which leads to:
> > 
> > http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20230813-z_b2j3ha/packages/diff-html/
> > 
> 
> 
> Argh, this makes me remember
> of https://bugzilla.yoctoproject.org/show_bug.cgi?id=15090
> Do you know if any of cargo based recipe is reproducible ?
> Should I add EXCLUDE_FROM_WORLD in cargo-c ?

At some point we're going to have to dive in and fix the
reproducibility issues so I'm reluctant to take more patches with that
set...

Cheers,

Richard
Frédéric Martinsons Aug. 13, 2023, 3:10 p.m. UTC | #9
On Sun, 13 Aug 2023 at 17:05, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Sun, 2023-08-13 at 17:00 +0200, Frédéric Martinsons wrote:
> > On Sun, 13 Aug 2023 at 16:53, Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > >
> > > and a reproducibility failure:
> > >
> > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3355/steps/13/logs/stdio
> > >
> > > which leads to:
> > >
> > >
> http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20230813-z_b2j3ha/packages/diff-html/
> > >
> >
> >
> > Argh, this makes me remember
> > of https://bugzilla.yoctoproject.org/show_bug.cgi?id=15090
> > Do you know if any of cargo based recipe is reproducible ?
> > Should I add EXCLUDE_FROM_WORLD in cargo-c ?
>
> At some point we're going to have to dive in and fix the
> reproducibility issues so I'm reluctant to take more patches with that
> set...


I understand, in the meantime, I issue a simple bibtake cargo-c and see
these (along with the missing SUMMARY):

 WARNING: cargo-c-0.9.18-r0 do_package_qa: QA Issue: File
/usr/bin/.debug/cargo-cinstall in package cargo-c-dbg contains reference to
TMPDIR
File /usr/bin/.debug/cargo-cbuild in package cargo-c-dbg contains reference
to TMPDIR
File /usr/bin/.debug/cargo-ctest in package cargo-c-dbg contains reference
to TMPDIR
File /usr/bin/.debug/cargo-capi in package cargo-c-dbg contains reference
to TMPDIR [buildpaths]

I guess this doesn't help to be reproducible, I'll look at those soon.

Sadly, I didn't see any of these warnings during my tests, I just have to
look sharply for the next time.

>
>
Cheers,
>
> Richard
>
>
>
Frédéric Martinsons Aug. 14, 2023, 7:30 a.m. UTC | #10
On Sun, 13 Aug 2023 at 17:05, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Sun, 2023-08-13 at 17:00 +0200, Frédéric Martinsons wrote:
> > On Sun, 13 Aug 2023 at 16:53, Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > >
> > > and a reproducibility failure:
> > >
> > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3355/steps/13/logs/stdio
> > >
> > > which leads to:
> > >
> > >
> http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20230813-z_b2j3ha/packages/diff-html/
> > >
> >
> >
> > Argh, this makes me remember
> > of https://bugzilla.yoctoproject.org/show_bug.cgi?id=15090
> > Do you know if any of cargo based recipe is reproducible ?
> > Should I add EXCLUDE_FROM_WORLD in cargo-c ?
>
> At some point we're going to have to dive in and fix the
> reproducibility issues so I'm reluctant to take more patches with that
> set...


It will hardly be doable to correct the reproducibility of rust packages
since rust/cargo
itself have issues upstream. I take a look and there are lot of open issues
cargo:
https://github.com/rust-lang/cargo/issues?q=is%3Aissue+is%3Aopen+label%3AA-reproducibility+
rust:
https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AA-reproducibility

There was an RFC accepted back in may (
https://github.com/rust-lang/rfcs/pull/3127) and implementation
progress have a tracking issue in cargo (
https://github.com/rust-lang/cargo/issues/12137) and in rust
(https://github.com/rust-lang/rust/issues/111540).

Don't know if it will fix our root issue (
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14875) but I don't
see how to workaround all of that without this upstream work.

For cargo-c specific issues, I'll try to make things better (the TMPDIR in
debug symbols) but I'm wondering
something, reproducibility is  desirable for all generated artifacts or is
it only for target ones ?  I mean,
the cargo-c is used in native so I'm wondering if making it native only
would be acceptable ?


>
>
Cheers,
>
> Richard
>
>
>
Richard Purdie Aug. 14, 2023, 8:46 a.m. UTC | #11
On Mon, 2023-08-14 at 09:30 +0200, Frédéric Martinsons wrote:
> 
> 
> On Sun, 13 Aug 2023 at 17:05, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Sun, 2023-08-13 at 17:00 +0200, Frédéric Martinsons wrote:
> > > On Sun, 13 Aug 2023 at 16:53, Richard Purdie
> > > <richard.purdie@linuxfoundation.org> wrote:
> > > > 
> > > > and a reproducibility failure:
> > > > 
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3355/steps/13/logs/stdio
> > > > 
> > > > which leads to:
> > > > 
> > > > http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20230813-z_b2j3ha/packages/diff-html/
> > > > 
> > > 
> > > 
> > > Argh, this makes me remember
> > > of https://bugzilla.yoctoproject.org/show_bug.cgi?id=15090
> > > Do you know if any of cargo based recipe is reproducible ?
> > > Should I add EXCLUDE_FROM_WORLD in cargo-c ?
> > 
> > At some point we're going to have to dive in and fix the
> > reproducibility issues so I'm reluctant to take more patches with
> > that
> > set...
> > 
> 
> 
> It will hardly be doable to correct the reproducibility of rust
> packages since rust/cargo
> itself have issues upstream. I take a look and there are lot of open
> issues
> cargo: 
> https://github.com/rust-lang/cargo/issues?q=is%3Aissue+is%3Aopen+labe
> l%3AA-reproducibility+
> rust: 
> https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label
> %3AA-reproducibility

I believe there is one problematic reference left which causes problems
for core rust. Fixing that issue would be the best place to start and
then we can work from there.

We do already have a lot of good reproducibility pieces in the
toolchain so not every upstream bug will apply to us.

> There was an RFC accepted back in may
> (https://github.com/rust-lang/rfcs/pull/3127) and implementation
> progress have a tracking issue in cargo
> (https://github.com/rust-lang/cargo/issues/12137) and in rust
> (https://github.com/rust-lang/rust/issues/111540).
> 
> Don't know if it will fix our root issue
> (https://bugzilla.yoctoproject.org/show_bug.cgi?id=14875) but I don't
> see how to workaround all of that without this upstream work.
>
> For cargo-c specific issues, I'll try to make things better (the
> TMPDIR in debug symbols) but I'm wondering
> something, reproducibility is  desirable for all generated artifacts
> or is it only for target ones ?  I mean, 
> the cargo-c is used in native so I'm wondering if making it native
> only would be acceptable ?

That would certainly avoid this issue. It would also make on target
testing of the functionality not possible.

Cheers,

Richard
Frédéric Martinsons Aug. 14, 2023, 9:39 a.m. UTC | #12
Le lun. 14 août 2023, 10:46, Richard Purdie <
richard.purdie@linuxfoundation.org> a écrit :

> On Mon, 2023-08-14 at 09:30 +0200, Frédéric Martinsons wrote:
> >
> >
> > On Sun, 13 Aug 2023 at 17:05, Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > > On Sun, 2023-08-13 at 17:00 +0200, Frédéric Martinsons wrote:
> > > > On Sun, 13 Aug 2023 at 16:53, Richard Purdie
> > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > >
> > > > > and a reproducibility failure:
> > > > >
> > > > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3355/steps/13/logs/stdio
> > > > >
> > > > > which leads to:
> > > > >
> > > > >
> http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20230813-z_b2j3ha/packages/diff-html/
> > > > >
> > > >
> > > >
> > > > Argh, this makes me remember
> > > > of https://bugzilla.yoctoproject.org/show_bug.cgi?id=15090
> > > > Do you know if any of cargo based recipe is reproducible ?
> > > > Should I add EXCLUDE_FROM_WORLD in cargo-c ?
> > >
> > > At some point we're going to have to dive in and fix the
> > > reproducibility issues so I'm reluctant to take more patches with
> > > that
> > > set...
> > >
> >
> >
> > It will hardly be doable to correct the reproducibility of rust
> > packages since rust/cargo
> > itself have issues upstream. I take a look and there are lot of open
> > issues
> > cargo:
> > https://github.com/rust-lang/cargo/issues?q=is%3Aissue+is%3Aopen+labe
> > l%3AA-reproducibility+
> > rust:
> > https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label
> > %3AA-reproducibility
>
> I believe there is one problematic reference left which causes problems
> for core rust. Fixing that issue would be the best place to start and
> then we can work from there.
>
> We do already have a lot of good reproducibility pieces in the
> toolchain so not every upstream bug will apply to us.
>

I'm afraid I do not see what is your point, can you elaborate please? What
is the "problematic reference left which causes problems
for core rust" you refer to?


> > There was an RFC accepted back in may
> > (https://github.com/rust-lang/rfcs/pull/3127) and implementation
> > progress have a tracking issue in cargo
> > (https://github.com/rust-lang/cargo/issues/12137) and in rust
> > (https://github.com/rust-lang/rust/issues/111540).
> >
> > Don't know if it will fix our root issue
> > (https://bugzilla.yoctoproject.org/show_bug.cgi?id=14875) but I don't
> > see how to workaround all of that without this upstream work.
> >
> > For cargo-c specific issues, I'll try to make things better (the
> > TMPDIR in debug symbols) but I'm wondering
> > something, reproducibility is  desirable for all generated artifacts
> > or is it only for target ones ?  I mean,
> > the cargo-c is used in native so I'm wondering if making it native
> > only would be acceptable ?
>
> That would certainly avoid this issue. It would also make on target
> testing of the functionality not possible.
>

The test I added is on the final binary generated (rust-c-lib-examble-bin),
not cargo-c itself. So the target test would still be valid.

I tested a release build with a custom patch that strips debuginfo
(strip="debug info" in Cargo.toml) and I do not have build path leaking in
debug symbol anymore. I'll dig this up more and see if I can upstream that.

But the reproducible issue remain despite that.


> Cheers,
>
> Richard
>
>
>
Richard Purdie Aug. 14, 2023, 9:59 a.m. UTC | #13
On Mon, 2023-08-14 at 11:39 +0200, Frédéric Martinsons wrote:
> 
> 
> Le lun. 14 août 2023, 10:46, Richard Purdie
> <richard.purdie@linuxfoundation.org> a écrit :
> > On Mon, 2023-08-14 at 09:30 +0200, Frédéric Martinsons wrote:
> > > 
> > > 
> > > On Sun, 13 Aug 2023 at 17:05, Richard Purdie
> > > <richard.purdie@linuxfoundation.org> wrote:
> > > > On Sun, 2023-08-13 at 17:00 +0200, Frédéric Martinsons wrote:
> > > > > On Sun, 13 Aug 2023 at 16:53, Richard Purdie
> > > > > <richard.purdie@linuxfoundation.org> wrote:
> > > > > > 
> > > > > > and a reproducibility failure:
> > > > > > 
> > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/3355/steps/13/logs/stdio
> > > > > > 
> > > > > > which leads to:
> > > > > > 
> > > > > > http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20230813-z_b2j3ha/packages/diff-html/
> > > > > > 
> > > > > 
> > > > > 
> > > > > Argh, this makes me remember
> > > > > of https://bugzilla.yoctoproject.org/show_bug.cgi?id=15090
> > > > > Do you know if any of cargo based recipe is reproducible ?
> > > > > Should I add EXCLUDE_FROM_WORLD in cargo-c ?
> > > > 
> > > > At some point we're going to have to dive in and fix the
> > > > reproducibility issues so I'm reluctant to take more patches
> > > > with
> > > > that
> > > > set...
> > > > 
> > > 
> > > 
> > > It will hardly be doable to correct the reproducibility of rust
> > > packages since rust/cargo
> > > itself have issues upstream. I take a look and there are lot of
> > > open
> > > issues
> > > cargo: 
> > > https://github.com/rust-lang/cargo/issues?q=is%3Aissue+is%3Aopen+labe
> > > l%3AA-reproducibility+
> > > rust: 
> > > https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label
> > > %3AA-reproducibility
> > 
> > I believe there is one problematic reference left which causes
> > problems
> > for core rust. Fixing that issue would be the best place to start
> > and
> > then we can work from there.
> > 
> > We do already have a lot of good reproducibility pieces in the
> > toolchain so not every upstream bug will apply to us.
> 
> I'm afraid I do not see what is your point, can you elaborate please?
> What is the "problematic reference left which causes problems
> for core rust" you refer to? 

https://bugzilla.yoctoproject.org/show_bug.cgi?id=14875

There appeared to be one reference left in the binaries we couldn't
track down. If we fix that one reference, at least the main rust recipe
issues *should* be fixed.

> > > There was an RFC accepted back in may
> > > (https://github.com/rust-lang/rfcs/pull/3127) and implementation
> > > progress have a tracking issue in cargo
> > > (https://github.com/rust-lang/cargo/issues/12137) and in rust
> > > (https://github.com/rust-lang/rust/issues/111540).
> > > 
> > > Don't know if it will fix our root issue
> > > (https://bugzilla.yoctoproject.org/show_bug.cgi?id=14875) but I
> > > don't
> > > see how to workaround all of that without this upstream work.
> > > 
> > > For cargo-c specific issues, I'll try to make things better (the
> > > TMPDIR in debug symbols) but I'm wondering
> > > something, reproducibility is  desirable for all generated
> > > artifacts
> > > or is it only for target ones ?  I mean, 
> > > the cargo-c is used in native so I'm wondering if making it
> > > native
> > > only would be acceptable ?
> > 
> > That would certainly avoid this issue. It would also make on target
> > testing of the functionality not possible.
> 
> The test I added is on the final binary generated (rust-c-lib-
> examble-bin), not cargo-c itself. So the target test would still be
> valid.

Ok, good.

> I tested a release build with a custom patch that strips debuginfo
> (strip="debug info" in Cargo.toml) and I do not have build path
> leaking in debug symbol anymore. I'll dig this up more and see if I
> can upstream that. 

Debug symbols should be relocated correctly if we pass the correct
compiler options. We usually prefer debug symbols to be present so we
can package them into the -dbg packages.

Cheers,

Richard
Frédéric Martinsons Aug. 15, 2023, 3:52 p.m. UTC | #14
Le dim. 13 août 2023, 16:57, Frédéric Martinsons <
frederic.martinsons@gmail.com> a écrit :

>
>
> On Sun, 13 Aug 2023 at 15:09, Richard Purdie <
> richard.purdie@linuxfoundation.org> wrote:
>
>> On Sun, 2023-08-13 at 12:22 +0100, Richard Purdie via
>> lists.openembedded.org wrote:
>> > On Sun, 2023-08-13 at 12:48 +0200, Frédéric Martinsons wrote:
>> > >
>> > >
>> > > Le dim. 13 août 2023, 12:23, Richard Purdie
>> > > <richard.purdie@linuxfoundation.org> a écrit :
>> > > > On Sun, 2023-08-13 at 10:23 +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 add examples and test to demonstrate
>> > > > > the usage and the good working of this use case.
>> > > > >
>> > > > > Test have been passed with the following in local.conf:
>> > > > >
>> > > > > CORE_IMAGE_EXTRA_INSTALL:append = " openssh-sshd openssh-scp
>> > > > > cargo rust rust-c-lib-example-bin"
>> > > > > IMAGE_CLASSES += "testimage"
>> > > > > TEST_SUITES = "ping ssh rust"
>> > > > > # To use slirp option in testimage.bbclass
>> > > > > TEST_RUNQEMUPARAMS = "slirp"
>> > > > > TEST_SERVER_IP = "127.0.0.1"
>> > > > > QEMU_USE_SLIRP = "1"
>> > > >
>> > > > In testing it showed:
>> > > >
>> > > > stdio: WARNING: cargo-c-0.9.18-r0 do_recipe_qa: QA Issue: Recipe
>> > > > cargo-c in /home/pokybuild/yocto-worker/a-full/build/meta/recipes-
>> > > > devtools/rust/cargo-c_0.9.18.bb does not contain a SUMMARY. Please
>> > > > add an entry. [missing-metadata]
>> > > > stdio: WARNING: cargo-c-native-0.9.18-r0 do_recipe_qa: QA Issue:
>> > > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
>> > > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
>> > > > contain a SUMMARY. Please add an entry. [missing-metadata]
>> > > > stdio: WARNING: nativesdk-cargo-c-0.9.18-r0 do_recipe_qa: QA Issue:
>> > > > Recipe cargo-c in /home/pokybuild/yocto-worker/a-
>> > > > full/build/meta/recipes-devtools/rust/cargo-c_0.9.18.bb does not
>> > > > contain a SUMMARY. Please add an entry. [missing-metadata]
>> > >
>> > > Thanks Richard, will take care of that soon.
>> > >
>> > > Can you tell me what commands do you run to have that sanity check?
>> > > It will avoid me to do the same mistake next time I'll add a recipe.
>> >
>> > It should just show up building the recipe (e.g. "bitbake cargo-c")?
>> >
>> > There are further build failures:
>> >
>> >
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/101/builds/6361/steps/14/logs/stdio
>> >
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/6484/steps/14/logs/stdio
>> >
>> > and the build isn't finished yet so Is suspect there will be more.
>>
>>
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/5606/steps/15/logs/stdio
>>
>> not all of those failures are your patches but:
>>
>> 2023-08-13 12:38:57,894 - oe-selftest - INFO -
>> ======================================================================
>> 2023-08-13 12:38:57,894 - oe-selftest - INFO - FAIL:
>> distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase)
>> 2023-08-13 12:38:57,894 - oe-selftest - INFO -
>> ----------------------------------------------------------------------
>> 2023-08-13 12:38:57,894 - oe-selftest - INFO -
>> testtools.testresult.real._StringException: Traceback (most recent call
>> last):
>>   File
>> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/distrodata.py",
>> line 115, in test_maintainers
>>     self.fail("""
>>   File
>> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py",
>> line 703, in fail
>>     raise self.failureException(msg)
>> AssertionError:
>> Unable to find recipes for the following entries in maintainers.inc:
>> rust-c-lib-example
>> rust-c-lib-example-bin
>>
>
> I don't understand these, because rust-c-lib-example and
> rust-c-lib-example-bin have been added by PATCHV2 (3/4)  in meta-selftest.
> ./meta-selftest/recipes-devtools/rust/rust-c-lib-example-bin_git.bb
> ./meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb
>
> Is this because they are in meta-selftest ? Should I remove them from
> maintainers.inc ?
>
>
>> and this:
>>
>> Traceback (most recent call last):
>>   File
>> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py",
>> line 35, in wrapped_f
>>     return func(*args, **kwargs)
>>            ^^^^^^^^^^^^^^^^^^^^^
>>   File
>> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/core/decorator/__init__.py",
>> line 35, in wrapped_f
>>     return func(*args, **kwargs)
>>            ^^^^^^^^^^^^^^^^^^^^^
>>   File
>> "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/runtime/cases/rust.py",
>> line 31, in test_rust_compile
>>     self.assertEqual(status, 0, msg=msg)
>> AssertionError: 127 != 0 : rust compile failed, output: sh: rustc: not
>> found
>>
>> I don't understand this one either, I simply add openssh-scp in require
> package to run test_rust_compile since its setup function
> copy source on target via scp, rustc is provided by rust recipe and rust
> recipe is required to run this test. Any ideas ?
>

In fact, I do know where it's come from, I just had to look for the
docstring of the decorator OEHasPackage since it tells that the writing
@OEHasPackage(['rust', 'openssh-scp'])
means an "or" (test needs rust or openssh-scp), this is the wrong usage
since the test needs both.

The V3 of the series I just sent should correct that, I also make cargo-c
purely native but for the maintainers.inc issue, I have no clue...


>
>> probably is are, so 2 of the 6 failures. The other 4 are "mine" :/.
>>
>> Cheers,
>>
>> Richard
>>
>>