diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-07-22 20:39:16 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-07-28 11:50:17 +0100 |
commit | 9b3fcb0d91648ae3b53ec8ffcb31fb6eac9209dd (patch) | |
tree | 46d2431e4f6ad07092fd9642fa4eb2b53d5596d1 | |
parent | 3c940fa09aa9aa1f3dd086242720f19abe4a7596 (diff) | |
download | poky-9b3fcb0d91648ae3b53ec8ffcb31fb6eac9209dd.tar.gz |
selftest/meta_ide: add a test for running SDK tests directly in a yocto build
There's been a recent discussion about how we can make the Yocto SDK
experience better [1]. One of the ideas was to eliminate the SDK
as a separate artefact altogether and simply provide everything
that the SDK and eSDKs do directly in a yocto build. This does not
mean that people have to 'learn Yocto', but rather that the integrators
should provide a well-functioning sstate cache infrastructure (same as
with minimal eSDK, really), and a few wrapper scripts for setting up the build
and the SDK environment that run layer setup and bitbake behind the scenes.
[1] https://lists.openembedded.org/g/openembedded-architecture/topic/thoughts_on_the_esdk/90990557
So without further ado, here's how you get a 'SDK' without building one:
1. Set up all the needed layers and a yocto build directory.
2. Run:
$ bitbake meta-ide-support
$ bitbake -c populate_sysroot gtk+3
(or any other target or native item that the application developer would need)
$ bitbake populate-sysroots
3. Set up the SDK environment:
. tmp/deploy/images/qemux86-64/environment-setup-core2-64-poky-linux
(adjust accordingly)
Et voila! The Unix environment is now set up to use the cross-toolchain from
Yocto, exactly as in the SDK. And devtool/bitbake are available to extend it,
exactly as in the eSDK.
Theare are numerous benefits here: no need to produce, test, distribute and maintain
separate SDK artifacts. No two separate environments for the yocto build and the SDK.
Less code paths where things can go wrong. Less awkward, gigantic tarballs. Less
SDK update headaches: 'updating the SDK' simply means updating the yocto layers with
git fetch or layer management tooling. Built-in SDK extensibility: just run bitbake
again to add more things to the sysroot, or add layers if even more things are required.
How is this tested?
Exactly same as the regular SDK:
$ bitbake -c testsdk meta-ide-support
This runs the same toolchain tests from meta/lib/oeqa/sdk/cases as the regular
sdk testing does.
(From OE-Core rev: 5c845d7f4ea6ae7ba18ed43180dad28775cace31)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/meta_ide.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/cases/meta_ide.py b/meta/lib/oeqa/selftest/cases/meta_ide.py index 6f10d30dc9..ce7bba401d 100644 --- a/meta/lib/oeqa/selftest/cases/meta_ide.py +++ b/meta/lib/oeqa/selftest/cases/meta_ide.py | |||
@@ -16,13 +16,14 @@ class MetaIDE(OESelftestTestCase): | |||
16 | def setUpClass(cls): | 16 | def setUpClass(cls): |
17 | super(MetaIDE, cls).setUpClass() | 17 | super(MetaIDE, cls).setUpClass() |
18 | bitbake('meta-ide-support') | 18 | bitbake('meta-ide-support') |
19 | bb_vars = get_bb_vars(['MULTIMACH_TARGET_SYS', 'TMPDIR', 'COREBASE']) | 19 | bitbake('build-sysroots') |
20 | bb_vars = get_bb_vars(['MULTIMACH_TARGET_SYS', 'DEPLOY_DIR_IMAGE', 'COREBASE']) | ||
20 | cls.environment_script = 'environment-setup-%s' % bb_vars['MULTIMACH_TARGET_SYS'] | 21 | cls.environment_script = 'environment-setup-%s' % bb_vars['MULTIMACH_TARGET_SYS'] |
21 | cls.tmpdir = bb_vars['TMPDIR'] | 22 | cls.deploydir = bb_vars['DEPLOY_DIR_IMAGE'] |
22 | cls.environment_script_path = '%s/%s' % (cls.tmpdir, cls.environment_script) | 23 | cls.environment_script_path = '%s/%s' % (cls.deploydir, cls.environment_script) |
23 | cls.corebasedir = bb_vars['COREBASE'] | 24 | cls.corebasedir = bb_vars['COREBASE'] |
24 | cls.tmpdir_metaideQA = tempfile.mkdtemp(prefix='metaide') | 25 | cls.tmpdir_metaideQA = tempfile.mkdtemp(prefix='metaide') |
25 | 26 | ||
26 | @classmethod | 27 | @classmethod |
27 | def tearDownClass(cls): | 28 | def tearDownClass(cls): |
28 | shutil.rmtree(cls.tmpdir_metaideQA, ignore_errors=True) | 29 | shutil.rmtree(cls.tmpdir_metaideQA, ignore_errors=True) |
@@ -49,3 +50,8 @@ class MetaIDE(OESelftestTestCase): | |||
49 | msg="Running make failed") | 50 | msg="Running make failed") |
50 | self.assertEqual(self.project.run_install(), 0, | 51 | self.assertEqual(self.project.run_install(), 0, |
51 | msg="Running make install failed") | 52 | msg="Running make install failed") |
53 | |||
54 | def test_meta_ide_can_run_sdk_tests(self): | ||
55 | bitbake('-c populate_sysroot gtk+3') | ||
56 | bitbake('build-sysroots') | ||
57 | bitbake('-c testsdk meta-ide-support') | ||