selftest/multiconfig: Test that multiconfigs in separate layers works

Message ID 20220609094209.41221-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 2306261fb85d5d03145989c3af9c6897111644ae
Headers show
Series selftest/multiconfig: Test that multiconfigs in separate layers works | expand

Commit Message

Richard Purdie June 9, 2022, 9:42 a.m. UTC
We should test that mutliconfigs from a layer work, not just build/conf.
This adds such a test.

[YOCTO #13566]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta-selftest/conf/multiconfig/muslmc.conf  |  2 ++
 meta/lib/oeqa/selftest/cases/multiconfig.py | 13 +++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 meta-selftest/conf/multiconfig/muslmc.conf

Comments

Jose Quaresma June 9, 2022, 5:53 p.m. UTC | #1
Hi Richard,

The same test using the same TMPDIR will be useful as there are some layers
doing that.
AFAIK the archiver and the rm_works don't like it very much.

The OE-core rm_work bbclass doesn't like multiconfig with the same TMPDIR.
This issue with the rm_works is because the native packages use the same
directory and bitbake
will run the native tasks twice, one for each machine. I need to
exclude them to get a green build:
RM_WORK_EXCLUDE:append = " texinfo-dummy-native gettext-minimal-native
gnu-config"
Another interesting detail is that these recipes that have the source dir in
the working dir: $S == $WORKDIR

Jose

Richard Purdie <richard.purdie@linuxfoundation.org> escreveu no dia quinta,
9/06/2022 à(s) 10:42:

> We should test that mutliconfigs from a layer work, not just build/conf.
> This adds such a test.
>
> [YOCTO #13566]
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta-selftest/conf/multiconfig/muslmc.conf  |  2 ++
>  meta/lib/oeqa/selftest/cases/multiconfig.py | 13 +++++++++++++
>  2 files changed, 15 insertions(+)
>  create mode 100644 meta-selftest/conf/multiconfig/muslmc.conf
>
> diff --git a/meta-selftest/conf/multiconfig/muslmc.conf
> b/meta-selftest/conf/multiconfig/muslmc.conf
> new file mode 100644
> index 00000000000..043cd1ccc3b
> --- /dev/null
> +++ b/meta-selftest/conf/multiconfig/muslmc.conf
> @@ -0,0 +1,2 @@
> +TCLIBC = "musl"
> +TMPDIR = "${TOPDIR}/tmp-mc-musl"
> diff --git a/meta/lib/oeqa/selftest/cases/multiconfig.py
> b/meta/lib/oeqa/selftest/cases/multiconfig.py
> index baae9b456f5..83cbd1345da 100644
> --- a/meta/lib/oeqa/selftest/cases/multiconfig.py
> +++ b/meta/lib/oeqa/selftest/cases/multiconfig.py
> @@ -70,3 +70,16 @@ TMPDIR = "${TOPDIR}/tmp-mc-tiny"
>
>          result = bitbake('mc:test:multiconfig-test-parse -c showvar')
>          self.assertIn('MCTESTVAR=test2', result.output.splitlines())
> +
> +    def test_multiconfig_inlayer(self):
> +        """
> +        Test that a multiconfig from meta-selftest works.
> +        """
> +
> +        config = """
> +BBMULTICONFIG = "muslmc"
> +"""
> +        self.write_config(config)
> +
> +        # Build a core-image-minimal, only dry run needed to check config
> is present
> +        bitbake('mc:muslmc:bash -n')
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#166767):
> https://lists.openembedded.org/g/openembedded-core/message/166767
> Mute This Topic: https://lists.openembedded.org/mt/91641952/5052612
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Richard Purdie June 9, 2022, 8:23 p.m. UTC | #2
Hi Jose,

On Thu, 2022-06-09 at 18:53 +0100, Jose Quaresma wrote:
> The same test using the same TMPDIR will be useful as there are some
> layers doing that.
> AFAIK the archiver and the rm_works don't like it very much.

Note that the same TMPDIR is only supported if you're only changing
MACHINE. If you're changing distro config, all bets are off and you
shouldn't be sharing TMPDIR.

I wish we had warning messages when users did that but we currently
don't. It should be possible to add but isn't straightforward.

> The OE-core rm_work bbclass doesn't like multiconfig with the same
> TMPDIR.
> This issue with the rm_works is because the native packages use the
> same directory and bitbake
> will run the native tasks twice, one for each machine. I need to
> exclude them to get a green build:
> RM_WORK_EXCLUDE:append = " texinfo-dummy-native gettext-minimal-
> native gnu-config"
> Another interesting detail is that these recipes that have the source
> dir in
> the working dir: $S == $WORKDIR

If they're building twice, the configuration is differing and they
probably shouldn't be sharing TMPDIR. If there is a configuration you
think should work I'd be interested in the two configs to see why it
builds twice.

Cheers,

Richard

Patch

diff --git a/meta-selftest/conf/multiconfig/muslmc.conf b/meta-selftest/conf/multiconfig/muslmc.conf
new file mode 100644
index 00000000000..043cd1ccc3b
--- /dev/null
+++ b/meta-selftest/conf/multiconfig/muslmc.conf
@@ -0,0 +1,2 @@ 
+TCLIBC = "musl"
+TMPDIR = "${TOPDIR}/tmp-mc-musl"
diff --git a/meta/lib/oeqa/selftest/cases/multiconfig.py b/meta/lib/oeqa/selftest/cases/multiconfig.py
index baae9b456f5..83cbd1345da 100644
--- a/meta/lib/oeqa/selftest/cases/multiconfig.py
+++ b/meta/lib/oeqa/selftest/cases/multiconfig.py
@@ -70,3 +70,16 @@  TMPDIR = "${TOPDIR}/tmp-mc-tiny"
 
         result = bitbake('mc:test:multiconfig-test-parse -c showvar')
         self.assertIn('MCTESTVAR=test2', result.output.splitlines())
+
+    def test_multiconfig_inlayer(self):
+        """
+        Test that a multiconfig from meta-selftest works.
+        """
+
+        config = """
+BBMULTICONFIG = "muslmc"
+"""
+        self.write_config(config)
+
+        # Build a core-image-minimal, only dry run needed to check config is present
+        bitbake('mc:muslmc:bash -n')