* [PATCH] scripts: dump stdin on meson-buildoptions error
@ 2025-02-27 18:04 Patrick Venture
2025-02-28 10:26 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Patrick Venture @ 2025-02-27 18:04 UTC (permalink / raw)
To: pbonzini
Cc: marcandre.lureau, berrange, philmd, qemu-devel, Nabih Estefan,
Patrick Venture
From: Nabih Estefan <nabihestefan@google.com>
Dump sys.stdin when it errors on meson-buildoptions.py, letting us debug
the build errors instead of just saying "Couldn't parse"
Signed-off-by: Nabih Estefan <nabihestefan@google.com>
Signed-off-by: Patrick Venture <venture@google.com>
---
scripts/meson-buildoptions.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py
index 4814a8ff61..a3e22471b2 100644
--- a/scripts/meson-buildoptions.py
+++ b/scripts/meson-buildoptions.py
@@ -241,8 +241,14 @@ def print_parse(options):
print(" esac")
print("}")
-
-options = load_options(json.load(sys.stdin))
+json_data = sys.stdin.read()
+try:
+ options = load_options(json.loads(json_data))
+except:
+ print("Failure in scripts/meson-buildoptions.py parsing stdin as json",
+ file=sys.stderr)
+ print(json_data, file=sys.stderr)
+ sys.exit(1)
print("# This file is generated by meson-buildoptions.py, do not edit!")
print_help(options)
print_parse(options)
--
2.48.1.658.g4767266eb4-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scripts: dump stdin on meson-buildoptions error
2025-02-27 18:04 [PATCH] scripts: dump stdin on meson-buildoptions error Patrick Venture
@ 2025-02-28 10:26 ` Paolo Bonzini
2025-02-28 18:17 ` Patrick Venture
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2025-02-28 10:26 UTC (permalink / raw)
To: Patrick Venture
Cc: pbonzini, marcandre.lureau, berrange, philmd, qemu-devel,
Nabih Estefan
> Dump sys.stdin when it errors on meson-buildoptions.py, letting us debug
> the build errors instead of just saying "Couldn't parse"
Sure, why not. :) Queued the patch, it should go into 10.0.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scripts: dump stdin on meson-buildoptions error
2025-02-28 10:26 ` Paolo Bonzini
@ 2025-02-28 18:17 ` Patrick Venture
0 siblings, 0 replies; 3+ messages in thread
From: Patrick Venture @ 2025-02-28 18:17 UTC (permalink / raw)
To: Paolo Bonzini
Cc: marcandre.lureau, berrange, philmd, qemu-devel, Nabih Estefan
[-- Attachment #1: Type: text/plain, Size: 426 bytes --]
On Fri, Feb 28, 2025 at 2:26 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
> > Dump sys.stdin when it errors on meson-buildoptions.py, letting us debug
> > the build errors instead of just saying "Couldn't parse"
>
> Sure, why not. :) Queued the patch, it should go into 10.0.
>
Thanks! we kept seeing this because we didn't have rustc installed and it
would just fail to parse the json. :)
>
> Paolo
>
>
[-- Attachment #2: Type: text/html, Size: 942 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-28 18:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-27 18:04 [PATCH] scripts: dump stdin on meson-buildoptions error Patrick Venture
2025-02-28 10:26 ` Paolo Bonzini
2025-02-28 18:17 ` Patrick Venture
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).