linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kunit: kunit_config: Fix parsing of CONFIG options with space
@ 2020-06-07 21:57 Rikard Falkeborn
  2020-06-09 19:58 ` Brendan Higgins
  2020-06-30  7:15 ` David Gow
  0 siblings, 2 replies; 4+ messages in thread
From: Rikard Falkeborn @ 2020-06-07 21:57 UTC (permalink / raw)
  To: linux-kselftest; +Cc: brendanhiggins, masahiroy, linux-kernel, Rikard Falkeborn

Commit 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is
updated") introduced a new CONFIG option CONFIG_CC_VERSION_TEXT. On my
system, this is set to "gcc (GCC) 10.1.0" which breaks KUnit config
parsing which did not like the spaces in the string.

Fix this by updating the regex to allow strings containing spaces.

Fixes: 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is updated")
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
Maybe it would have been sufficient to just use
CONFIG_PATTERN = r'^CONFIG_(\w+)=(.*)$' instead?

 tools/testing/kunit/kunit_config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/kunit/kunit_config.py b/tools/testing/kunit/kunit_config.py
index e75063d603b5..02ffc3a3e5dc 100644
--- a/tools/testing/kunit/kunit_config.py
+++ b/tools/testing/kunit/kunit_config.py
@@ -10,7 +10,7 @@ import collections
 import re
 
 CONFIG_IS_NOT_SET_PATTERN = r'^# CONFIG_(\w+) is not set$'
-CONFIG_PATTERN = r'^CONFIG_(\w+)=(\S+)$'
+CONFIG_PATTERN = r'^CONFIG_(\w+)=(\S+|".*")$'
 
 KconfigEntryBase = collections.namedtuple('KconfigEntry', ['name', 'value'])
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] kunit: kunit_config: Fix parsing of CONFIG options with space
  2020-06-07 21:57 [PATCH] kunit: kunit_config: Fix parsing of CONFIG options with space Rikard Falkeborn
@ 2020-06-09 19:58 ` Brendan Higgins
  2020-06-30  7:15 ` David Gow
  1 sibling, 0 replies; 4+ messages in thread
From: Brendan Higgins @ 2020-06-09 19:58 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: open list:KERNEL SELFTEST FRAMEWORK, Masahiro Yamada,
	Linux Kernel Mailing List

On Sun, Jun 7, 2020 at 2:57 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> Commit 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is
> updated") introduced a new CONFIG option CONFIG_CC_VERSION_TEXT. On my
> system, this is set to "gcc (GCC) 10.1.0" which breaks KUnit config
> parsing which did not like the spaces in the string.
>
> Fix this by updating the regex to allow strings containing spaces.
>
> Fixes: 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is updated")
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>

Thanks for the patch! I had been meaning to send out a fix for this
for a while, but never got around to it. :-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kunit: kunit_config: Fix parsing of CONFIG options with space
  2020-06-07 21:57 [PATCH] kunit: kunit_config: Fix parsing of CONFIG options with space Rikard Falkeborn
  2020-06-09 19:58 ` Brendan Higgins
@ 2020-06-30  7:15 ` David Gow
  2020-07-01 19:10   ` Shuah Khan
  1 sibling, 1 reply; 4+ messages in thread
From: David Gow @ 2020-06-30  7:15 UTC (permalink / raw)
  To: Rikard Falkeborn, Shuah Khan
  Cc: open list:KERNEL SELFTEST FRAMEWORK, Brendan Higgins, masahiroy,
	Linux Kernel Mailing List

On Mon, Jun 8, 2020 at 5:57 AM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> Commit 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is
> updated") introduced a new CONFIG option CONFIG_CC_VERSION_TEXT. On my
> system, this is set to "gcc (GCC) 10.1.0" which breaks KUnit config
> parsing which did not like the spaces in the string.
>
> Fix this by updating the regex to allow strings containing spaces.
>
> Fixes: 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is updated")
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Tested-by: David Gow <davidgow@google.com>

I've been using this patch quite a bit, and haven't hit any problems.

+Shuah: Any chance we get this into the kunit branch sooner rather
than later? The KUnit tooling is quite broken without it.

> ---
> Maybe it would have been sufficient to just use
> CONFIG_PATTERN = r'^CONFIG_(\w+)=(.*)$' instead?
>

FWIW, I tried this myself, and it seemed to work, but I think I like
requiring the quotes more.

Cheers,
-- David

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kunit: kunit_config: Fix parsing of CONFIG options with space
  2020-06-30  7:15 ` David Gow
@ 2020-07-01 19:10   ` Shuah Khan
  0 siblings, 0 replies; 4+ messages in thread
From: Shuah Khan @ 2020-07-01 19:10 UTC (permalink / raw)
  To: David Gow, Rikard Falkeborn, Shuah Khan
  Cc: open list:KERNEL SELFTEST FRAMEWORK, Brendan Higgins, masahiroy,
	Linux Kernel Mailing List, skhan

On 6/30/20 1:15 AM, David Gow wrote:
> On Mon, Jun 8, 2020 at 5:57 AM Rikard Falkeborn
> <rikard.falkeborn@gmail.com> wrote:
>>
>> Commit 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is
>> updated") introduced a new CONFIG option CONFIG_CC_VERSION_TEXT. On my
>> system, this is set to "gcc (GCC) 10.1.0" which breaks KUnit config
>> parsing which did not like the spaces in the string.
>>
>> Fix this by updating the regex to allow strings containing spaces.
>>
>> Fixes: 8b59cd81dc5e ("kbuild: ensure full rebuild when the compiler is updated")
>> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> 
> Tested-by: David Gow <davidgow@google.com>
> 
> I've been using this patch quite a bit, and haven't hit any problems.
> 
> +Shuah: Any chance we get this into the kunit branch sooner rather
> than later? The KUnit tooling is quite broken without it.
> 


Applied to linux-kselftest kunit

https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/log/?h=kunit

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-01 19:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-07 21:57 [PATCH] kunit: kunit_config: Fix parsing of CONFIG options with space Rikard Falkeborn
2020-06-09 19:58 ` Brendan Higgins
2020-06-30  7:15 ` David Gow
2020-07-01 19:10   ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).