@@ -171,6 +171,12 @@ def make_build_python(context, working_dir):
171171 print (f"🎉 { binary } { version } " )
172172
173173
174+ @subdir (BUILD_DIR )
175+ def pythoninfo_build_python (context , working_dir ):
176+ """Display build info of the build Python."""
177+ call (["make" , "pythoninfo" ], context = context )
178+
179+
174180def find_wasi_sdk ():
175181 """Find the path to wasi-sdk."""
176182 if wasi_sdk_path := os .environ .get ("WASI_SDK_PATH" ):
@@ -316,13 +322,21 @@ def build_all(context):
316322 steps = [
317323 configure_build_python ,
318324 make_build_python ,
325+ pythoninfo_build_python ,
319326 configure_wasi_python ,
320327 make_wasi_python ,
328+ pythoninfo_wasi_python ,
321329 ]
322330 for step in steps :
323331 step (context )
324332
325333
334+ @subdir (lambda context : CROSS_BUILD_DIR / context .host_triple )
335+ def pythoninfo_wasi_python (context , working_dir ):
336+ """Display build info of the host/WASI Python."""
337+ call (["make" , "pythoninfo" ], context = context )
338+
339+
326340def clean_contents (context ):
327341 """Delete all files created by this script."""
328342 if CROSS_BUILD_DIR .exists ():
@@ -364,6 +378,9 @@ def main():
364378 make_build = subcommands .add_parser (
365379 "make-build-python" , help = "Run `make` for the build Python"
366380 )
381+ pythoninfo_build = subcommands .add_parser (
382+ "pythoninfo-build" , help = "Display build info of the build Python"
383+ )
367384 configure_host = subcommands .add_parser (
368385 "configure-host" ,
369386 help = "Run `configure` for the "
@@ -374,15 +391,20 @@ def main():
374391 make_host = subcommands .add_parser (
375392 "make-host" , help = "Run `make` for the host/WASI"
376393 )
394+ pythoninfo_host = subcommands .add_parser (
395+ "pythoninfo-host" , help = "Display build info of the host/WASI Python"
396+ )
377397 subcommands .add_parser (
378398 "clean" , help = "Delete files and directories created by this script"
379399 )
380400 for subcommand in (
381401 build ,
382402 configure_build ,
383403 make_build ,
404+ pythoninfo_build ,
384405 configure_host ,
385406 make_host ,
407+ pythoninfo_host ,
386408 ):
387409 subcommand .add_argument (
388410 "--quiet" ,
@@ -421,7 +443,12 @@ def main():
421443 "(default designed for wasmtime 14 or newer: "
422444 f"`{ default_host_runner } `)" ,
423445 )
424- for subcommand in build , configure_host , make_host :
446+ for subcommand in (
447+ build ,
448+ configure_host ,
449+ make_host ,
450+ pythoninfo_host ,
451+ ):
425452 subcommand .add_argument (
426453 "--host-triple" ,
427454 action = "store" ,
@@ -434,10 +461,13 @@ def main():
434461 dispatch = {
435462 "configure-build-python" : configure_build_python ,
436463 "make-build-python" : make_build_python ,
464+ "pythoninfo-build" : pythoninfo_build_python ,
437465 "configure-host" : configure_wasi_python ,
438466 "make-host" : make_wasi_python ,
467+ "pythoninfo-host" : pythoninfo_wasi_python ,
439468 "build" : build_all ,
440469 "clean" : clean_contents ,
470+ None : lambda args : parser .print_help (),
441471 }
442472 dispatch [context .subcommand ](context )
443473
0 commit comments