run: python3 Platforms/emscripten configure-build-python -- --config-cache --with-pydebug
- name: "Make build Python"
run: python3 Platforms/emscripten make-build-python
+ - name: "Display build info of the build Python"
+ run: python3 Platforms/emscripten pythoninfo-build
- name: "Make dependencies"
run: >-
python3 Platforms/emscripten make-dependencies
${{ steps.emsdk-cache.outputs.cache-hit == 'true' && '--check-up-to-date' || '' }}
- - name: "Configure host Python"
+ - name: "Configure host/Emscripten Python"
run: python3 Platforms/emscripten configure-host --host-runner node -- --config-cache
- - name: "Make host Python"
+ - name: "Make host/Emscripten Python"
run: python3 Platforms/emscripten make-host
- - name: "Display build info"
- run: python3 Platforms/emscripten run --pythoninfo
+ - name: "Display build info of the host/Emscripten Python"
+ run: python3 Platforms/emscripten pythoninfo-host
- name: "Test"
run: python3 Platforms/emscripten run --test
print(f"🎉 {binary} {version}")
+@subdir("native_build_dir")
+def pythoninfo_build_python(context, working_dir):
+ """Display build info of the build Python."""
+ call(["make", "pythoninfo"], quiet=context.quiet)
+
+
def check_shasum(file: str, expected_shasum: str):
with open(file, "rb") as f:
digest = hashlib.file_digest(f, "sha256")
subprocess.check_call([exec_script, "--version"])
-def run_emscripten_python(context):
+def run_emscripten_python(context, args=None):
"""Run the built emscripten Python."""
host_dir = context.build_paths["host_dir"]
exec_script = host_dir / "python.sh"
print("Emscripten not built", file=sys.stderr)
sys.exit(1)
- args = context.args
- # Strip the "--" separator if present
- if args and args[0] == "--":
- args = args[1:]
+ if args is None:
+ args = context.args
+ # Strip the "--" separator if present
+ if args and args[0] == "--":
+ args = args[1:]
- if context.test:
- args = load_config_toml()["test-args"] + args
- elif context.pythoninfo:
- args = load_config_toml()["pythoninfo-args"] + args
+ if context.test:
+ args = load_config_toml()["test-args"] + args
+ elif context.pythoninfo:
+ args = load_config_toml()["pythoninfo-args"] + args
os.execv(str(exec_script), [str(exec_script), *args])
+def pythoninfo_emscripten_python(context):
+ """Display build info of the host/Emscripten Python."""
+ run_emscripten_python(context, ["-m", "test.pythoninfo"])
+
+
def build_target(context):
"""Build one or more targets."""
steps = []
steps.extend([
configure_build_python,
make_build_python,
+ pythoninfo_build_python,
])
if context.target in {"host", "all"}:
steps.extend([
make_mpdec,
configure_emscripten_python,
make_emscripten_python,
+ pythoninfo_emscripten_python,
])
for step in steps:
"make-build-python", help="Run `make` for the build Python"
)
+ pythoninfo_build = subcommands.add_parser(
+ "pythoninfo-build", help="Display build info of the build Python"
+ )
+
configure_host = subcommands.add_parser(
"configure-host",
help=(
"make-host", help="Run `make` for the host/emscripten"
)
+ pythoninfo_host = subcommands.add_parser(
+ "pythoninfo-host", help="Display build info of the host/Emscripten Python"
+ )
+
run = subcommands.add_parser(
"run",
help="Run the built emscripten Python",
make_mpdec_cmd,
make_dependencies_cmd,
make_build,
+ pythoninfo_build,
configure_host,
make_host,
+ pythoninfo_host,
clean,
):
subcommand.add_argument(
"make-dependencies": make_dependencies,
"configure-build-python": configure_build_python,
"make-build-python": make_build_python,
+ "pythoninfo-build": pythoninfo_build_python,
"configure-host": configure_emscripten_python,
"make-host": make_emscripten_python,
+ "pythoninfo-host": pythoninfo_emscripten_python,
"build": build_target,
"run": run_emscripten_python,
"clean": clean_contents,