[RFC,2/6] meta-ide-support: adjust to provide (e)SDK experience directly in a yocto build

Message ID 20220622103312.1098389-3-alex@linutronix.de
State New
Headers show
Series (e)SDK workflow directly in a Yocto build | expand

Commit Message

Alexander Kanavin June 22, 2022, 10:33 a.m. UTC
Specifically:
1. Add a few more toolchain items to DEPENDS so they're available in the recipe sysroot.
2. Use deploy mechanism to place the SDK environment setup file and testdata for testing it
into the image deploy directory.
3. Add ability to run SDK tests via the testsdk class and task. This also requires providing
a testdata json file.
4. Ensure sysroot population always runs, as those items are mean to be picked up
by 'bitbake build-sysroots' into the unified sysroot.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/recipes-core/meta/meta-ide-support.bb | 26 +++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

Comments

Luca Ceresoli June 23, 2022, 10:03 a.m. UTC | #1
Hi Alex,

On Wed, 22 Jun 2022 12:33:08 +0200
"Alexander Kanavin" <alex.kanavin@gmail.com> wrote:

> Specifically:
> 1. Add a few more toolchain items to DEPENDS so they're available in the recipe sysroot.
> 2. Use deploy mechanism to place the SDK environment setup file and testdata for testing it
> into the image deploy directory.
> 3. Add ability to run SDK tests via the testsdk class and task. This also requires providing
> a testdata json file.
> 4. Ensure sysroot population always runs, as those items are mean to be picked up
> by 'bitbake build-sysroots' into the unified sysroot.
> 
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>


This series is failing on the ABs:

AssertionError: Adding layer meta-mingw changed signatures.
9 signatures changed, initial differences (first hash before, second after):
   meta-ide-support:do_prepare_recipe_sysroot: 8a46421fcb080b73cb27047df1d44a256ccb8115ff5646e8a312a9437d8544dd -> 13c339e339f0e7bd9cd13fcdb28135f37de785dd801e64588e240eced8c1e8c4
      bitbake-diffsigs --task meta-ide-support do_prepare_recipe_sysroot --signature 8a46421fcb080b73cb27047df1d44a256ccb8115ff5646e8a312a9437d8544dd 13c339e339f0e7bd9cd13fcdb28135f37de785dd801e64588e240eced8c1e8c4
      NOTE: Starting bitbake server...
      Taint (by forced/invalidated task) changed from nostamp(uuid4):33106dd5-141b-4115-95b2-69cf0d5d6e2c to nostamp(uuid4):b8a53034-116c-44e6-87a4-744d6c021eb1

Logs:

https://autobuilder.yoctoproject.org/typhoon/#/builders/39/builds/5417/steps/15/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/39/builds/5417/steps/17/logs/stdio
Alexander Kanavin June 23, 2022, 2:52 p.m. UTC | #2
Thanks Luca, this was not meant for merging (RFC), but it helps to see
the issues upfront.

Alex

On Thu, 23 Jun 2022 at 12:03, Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:
>
> Hi Alex,
>
> On Wed, 22 Jun 2022 12:33:08 +0200
> "Alexander Kanavin" <alex.kanavin@gmail.com> wrote:
>
> > Specifically:
> > 1. Add a few more toolchain items to DEPENDS so they're available in the recipe sysroot.
> > 2. Use deploy mechanism to place the SDK environment setup file and testdata for testing it
> > into the image deploy directory.
> > 3. Add ability to run SDK tests via the testsdk class and task. This also requires providing
> > a testdata json file.
> > 4. Ensure sysroot population always runs, as those items are mean to be picked up
> > by 'bitbake build-sysroots' into the unified sysroot.
> >
> > Signed-off-by: Alexander Kanavin <alex@linutronix.de>
>
>
> This series is failing on the ABs:
>
> AssertionError: Adding layer meta-mingw changed signatures.
> 9 signatures changed, initial differences (first hash before, second after):
>    meta-ide-support:do_prepare_recipe_sysroot: 8a46421fcb080b73cb27047df1d44a256ccb8115ff5646e8a312a9437d8544dd -> 13c339e339f0e7bd9cd13fcdb28135f37de785dd801e64588e240eced8c1e8c4
>       bitbake-diffsigs --task meta-ide-support do_prepare_recipe_sysroot --signature 8a46421fcb080b73cb27047df1d44a256ccb8115ff5646e8a312a9437d8544dd 13c339e339f0e7bd9cd13fcdb28135f37de785dd801e64588e240eced8c1e8c4
>       NOTE: Starting bitbake server...
>       Taint (by forced/invalidated task) changed from nostamp(uuid4):33106dd5-141b-4115-95b2-69cf0d5d6e2c to nostamp(uuid4):b8a53034-116c-44e6-87a4-744d6c021eb1
>
> Logs:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/39/builds/5417/steps/15/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#/builders/39/builds/5417/steps/17/logs/stdio
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Luca Ceresoli June 23, 2022, 4:41 p.m. UTC | #3
Hi Alex,

On Thu, 23 Jun 2022 16:52:55 +0200
Alexander Kanavin <alex.kanavin@gmail.com> wrote:

> Thanks Luca, this was not meant for merging (RFC), but it helps to see
> the issues upfront.

Sure, however Richard asked me to test this on the autobuilders.

Cheers.

Patch

diff --git a/meta/recipes-core/meta/meta-ide-support.bb b/meta/recipes-core/meta/meta-ide-support.bb
index 39317d50e0..3d480c71d4 100644
--- a/meta/recipes-core/meta/meta-ide-support.bb
+++ b/meta/recipes-core/meta/meta-ide-support.bb
@@ -2,11 +2,13 @@  SUMMARY = "Integrated Development Environment support"
 DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
 LICENSE = "MIT"
 
-DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native cmake-native"
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native cmake-native autoconf-native automake-native meson-native intltool-native pkgconfig-native"
 PR = "r3"
 RM_WORK_EXCLUDE += "${PN}"
 
-inherit toolchain-scripts nopackages
+inherit toolchain-scripts nopackages deploy testsdk
+
+TESTSDK_CLASS_NAME = "oeqa.sdk.testmetaidesupport.TestSDK"
 
 do_populate_ide_support () {
   toolchain_create_tree_env_script
@@ -18,4 +20,22 @@  python () {
     d.appendVarFlag("do_populate_ide_support", "file-checksums", " " + " ".join(searched))
 }
 
-addtask populate_ide_support before do_build after do_install
+addtask populate_ide_support before do_deploy after do_install
+
+python do_write_test_data() {
+    from oe.data import export2json
+
+    out_dir = d.getVar('B')
+    testdata_name = os.path.join(out_dir, "%s.testdata.json" % d.getVar('PN'))
+
+    export2json(d, testdata_name)
+}
+addtask write_test_data before do_deploy after do_install
+
+do_deploy () {
+        install ${B}/* ${DEPLOYDIR}
+}
+
+addtask deploy before do_build
+
+do_prepare_recipe_sysroot[nostamp] = "1"