Add BuildArgs to store common build arguments . ### Description

This renames `ReplayArgs` in pywasmcross to `BuildArgs` and uses it in buildall and buildpkg. No functional changes are involved except for some modifications in function parameters and how logs are copied after the build.

This PR makes it easier to call methods in buildall and buildpkg from the new CLI.

### Checklists

- [x] Add / update tests

import os
from contextlib import ExitStack, redirect_stdout
from io import StringIO
from pathlib import Path

from ..common import search_pyodide_root


def ensure_env_installed(env: Path, *, quiet: bool = False) -> None:
    if env.exists():
        return
    from .. import __version__
    from ..install_xbuildenv import download_xbuildenv, install_xbuildenv

    if "dev" in __version__:
        raise RuntimeError(
            "To use out of tree builds with development Pyodide, you must explicitly set PYODIDE_ROOT"
        )

    with ExitStack() as stack:
        if quiet:
            # Prevent writes to stdout
            stack.enter_context(redirect_stdout(StringIO()))

        download_xbuildenv(__version__, env)
        install_xbuildenv(__version__, env)


def initialize_pyodide_root(*, quiet: bool = False) -> None:
    if "PYODIDE_ROOT" in os.environ:
        return
    try:
        os.environ["PYODIDE_ROOT"] = str(search_pyodide_root(__file__))
        return
    except FileNotFoundError:
        pass
    env = Path(".pyodide-xbuildenv")
    os.environ["PYODIDE_ROOT"] = str(env / "xbuildenv/pyodide-root")
    ensure_env_installed(env, quiet=quiet)

import os
from contextlib import ExitStack, redirect_stdout
from io import StringIO
from pathlib import Path

from ..common import search_pyodide_root


def ensure_env_installed(env: Path, *, quiet: bool = False) -> None:
    if env.exists():
        return
    from .. import __version__
    from ..install_xbuildenv import download_xbuildenv, install_xbuildenv

    if "dev" in __version__:
        raise RuntimeError(
            "To use out of tree builds with development Pyodide, you must explicitly set PYODIDE_ROOT"
        )

    with ExitStack() as stack:
        if quiet:
            # Prevent writes to stdout
            stack.enter_context(redirect_stdout(StringIO()))

        download_xbuildenv(__version__, env)
        install_xbuildenv(__version__, env)


def initialize_pyodide_root(*, quiet: bool = False) -> None:
    if "PYODIDE_ROOT" in os.environ:
        return
    try:
        os.environ["PYODIDE_ROOT"] = str(search_pyodide_root(__file__))
        return
    except FileNotFoundError:
        pass
    env = Path(".pyodide-xbuildenv")
    os.environ["PYODIDE_ROOT"] = str(env / "xbuildenv/pyodide-root")
    ensure_env_installed(env, quiet=quiet)
