diff mbox series

[meta-lts-mixins,kirkstone/rust] rust: Add new varaible RUST_ENABLE_EXTRA_TOOLS

Message ID 20240801054452.57965-1-ranjitsinh.rathod@kpit.com
State New
Headers show
Series [meta-lts-mixins,kirkstone/rust] rust: Add new varaible RUST_ENABLE_EXTRA_TOOLS | expand

Commit Message

Ranjitsinh Rathod Aug. 1, 2024, 5:44 a.m. UTC
There is a need to enable some extra tools from the rust for the build
and so this new variable will help for that

This varaible then we can use during do_configure task to add overall
values as per json format in build -> tools

Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
---
 recipes-devtools/rust/rust_1.75.0.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--
2.25.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

Comments

Scott Murray Aug. 1, 2024, 2:56 p.m. UTC | #1
On Thu, 1 Aug 2024, Quentin Schulz wrote:

> Hi Ranjitsinh,
[snip]
>
> On 8/1/24 7:44 AM, Ranjitsinh Rathod via lists.yoctoproject.org wrote:
> > [You don't often get email from ranjitsinh.rathod=kpit.com@lists.yoctoproject.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> >
> > There is a need to enable some extra tools from the rust for the build
> > and so this new variable will help for that
> >
> > This varaible then we can use during do_configure task to add overall
> > values as per json format in build -> tools
> >
> > Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
> > ---
> >ᅵᅵ recipes-devtools/rust/rust_1.75.0.bb | 6 +++++-
> >ᅵᅵ 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/recipes-devtools/rust/rust_1.75.0.bb b/recipes-devtools/rust/rust_1.75.0.bb
> > index 76e1fe2..c33f31d 100644
> > --- a/recipes-devtools/rust/rust_1.75.0.bb
> > +++ b/recipes-devtools/rust/rust_1.75.0.bb
> > @@ -70,6 +70,10 @@ addtask do_test_compile after do_configure do_rust_gen_targets
> >ᅵᅵ do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot"
> >ᅵᅵ do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER"
> >
> > +# there is a need to enable some more rust tools for the project
> > +# We can extend a list of more tools via this variable
> > +RUST_ENABLE_EXTRA_TOOLS ?= "rust-demangler"
> > +
> >ᅵᅵ python do_configure() {
> >ᅵᅵᅵᅵᅵᅵ import json
> >ᅵᅵᅵᅵᅵᅵ import configparser
> > @@ -141,7 +145,7 @@ python do_configure() {
> >ᅵᅵᅵᅵᅵᅵ config.add_section("build")
> >ᅵᅵᅵᅵᅵᅵ config.set("build", "submodules", e(False))
> >ᅵᅵᅵᅵᅵᅵ config.set("build", "docs", e(False))
> > -ᅵᅵᅵ config.set("build", "tools", ["rust-demangler",])
> > +ᅵᅵᅵ config.set("build", "tools", e(d.getVar("RUST_ENABLE_EXTRA_TOOLS").split()))
>
> It seems like the demangler has been removed in master branch of
> oe-core, see
> https://git.openembedded.org/openembedded-core/commit/meta/recipes-devtools/rust/rust_1.75.0.bb?id=58eaf2ee6c0809bf0a0d3c1d177e62bda7241651
>
> I don't know the policy for this layer or branch, but it's possible that
> a change that would benefit the latest branches of OE-Core/Yocto should
> first land there and then be backported to meta-lts-mixin? I'll let the
> maintainer confirm or not :)

Indeed, I won't take this change without it going through master first,
as I'm trying to avoid carrying extra changes that could complicate
backporting future Rust upgrades.

Scott
Ranjitsinh Rathod Aug. 7, 2024, 7:48 a.m. UTC | #2
Hello Scott,

I have sent the patch in upstream scarthgap and it is accepted and available on the scarthgap.
scarthgap change: https://git.yoctoproject.org/poky/commit/?h=scarthgap&id=6ced2e7ca3b58130154035ad61685cd222909680

Also I have mentioned during the patch that this is not compatible for the upstream master as the line on which I'm doing changes, was removed
https://lists.openembedded.org/g/openembedded-core/message/202732
https://lists.openembedded.org/g/openembedded-core/message/202988

Thanks,
Ranjitsinh Rathod
Yash Shinde Aug. 8, 2024, 7:15 a.m. UTC | #3
I checked for the reproducibility issue on rust v1.75 i.e current master (using cmd: "oe-selftest -v -j 32 -K -r reproducible")
by enabling the "rust-demangler" tool as given in this patch.

There were no errors seen and tests were passed.
Rust version will be upgraded in master with rust v1.77 soon.
We need to check reproducibility with enabling the "rust-demangler" tool there as well.

If the tests pass, we can enable the tool in master, unless it doesn't impact any other regressions.

Regards,
Yash
Scott Murray Aug. 28, 2024, 8:21 p.m. UTC | #4
On Wed, 7 Aug 2024, Ranjitsinh Rathod via lists.yoctoproject.org wrote:

> Hello Scott,
>
> I have sent the patch in upstream scarthgap and it is accepted and available on the scarthgap.
> scarthgap change: https://git.yoctoproject.org/poky/commit/?h=scarthgap&id=6ced2e7ca3b58130154035ad61685cd222909680
>
> Also I have mentioned during the patch that this is not compatible for the upstream master as the line on which I'm doing changes, was removed
> https://lists.openembedded.org/g/openembedded-core/message/202732
> https://lists.openembedded.org/g/openembedded-core/message/202988
>
> Thanks,
> Ranjitsinh Rathod

Just to follow up on this, I have not included this change in my updates
to the kirkstone/rust mixin layer, as my policy is that that branch
tracks the state of oe-core's master branch.  If you want a hook to enable
building rust-demangler available for kirkstone, my suggestion is to work
up a change for the Rust recipe in oe-core master that allows making the
addition while preserving the default behavior of ensuring that the Rust
build is reproducible.

Scott
diff mbox series

Patch

diff --git a/recipes-devtools/rust/rust_1.75.0.bb b/recipes-devtools/rust/rust_1.75.0.bb
index 76e1fe2..c33f31d 100644
--- a/recipes-devtools/rust/rust_1.75.0.bb
+++ b/recipes-devtools/rust/rust_1.75.0.bb
@@ -70,6 +70,10 @@  addtask do_test_compile after do_configure do_rust_gen_targets
 do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot"
 do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER"

+# there is a need to enable some more rust tools for the project
+# We can extend a list of more tools via this variable
+RUST_ENABLE_EXTRA_TOOLS ?= "rust-demangler"
+
 python do_configure() {
     import json
     import configparser
@@ -141,7 +145,7 @@  python do_configure() {
     config.add_section("build")
     config.set("build", "submodules", e(False))
     config.set("build", "docs", e(False))
-    config.set("build", "tools", ["rust-demangler",])
+    config.set("build", "tools", e(d.getVar("RUST_ENABLE_EXTRA_TOOLS").split()))

     rustc = d.expand("${WORKDIR}/rust-snapshot/bin/rustc")
     config.set("build", "rustc", e(rustc))