@@ -211,6 +211,12 @@ def make_build_python(context, working_dir):
211211 log ("🎉" , f"{ binary } { version } " )
212212
213213
214+ @subdir (BUILD_DIR )
215+ def pythoninfo_build_python (context , working_dir ):
216+ """Display build info of the build Python."""
217+ call (["make" , "pythoninfo" ], context = context )
218+
219+
214220def find_wasi_sdk ():
215221 """Find the path to the WASI SDK."""
216222 wasi_sdk_path = None
@@ -390,6 +396,12 @@ def make_wasi_python(context, working_dir):
390396 )
391397
392398
399+ @subdir (lambda context : CROSS_BUILD_DIR / context .host_triple )
400+ def pythoninfo_wasi_python (context , working_dir ):
401+ """Display build info of the host/WASI Python."""
402+ call (["make" , "pythoninfo" ], context = context )
403+
404+
393405def clean_contents (context ):
394406 """Delete all files created by this script."""
395407 if CROSS_BUILD_DIR .exists ():
@@ -443,6 +455,9 @@ def main():
443455 build_python = subcommands .add_parser (
444456 "build-python" , help = "Build the build Python"
445457 )
458+ pythoninfo_build = subcommands .add_parser (
459+ "pythoninfo-build" , help = "Display build info of the build Python"
460+ )
446461 configure_host = subcommands .add_parser (
447462 "configure-host" ,
448463 help = "Run `configure` for the "
@@ -456,6 +471,9 @@ def main():
456471 build_host = subcommands .add_parser (
457472 "build-host" , help = "Build the host/WASI Python"
458473 )
474+ pythoninfo_host = subcommands .add_parser (
475+ "pythoninfo-host" , help = "Display build info of the host/WASI Python"
476+ )
459477 subcommands .add_parser (
460478 "clean" , help = "Delete files and directories created by this script"
461479 )
@@ -464,8 +482,10 @@ def main():
464482 configure_build ,
465483 make_build ,
466484 build_python ,
485+ pythoninfo_build ,
467486 configure_host ,
468487 make_host ,
488+ pythoninfo_host ,
469489 build_host ,
470490 ):
471491 subcommand .add_argument (
@@ -520,7 +540,13 @@ def main():
520540 help = "Command template for running the WASI host; defaults to "
521541 f"`{ default_host_runner } `" ,
522542 )
523- for subcommand in build , configure_host , make_host , build_host :
543+ for subcommand in (
544+ build ,
545+ configure_host ,
546+ make_host ,
547+ build_host ,
548+ pythoninfo_host ,
549+ ):
524550 subcommand .add_argument (
525551 "--host-triple" ,
526552 action = "store" ,
@@ -532,18 +558,29 @@ def main():
532558 context = parser .parse_args ()
533559 context .init_dir = pathlib .Path ().absolute ()
534560
535- build_build_python = build_steps (configure_build_python , make_build_python )
536- build_wasi_python = build_steps (configure_wasi_python , make_wasi_python )
561+ build_build_python = build_steps (
562+ configure_build_python ,
563+ make_build_python ,
564+ pythoninfo_build_python ,
565+ )
566+ build_wasi_python = build_steps (
567+ configure_wasi_python ,
568+ make_wasi_python ,
569+ pythoninfo_wasi_python ,
570+ )
537571
538572 dispatch = {
539573 "configure-build-python" : configure_build_python ,
540574 "make-build-python" : make_build_python ,
541575 "build-python" : build_build_python ,
576+ "pythoninfo-build" : pythoninfo_build_python ,
542577 "configure-host" : configure_wasi_python ,
543578 "make-host" : make_wasi_python ,
544579 "build-host" : build_wasi_python ,
580+ "pythoninfo-host" : pythoninfo_wasi_python ,
545581 "build" : build_steps (build_build_python , build_wasi_python ),
546582 "clean" : clean_contents ,
583+ None : lambda args : parser .print_help (),
547584 }
548585 dispatch [context .subcommand ](context )
549586
0 commit comments