()
| 12 | |
| 13 | |
| 14 | def main(): |
| 15 | default_host_runner = ( |
| 16 | "{WASMTIME} run " |
| 17 | # Set argv0 so that getpath.py can auto-discover the sysconfig data directory. |
| 18 | "--argv0 {ARGV0} " |
| 19 | # Map the checkout to / to load the stdlib from /Lib. |
| 20 | "--dir {CHECKOUT}::/ " |
| 21 | # Flags involving --optimize, --codegen, --debug, --wasm, and --wasi can be kept |
| 22 | # in a config file. |
| 23 | # We are using such a file to act as defaults in case a user wants to override |
| 24 | # only some of the settings themselves, make it easy to modify settings |
| 25 | # post-build so that they immediately apply to the Makefile instead of having to |
| 26 | # regenerate it, and allow for easy copying of the settings for anyone else who |
| 27 | # may want to use them. |
| 28 | "--config {WASMTIME_CONFIG_PATH}" |
| 29 | ) |
| 30 | |
| 31 | parser = argparse.ArgumentParser() |
| 32 | subcommands = parser.add_subparsers(dest="subcommand") |
| 33 | build = subcommands.add_parser("build", help="Build everything") |
| 34 | configure_build = subcommands.add_parser( |
| 35 | "configure-build-python", help="Run `configure` for the build Python" |
| 36 | ) |
| 37 | make_build = subcommands.add_parser( |
| 38 | "make-build-python", help="Run `make` for the build Python" |
| 39 | ) |
| 40 | build_python = subcommands.add_parser( |
| 41 | "build-python", help="Build the build Python" |
| 42 | ) |
| 43 | configure_host = subcommands.add_parser( |
| 44 | "configure-host", |
| 45 | help="Run `configure` for the " |
| 46 | "host/WASI (pydebug builds " |
| 47 | "are inferred from the build " |
| 48 | "Python)", |
| 49 | ) |
| 50 | make_host = subcommands.add_parser( |
| 51 | "make-host", help="Run `make` for the host/WASI" |
| 52 | ) |
| 53 | build_host = subcommands.add_parser( |
| 54 | "build-host", help="Build the host/WASI Python" |
| 55 | ) |
| 56 | subcommands.add_parser( |
| 57 | "clean", help="Delete files and directories created by this script" |
| 58 | ) |
| 59 | for subcommand in ( |
| 60 | build, |
| 61 | configure_build, |
| 62 | make_build, |
| 63 | build_python, |
| 64 | configure_host, |
| 65 | make_host, |
| 66 | build_host, |
| 67 | ): |
| 68 | subcommand.add_argument( |
| 69 | "--quiet", |
| 70 | action="store_true", |
| 71 | default=False, |
no test coverage detected
searching dependent graphs…