diff mbox series

[v2,2/2] data_smart: restore the ability to use capital letters

Message ID 1791794550.8631fc262581453bbf619ec5b2062170.1a12f4716e800080d7@vates.tech
State New
Headers show
Series [v2,1/2] parse: add a (failing) test for a variable override with capital letters | expand

Commit Message

Yann Dirson Oct. 12, 2026, 8:39 a.m. UTC
This reverts commit 6eb56624e6d8dc1944e559b4f6584bfe66f566ba.

That commit was meant as an ad-hoc band-aid when "_" was used as
override prefix, and it explicitly blocked capital letters from being
usable in the overrides.  There is no reason to keep it now we use ":"
as prefix.

Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
---
 lib/bb/data_smart.py  | 2 +-
 lib/bb/tests/parse.py | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

Comments

Mathieu Dubois-Briand Oct. 13, 2026, 5:17 a.m. UTC | #1
On Mon Oct 12, 2026 at 10:39 AM CEST, Yann Dirson via lists.openembedded.org wrote:
> This reverts commit 6eb56624e6d8dc1944e559b4f6584bfe66f566ba.
>
> That commit was meant as an ad-hoc band-aid when "_" was used as
> override prefix, and it explicitly blocked capital letters from being
> usable in the overrides.  There is no reason to keep it now we use ":"
> as prefix.
>
> Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
> ---

Hi Yann,

Thanks for the new version, but we are still seeing the same failure:

FAIL: test_append_in_expanded_override (bb.tests.data.TestOverrides.test_append_in_expanded_override)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/lib/bb/tests/data.py", line 417, in test_append_in_expanded_override
    self.assertEqual(self.d.getVar("TEST"), "base appended")
AssertionError: 'base' != 'base appended'
- base
+ base appended

https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/5075
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/5043
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/4856

Can you have a look at the issue?

Thanks,
Mathieu
Yann Dirson Oct. 13, 2026, 8:59 a.m. UTC | #2
On 10/13/26 7:17 AM, Mathieu Dubois-Briand wrote:
> On Mon Oct 12, 2026 at 10:39 AM CEST, Yann Dirson via lists.openembedded.org wrote:
>> This reverts commit 6eb56624e6d8dc1944e559b4f6584bfe66f566ba.
>>
>> That commit was meant as an ad-hoc band-aid when "_" was used as
>> override prefix, and it explicitly blocked capital letters from being
>> usable in the overrides.  There is no reason to keep it now we use ":"
>> as prefix.
>>
>> Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
>> ---
> 
> Hi Yann,
> 
> Thanks for the new version, but we are still seeing the same failure:
> 
> FAIL: test_append_in_expanded_override (bb.tests.data.TestOverrides.test_append_in_expanded_override)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>    File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/lib/bb/tests/data.py", line 417, in test_append_in_expanded_override
>      self.assertEqual(self.d.getVar("TEST"), "base appended")
> AssertionError: 'base' != 'base appended'
> - base
> + base appended
> 
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/5075
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/5043
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/4856

Wow, that's funky. Getting the same sha1 tested in the autobuilder I 
don't see any failure, do I have anything special to do to reproduce how 
the autobuilder tests things?

$ git fetch origin 83afc355141f2451058f505f18be4b95486ec050
...
 From https://git.openembedded.org/bitbake
  * branch                83afc355141f2451058f505f18be4b95486ec050 -> 
FETCH_HEAD

$ git checkout FETCH_HEAD
...
HEAD is now at 83afc3551 data_smart: restore the ability to use capital 
letters

$ ./bin/bitbake-selftest 
bb.tests.parse.ParseTest.test_parse_mixedcase_pn_override
.
----------------------------------------------------------------------
Ran 1 test in 0.001s

OK

$ git checkout HEAD^
...
HEAD is now at 6e7bdd494 parse: add a (failing) test for a variable 
override with capital letters

$ ./bin/bitbake-selftest 
bb.tests.parse.ParseTest.test_parse_mixedcase_pn_override
x
----------------------------------------------------------------------
Ran 1 test in 0.002s

OK (expected failures=1)
diff mbox series

Patch

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 8aa7c1f99..3c149239f 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -31,7 +31,7 @@  from bb.COW  import COWDictBase
 logger = logging.getLogger("BitBake.Data")
 
 __setvar_keyword__ = [":append", ":prepend", ":remove"]
-__setvar_regexp__ = re.compile(r'(?P<base>.*?)(?P<keyword>:append|:prepend|:remove)(:(?P<add>[^A-Z]*))?$')
+__setvar_regexp__ = re.compile(r'(?P<base>.*?)(?P<keyword>:append|:prepend|:remove)(:(?P<add>.*))?$')
 __expand_var_regexp__ = re.compile(r"\${[a-zA-Z0-9\-_+./~:]+}")
 __expand_python_regexp__ = re.compile(r"\${@(?:{.*?}|.)+?}")
 __whitespace_split__ = re.compile(r'(\s)')
diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
index 7e7dbd923..9fc094b16 100644
--- a/lib/bb/tests/parse.py
+++ b/lib/bb/tests/parse.py
@@ -157,7 +157,6 @@  RPROVIDES:perl-ExtUtils-MakeMaker = "base"
 RPROVIDES:perl-ExtUtils-MakeMaker:append:pn-ExtUtils-MakeMaker = " text"
 """
 
-    @unittest.expectedFailure
     def test_parse_mixedcase_pn_override(self):
         # Recipes named after CPAN distributions have mixed-case PNs, so
         # OVERRIDES contains a mixed-case pn-${PN} entry. An operation