diff mbox series

[2/2] cml1.bbclass: Support the rustavailable task

Message ID 20260109045447.1933604-2-alistair.francis@wdc.com
State Changes Requested
Headers show
Series [1/2] rust: Install the Rust source | expand

Commit Message

Alistair Francis Jan. 9, 2026, 4:54 a.m. UTC
From: Alistair Francis <alistair.francis@wdc.com>

Allow the user to run the rustavailable kernel make command to determine
if Rust is avaliable for kernel builds.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 meta/classes-recipe/cml1.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Bruce Ashfield Jan. 9, 2026, 1:56 p.m. UTC | #1
On Thu, Jan 8, 2026 at 11:55 PM Alistair Francis via lists.openembedded.org
<alistair23=gmail.com@lists.openembedded.org> wrote:

> From: Alistair Francis <alistair.francis@wdc.com>
>
> Allow the user to run the rustavailable kernel make command to determine
> if Rust is avaliable for kernel builds.
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  meta/classes-recipe/cml1.bbclass | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/meta/classes-recipe/cml1.bbclass
> b/meta/classes-recipe/cml1.bbclass
> index 3c2b4da4af..efbdd2a795 100644
> --- a/meta/classes-recipe/cml1.bbclass
> +++ b/meta/classes-recipe/cml1.bbclass
> @@ -107,6 +107,15 @@ do_diffconfig[nostamp] = "1"
>  do_diffconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
>  addtask diffconfig
>
> +python do_rustavailable() {
> +    oe_terminal("sh -c 'make rustavailable; if [ $? -ne 0 ]; then echo
> \"Command failed.\"; fi; printf \"Press any key to continue... \"; read
> r;'",
> +                d.getVar('PN') + ' Configuration', d)
> +}
>

This seems a bit heavy to just determine if rust is available. Since the
task is already after do_configure .. why not just check the .config ?

Bruce



> +
> +do_rustavailable[nostamp] = "1"
> +do_rustavailable[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
> +addtask rustavailable after do_configure
> +
>  do_showconfig() {
>      bbplain "Config file written to ${KCONFIG_CONFIG_ROOTDIR}/.config"
>  }
> --
> 2.52.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#229092):
> https://lists.openembedded.org/g/openembedded-core/message/229092
> Mute This Topic: https://lists.openembedded.org/mt/117170673/1050810
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Bruce Ashfield Jan. 9, 2026, 1:59 p.m. UTC | #2
On Fri, Jan 9, 2026 at 8:56 AM Bruce Ashfield via lists.openembedded.org
<bruce.ashfield=gmail.com@lists.openembedded.org> wrote:

>
>
> On Thu, Jan 8, 2026 at 11:55 PM Alistair Francis via
> lists.openembedded.org <alistair23=gmail.com@lists.openembedded.org>
> wrote:
>
>> From: Alistair Francis <alistair.francis@wdc.com>
>>
>> Allow the user to run the rustavailable kernel make command to determine
>> if Rust is avaliable for kernel builds.
>>
>> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>> ---
>>  meta/classes-recipe/cml1.bbclass | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/meta/classes-recipe/cml1.bbclass
>> b/meta/classes-recipe/cml1.bbclass
>> index 3c2b4da4af..efbdd2a795 100644
>> --- a/meta/classes-recipe/cml1.bbclass
>> +++ b/meta/classes-recipe/cml1.bbclass
>> @@ -107,6 +107,15 @@ do_diffconfig[nostamp] = "1"
>>  do_diffconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
>>  addtask diffconfig
>>
>> +python do_rustavailable() {
>> +    oe_terminal("sh -c 'make rustavailable; if [ $? -ne 0 ]; then echo
>> \"Command failed.\"; fi; printf \"Press any key to continue... \"; read
>> r;'",
>> +                d.getVar('PN') + ' Configuration', d)
>> +}
>>
>
> This seems a bit heavy to just determine if rust is available. Since the
> task is already after do_configure .. why not just check the .config ?
>
>
and of course, I remember this right after hitting send.

This class is used for more than just the kernel, so anything
done needs to be safe for other non-kernel usecases.

Bruce



> Bruce
>
>
>
>> +
>> +do_rustavailable[nostamp] = "1"
>> +do_rustavailable[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
>> +addtask rustavailable after do_configure
>> +
>>  do_showconfig() {
>>      bbplain "Config file written to ${KCONFIG_CONFIG_ROOTDIR}/.config"
>>  }
>> --
>> 2.52.0
>>
>>
>>
>>
>>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await thee
> at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#229117):
> https://lists.openembedded.org/g/openembedded-core/message/229117
> Mute This Topic: https://lists.openembedded.org/mt/117170673/1050810
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Alistair Francis Jan. 12, 2026, 1:06 a.m. UTC | #3
On Fri, 2026-01-09 at 08:59 -0500, Bruce Ashfield wrote:
> 
> 
> On Fri, Jan 9, 2026 at 8:56 AM Bruce Ashfield via
> lists.openembedded.org
> <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
> > 
> > 
> > On Thu, Jan 8, 2026 at 11:55 PM Alistair Francis via
> > lists.openembedded.org
> > <alistair23=gmail.com@lists.openembedded.org> wrote:
> > > From: Alistair Francis <alistair.francis@wdc.com>
> > > 
> > > Allow the user to run the rustavailable kernel make command to
> > > determine
> > > if Rust is avaliable for kernel builds.
> > > 
> > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > ---
> > >  meta/classes-recipe/cml1.bbclass | 9 +++++++++
> > >  1 file changed, 9 insertions(+)
> > > 
> > > diff --git a/meta/classes-recipe/cml1.bbclass b/meta/classes-
> > > recipe/cml1.bbclass
> > > index 3c2b4da4af..efbdd2a795 100644
> > > --- a/meta/classes-recipe/cml1.bbclass
> > > +++ b/meta/classes-recipe/cml1.bbclass
> > > @@ -107,6 +107,15 @@ do_diffconfig[nostamp] = "1"
> > >  do_diffconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
> > >  addtask diffconfig
> > > 
> > > +python do_rustavailable() {
> > > +    oe_terminal("sh -c 'make rustavailable; if [ $? -ne 0 ];
> > > then echo \"Command failed.\"; fi; printf \"Press any key to
> > > continue... \"; read r;'",
> > > +                d.getVar('PN') + ' Configuration', d)
> > > +}
> > > 
> > 
> > 
> > This seems a bit heavy to just determine if rust is available.
> > Since the
> > task is already after do_configure .. why not just check the
> > .config ?

The .config just tells you if it is/isn't available. The script tells
you why it isn't available, which can be helpful.

> > 
> > 
> 
> 
> and of course, I remember this right after hitting send.
> 
> This class is used for more than just the kernel, so anything
> done needs to be safe for other non-kernel usecases.

Ah ok. I'll drop this then as it isn't that important and it's very
kernel specific.

Alistair

> 
> Bruce
> 
>  
> > Bruce
> > 
> >  
> > > +
> > > +do_rustavailable[nostamp] = "1"
> > > +do_rustavailable[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
> > > +addtask rustavailable after do_configure
> > > +
> > >  do_showconfig() {
> > >      bbplain "Config file written to
> > > ${KCONFIG_CONFIG_ROOTDIR}/.config"
> > >  }
diff mbox series

Patch

diff --git a/meta/classes-recipe/cml1.bbclass b/meta/classes-recipe/cml1.bbclass
index 3c2b4da4af..efbdd2a795 100644
--- a/meta/classes-recipe/cml1.bbclass
+++ b/meta/classes-recipe/cml1.bbclass
@@ -107,6 +107,15 @@  do_diffconfig[nostamp] = "1"
 do_diffconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
 addtask diffconfig
 
+python do_rustavailable() {
+    oe_terminal("sh -c 'make rustavailable; if [ $? -ne 0 ]; then echo \"Command failed.\"; fi; printf \"Press any key to continue... \"; read r;'",
+                d.getVar('PN') + ' Configuration', d)
+}
+
+do_rustavailable[nostamp] = "1"
+do_rustavailable[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
+addtask rustavailable after do_configure
+
 do_showconfig() {
     bbplain "Config file written to ${KCONFIG_CONFIG_ROOTDIR}/.config"
 }