qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] scripts: fix broken error path in modinfo-collect.py
@ 2025-12-03 22:01 Denis V. Lunev via
  2025-12-04  8:37 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Denis V. Lunev via @ 2025-12-03 22:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: den, John Snow, Cleber Rosa

sys.stderr.print is dropped long ago and should not be used. Official
replacement is sys.stderr.write

The problem has been found debugging building on some fancy platform
derived from Debian.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: John Snow <jsnow@redhat.com>
CC: Cleber Rosa <crosa@redhat.com>
---
 scripts/modinfo-collect.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/modinfo-collect.py b/scripts/modinfo-collect.py
index 6ebaea989d..db78b16c1f 100644
--- a/scripts/modinfo-collect.py
+++ b/scripts/modinfo-collect.py
@@ -41,7 +41,7 @@ def main(args):
     for obj in args:
         entry = compile_commands.get(obj, None)
         if not entry:
-            sys.stderr.print('modinfo: Could not find object file', obj)
+            sys.stderr.write(f'modinfo: Could not find object file {obj}')
             sys.exit(1)
         src = entry['file']
         if not src.endswith('.c'):
-- 
2.51.0



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

* Re: [PATCH 1/1] scripts: fix broken error path in modinfo-collect.py
  2025-12-03 22:01 [PATCH 1/1] scripts: fix broken error path in modinfo-collect.py Denis V. Lunev via
@ 2025-12-04  8:37 ` Philippe Mathieu-Daudé
  2025-12-08 23:55   ` Denis V. Lunev
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-04  8:37 UTC (permalink / raw)
  To: Denis V. Lunev, qemu-devel; +Cc: John Snow, Cleber Rosa

On 3/12/25 23:01, Denis V. Lunev via wrote:
> sys.stderr.print is dropped long ago and should not be used. Official
> replacement is sys.stderr.write
> 
> The problem has been found debugging building on some fancy platform
> derived from Debian.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: John Snow <jsnow@redhat.com>
> CC: Cleber Rosa <crosa@redhat.com>
> ---
>   scripts/modinfo-collect.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/modinfo-collect.py b/scripts/modinfo-collect.py
> index 6ebaea989d..db78b16c1f 100644
> --- a/scripts/modinfo-collect.py
> +++ b/scripts/modinfo-collect.py
> @@ -41,7 +41,7 @@ def main(args):
>       for obj in args:
>           entry = compile_commands.get(obj, None)
>           if not entry:
> -            sys.stderr.print('modinfo: Could not find object file', obj)
> +            sys.stderr.write(f'modinfo: Could not find object file {obj}')

Missing trailing '\n'? Otherwise,

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

>               sys.exit(1)
>           src = entry['file']
>           if not src.endswith('.c'):



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

* Re: [PATCH 1/1] scripts: fix broken error path in modinfo-collect.py
  2025-12-04  8:37 ` Philippe Mathieu-Daudé
@ 2025-12-08 23:55   ` Denis V. Lunev
  0 siblings, 0 replies; 3+ messages in thread
From: Denis V. Lunev @ 2025-12-08 23:55 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Denis V. Lunev, qemu-devel
  Cc: John Snow, Cleber Rosa

On 12/4/25 09:37, Philippe Mathieu-Daudé wrote:
> On 3/12/25 23:01, Denis V. Lunev via wrote:
>> sys.stderr.print is dropped long ago and should not be used. Official
>> replacement is sys.stderr.write
>>
>> The problem has been found debugging building on some fancy platform
>> derived from Debian.
>>
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> CC: John Snow <jsnow@redhat.com>
>> CC: Cleber Rosa <crosa@redhat.com>
>> ---
>>   scripts/modinfo-collect.py | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/modinfo-collect.py b/scripts/modinfo-collect.py
>> index 6ebaea989d..db78b16c1f 100644
>> --- a/scripts/modinfo-collect.py
>> +++ b/scripts/modinfo-collect.py
>> @@ -41,7 +41,7 @@ def main(args):
>>       for obj in args:
>>           entry = compile_commands.get(obj, None)
>>           if not entry:
>> -            sys.stderr.print('modinfo: Could not find object file', 
>> obj)
>> +            sys.stderr.write(f'modinfo: Could not find object file 
>> {obj}')
>
> Missing trailing '\n'? Otherwise,
Nope. Double checked using the following:

iris ~/src/qemu $ git diff
diff --git a/scripts/modinfo-collect.py b/scripts/modinfo-collect.py
index 980956c660..737700d5fb 100644
--- a/scripts/modinfo-collect.py
+++ b/scripts/modinfo-collect.py
@@ -40,8 +40,8 @@ def main(args):

      for obj in args:
          entry = compile_commands.get(obj, None)
-        if not entry:
-            sys.stderr.write(f'modinfo: Could not find object file {obj}')
+        if True:
+            sys.stderr.write(f'modinfo: Could not find object file {obj}')
              sys.exit(1)
          src = entry['file']
          if not src.endswith('.c'):
iris ~/src/qemu $

In order to trigger the build we should command
     ./configure --target-list=x86_64-softmmu --enable-modules
and with the original patch the output is like the following:

--- stderr ---
modinfo: Could not find object file libmodule-common.a.p/module-common.c.o
[73/2396] Generating audio-spice.modinfo with a custom command (wrapped 
by meson to capture output)
FAILED: audio-spice.modinfo
/home/den/src/qemu/build/pyvenv/bin/meson --internal exe --capture 
audio-spice.modinfo -- /home/den/src/qemu/build/pyvenv/bin/python3 
/home/den/src/qemu/scripts/modinfo-collect.py 
libmodule-common.a.p/module-common.c.o 
libaudio-spice.a.p/audio_spiceaudio.c.o
--- stderr ---
modinfo: Could not find object file libmodule-common.a.p/module-common.c.o
[74/2396] Generating audio-pa.modinfo with a custom command (wrapped by 
meson to capture output)
FAILED: audio-pa.modinfo
/home/den/src/qemu/build/pyvenv/bin/meson --internal exe --capture 
audio-pa.modinfo -- /home/den/src/qemu/build/pyvenv/bin/python3 
/home/den/src/qemu/scripts/modinfo-collect.py 
libmodule-common.a.p/module-common.c.o libaudio-pa.a.p/audio_paaudio.c.o

which I believe is great :-)

Additional line is inserted with \n added.

>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
>>               sys.exit(1)
>>           src = entry['file']
>>           if not src.endswith('.c'):
>

Den


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

end of thread, other threads:[~2025-12-09  0:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-03 22:01 [PATCH 1/1] scripts: fix broken error path in modinfo-collect.py Denis V. Lunev via
2025-12-04  8:37 ` Philippe Mathieu-Daudé
2025-12-08 23:55   ` Denis V. Lunev

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).