diff mbox series

[v2,09/10] packagegroup-core-sdk: Add SDK toolchain language selection support

Message ID 20221221125306.13779-10-alex.kiernan@gmail.com
State Accepted, archived
Commit 1ad7bb050accd930c85b6c51721046867394f629
Headers show
Series Add rust runtime tests | expand

Commit Message

Alex Kiernan Dec. 21, 2022, 12:53 p.m. UTC
Use SDK_TOOLCHAIN_LANGS to allow different language support to be
selected within SDKs. Initially supported options are rust and go.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

(no changes since v1)

 .../packagegroups/packagegroup-core-sdk.bb             | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Richard Purdie Dec. 21, 2022, 4:39 p.m. UTC | #1
On Wed, 2022-12-21 at 12:53 +0000, Alex Kiernan wrote:
> Use SDK_TOOLCHAIN_LANGS to allow different language support to be
> selected within SDKs. Initially supported options are rust and go.
> 
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> ---
> 
> (no changes since v1)
> 
>  .../packagegroups/packagegroup-core-sdk.bb             | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> index d70aff22c725..0e480e6ac756 100644
> --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> @@ -11,6 +11,11 @@ inherit packagegroup
>  
>  #PACKAGEFUNCS =+ 'generate_sdk_pkgs'
>  
> +SDK_TOOLCHAIN_LANGS ??= ""
> +SDK_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust"
> +# libstd-rs doesn't build for mips n32 with compiler constraint errors
> +SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
> +
>  RDEPENDS:packagegroup-core-sdk = "\
>      packagegroup-core-buildessential \
>      coreutils \
> @@ -23,7 +28,10 @@ RDEPENDS:packagegroup-core-sdk = "\
>      less \
>      ldd \
>      file \
> -    tcl"
> +    tcl \
> +    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \
> +    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \
> +"

I'm a little torn on this. I created SDK_TOOLCHAIN_LANGS as a control
for the SDKs from populate_sdk. Whether the target SDK images should
follow that as well, I'm less sure.

It is probably fine and I nearly didn't send a comment but I just
wanted to see what others think.

We could perhaps do something like:

TARGET_TOOLCHAIN_LANGS ??= "${SDK_TOOLCHAIN_LANGS}"

in the recipe to cover the ability to separate the two if we wanted...

Cheers,

Richard
Alex Kiernan Dec. 21, 2022, 4:42 p.m. UTC | #2
On Wed, Dec 21, 2022 at 4:39 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Wed, 2022-12-21 at 12:53 +0000, Alex Kiernan wrote:
> > Use SDK_TOOLCHAIN_LANGS to allow different language support to be
> > selected within SDKs. Initially supported options are rust and go.
> >
> > Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> > ---
> >
> > (no changes since v1)
> >
> >  .../packagegroups/packagegroup-core-sdk.bb             | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > index d70aff22c725..0e480e6ac756 100644
> > --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > @@ -11,6 +11,11 @@ inherit packagegroup
> >
> >  #PACKAGEFUNCS =+ 'generate_sdk_pkgs'
> >
> > +SDK_TOOLCHAIN_LANGS ??= ""
> > +SDK_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust"
> > +# libstd-rs doesn't build for mips n32 with compiler constraint errors
> > +SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
> > +
> >  RDEPENDS:packagegroup-core-sdk = "\
> >      packagegroup-core-buildessential \
> >      coreutils \
> > @@ -23,7 +28,10 @@ RDEPENDS:packagegroup-core-sdk = "\
> >      less \
> >      ldd \
> >      file \
> > -    tcl"
> > +    tcl \
> > +    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \
> > +    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \
> > +"
>
> I'm a little torn on this. I created SDK_TOOLCHAIN_LANGS as a control
> for the SDKs from populate_sdk. Whether the target SDK images should
> follow that as well, I'm less sure.
>
> It is probably fine and I nearly didn't send a comment but I just
> wanted to see what others think.
>
> We could perhaps do something like:
>
> TARGET_TOOLCHAIN_LANGS ??= "${SDK_TOOLCHAIN_LANGS}"
>
> in the recipe to cover the ability to separate the two if we wanted...
>

I ummed and ahhed about reusing it... so I think it's a good discussion point...
Khem Raj Dec. 21, 2022, 6:54 p.m. UTC | #3
On Wed, Dec 21, 2022 at 8:39 AM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Wed, 2022-12-21 at 12:53 +0000, Alex Kiernan wrote:
> > Use SDK_TOOLCHAIN_LANGS to allow different language support to be
> > selected within SDKs. Initially supported options are rust and go.
> >
> > Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> > ---
> >
> > (no changes since v1)
> >
> >  .../packagegroups/packagegroup-core-sdk.bb             | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > index d70aff22c725..0e480e6ac756 100644
> > --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > @@ -11,6 +11,11 @@ inherit packagegroup
> >
> >  #PACKAGEFUNCS =+ 'generate_sdk_pkgs'
> >
> > +SDK_TOOLCHAIN_LANGS ??= ""
> > +SDK_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust"
> > +# libstd-rs doesn't build for mips n32 with compiler constraint errors
> > +SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
> > +
> >  RDEPENDS:packagegroup-core-sdk = "\
> >      packagegroup-core-buildessential \
> >      coreutils \
> > @@ -23,7 +28,10 @@ RDEPENDS:packagegroup-core-sdk = "\
> >      less \
> >      ldd \
> >      file \
> > -    tcl"
> > +    tcl \
> > +    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go',
> 'packagegroup-go-sdk-target', '', d)} \
> > +    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust',
> 'packagegroup-rust-sdk-target', '', d)} \
> > +"
>
> I'm a little torn on this. I created SDK_TOOLCHAIN_LANGS as a control
> for the SDKs from populate_sdk. Whether the target SDK images should
> follow that as well, I'm less sure.
>
> It is probably fine and I nearly didn't send a comment but I just
> wanted to see what others think.
>
> We could perhaps do something like:
>
> TARGET_TOOLCHAIN_LANGS ??= "${SDK_TOOLCHAIN_LANGS}"


Let’s go with this approach. It’s in line with other similar variables


>
> in the recipe to cover the ability to separate the two if we wanted...
>
> Cheers,
>
> Richard
>
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#174922):
> https://lists.openembedded.org/g/openembedded-core/message/174922
> Mute This Topic: https://lists.openembedded.org/mt/95805446/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
index d70aff22c725..0e480e6ac756 100644
--- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
@@ -11,6 +11,11 @@  inherit packagegroup
 
 #PACKAGEFUNCS =+ 'generate_sdk_pkgs'
 
+SDK_TOOLCHAIN_LANGS ??= ""
+SDK_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust"
+# libstd-rs doesn't build for mips n32 with compiler constraint errors
+SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
+
 RDEPENDS:packagegroup-core-sdk = "\
     packagegroup-core-buildessential \
     coreutils \
@@ -23,7 +28,10 @@  RDEPENDS:packagegroup-core-sdk = "\
     less \
     ldd \
     file \
-    tcl"
+    tcl \
+    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \
+    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \
+"
 
 SANITIZERS = "libasan-dev libubsan-dev"
 SANITIZERS:arc = ""