Skip to contentSkip to conversation

insane.bbclass: avoid unnecessary rerun of do_patch

PATCH Superseded [email protected] 3 participants 4 messages Dec 17, 2025 – Dec 18, 2025

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 insane.bbclass: avoid unnecessary rerun of do_patch

From: Chen Qi <[email protected]>

When toggling ptest for DISTRO_FEATURES, the do_patch function gets rerun.

The dependency chain is:
do_patch -> do_qa_patch -> DISTRO_FEATURES{ptest}

Such rerun is not necessary. And it's kind of annoying because everything gets rebuilt, including cross toolchain and recipes not using ptest.

The ERROR_QA and WARN_QA should be enough to trigger the re-run if unimplemented-ptest is added to one of them.

---
 meta/classes-global/insane.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes-global/insane.bbclass +1 -0
index fed8163c3e..3185209b7f 100644
@@ -1345,6 +1345,7 @@ python do_qa_patch() {
 
     oe.qa.exit_if_errors(d)
 }
+do_qa_patch[vardepsexclude] = "DISTRO_FEATURES"
 
 python do_qa_configure() {
     import subprocess
Signature · 1 line
2.34.1
#1 lore raw
Quoted 11 lines · Chen Qi via lists.openembedded.org

When toggling ptest for DISTRO_FEATURES, the do_patch function gets rerun.

The dependency chain is:
do_patch -> do_qa_patch -> DISTRO_FEATURES{ptest}

Such rerun is not necessary. And it's kind of annoying because everything gets rebuilt, including cross toolchain and recipes not using ptest.

The ERROR_QA and WARN_QA should be enough to trigger the re-run if unimplemented-ptest is added to one of them.

...

Quoted 1 line

+do_qa_patch[vardepsexclude] = "DISTRO_FEATURES"

The offending code is this:

if not bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
pass
elif
(gigantic list of elif checks follows)

I wonder if we should rather drop this first check for DISTRO_FEATURES instead. These are recipe-level checks, and the issues reported are valid regardless of whether ptest is in someone's DISTRO_FEATURES or not.

Using vardepsexclude is problematic because do_qa_patch may have other uses of DISTRO_FEATURES in the future, and the same reasoning may not apply to them.

Alex

author
#2 lore raw

I agree. I'll send out V3.

Regards,
Qi

-----Original Message-----
From: Alexander Kanavin <[email protected]>
Sent: Wednesday, December 17, 2025 7:02 PM
To: Chen, Qi <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core][PATCH V2] insane.bbclass: avoid unnecessary rerun of do_patch

Quoted 11 lines · Chen Qi via lists.openembedded.org

When toggling ptest for DISTRO_FEATURES, the do_patch function gets rerun.

The dependency chain is:
do_patch -> do_qa_patch -> DISTRO_FEATURES{ptest}

Such rerun is not necessary. And it's kind of annoying because everything gets rebuilt, including cross toolchain and recipes not using ptest.

The ERROR_QA and WARN_QA should be enough to trigger the re-run if unimplemented-ptest is added to one of them.

...

Quoted 1 line

+do_qa_patch[vardepsexclude] = "DISTRO_FEATURES"

The offending code is this:

if not bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
pass
elif
(gigantic list of elif checks follows)

I wonder if we should rather drop this first check for DISTRO_FEATURES instead. These are recipe-level checks, and the issues reported are valid regardless of whether ptest is in someone's DISTRO_FEATURES or not.

Using vardepsexclude is problematic because do_qa_patch may have other uses of DISTRO_FEATURES in the future, and the same reasoning may not apply to them.

Alex

#3 lore raw
In reply to Alexander Kanavin
Quoted 24 lines · Alexander Kanavin via lists.openembedded.org
Quoted 11 lines · Chen Qi via lists.openembedded.org

When toggling ptest for DISTRO_FEATURES, the do_patch function gets rerun.

The dependency chain is:
do_patch -> do_qa_patch -> DISTRO_FEATURES{ptest}

Such rerun is not necessary. And it's kind of annoying because everything gets rebuilt, including cross toolchain and recipes not using ptest.

The ERROR_QA and WARN_QA should be enough to trigger the re-run if unimplemented-ptest is added to one of them.

...

Quoted 1 line

+do_qa_patch[vardepsexclude] = "DISTRO_FEATURES"

The offending code is this:

if not bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
pass
elif
(gigantic list of elif checks follows)

Quoted 4 lines

I wonder if we should rather drop this first check for DISTRO_FEATURES instead. These are recipe-level checks, and the issues reported are valid regardless of whether ptest is in someone's DISTRO_FEATURES or not.

The idea behind this check was to not make a user who has disabled ptests pay the performance cost of reading/exploring a bunch of file/directories.
But the test on ERROR/WARN QA should largely be enough for that goal. I agree with you on dropping the first check for DISTRO_FEATURES.

Quoted 14 lines

Using vardepsexclude is problematic because do_qa_patch may have other uses of DISTRO_FEATURES in the future, and the same reasoning may not apply to them.

Alex

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#228024): https://lists.openembedded.org/g/openembedded-core/message/228024
Mute This Topic: https://lists.openembedded.org/mt/116824171/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Yoann Congal
Smile ECS