From cdfcdd2557bf4a724953aa6833ec2f4b0e914e6e Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Mon, 11 May 2026 09:17:28 +0800 Subject: [PATCH 1/2] mzbuild: Fix parsing --arch parameters --- misc/completions/bash/_mzcompose | 1 - misc/completions/zsh/_mzcompose | 2 +- misc/python/materialize/mzbuild.py | 14 ++++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/misc/completions/bash/_mzcompose b/misc/completions/bash/_mzcompose index 682fa4e153573..443f283095254 100644 --- a/misc/completions/bash/_mzcompose +++ b/misc/completions/bash/_mzcompose @@ -43,7 +43,6 @@ _shtab_mzcompose_completion_option_strings=('-h' '--help') _shtab_mzcompose_pos_0_choices=('build' 'config' 'cp' 'create' 'describe' 'ls' 'list' 'description' 'down' 'events' 'exec' 'gen-shortcuts' 'help' 'images' 'kill' 'list-compositions' 'list-workflows' 'logs' 'pause' 'port' 'ps' 'pull' 'push' 'restart' 'rm' 'run' 'scale' 'start' 'stop' 'sql' 'top' 'unpause' 'up' 'web' 'completion') _shtab_mzcompose___sanitizer_choices=('address' 'hwaddress' 'cfi' 'thread' 'leak' 'undefined' 'none') -_shtab_mzcompose___arch_choices=('X86_64' 'AARCH64') _shtab_mzcompose_completion_pos_0_choices=('bash' 'zsh' 'tcsh') _shtab_mzcompose_pos_0_nargs=A... diff --git a/misc/completions/zsh/_mzcompose b/misc/completions/zsh/_mzcompose index 91141d255eab8..ad664b2faa4f4 100644 --- a/misc/completions/zsh/_mzcompose +++ b/misc/completions/zsh/_mzcompose @@ -58,7 +58,7 @@ _shtab_mzcompose_options=( "--optimized[build Rust binaries with the optimized profile (optimizations, no LTO, no debug symbols)]" "--coverage[whether to enable code coverage compilation flags]" "--sanitizer[whether to enable a sanitizer]:sanitizer:(address hwaddress cfi thread leak undefined none)" - "--arch[the CPU architecture to build for]:arch:(X86_64 AARCH64)" + "--arch[the CPU architecture to build for]:arch:" "--image-registry[the Docker image registry to pull images from and push images to]:image_registry:" "--image-prefix[a prefix to apply to all Docker image names]:image_prefix:" ) diff --git a/misc/python/materialize/mzbuild.py b/misc/python/materialize/mzbuild.py index f653b84abc4a9..028c654f3ea86 100644 --- a/misc/python/materialize/mzbuild.py +++ b/misc/python/materialize/mzbuild.py @@ -1500,12 +1500,22 @@ def install_arguments(parser: argparse.ArgumentParser) -> None: type=Sanitizer, choices=Sanitizer, ) + + def _parse_arch(s: str) -> Arch: + try: + return Arch(s) + except ValueError: + valid = ", ".join(m.value for m in Arch) + raise argparse.ArgumentTypeError( + f"invalid arch: {s!r} (choose from {valid})" + ) + parser.add_argument( "--arch", default=Arch.host(), help="the CPU architecture to build for", - type=Arch, - choices=Arch, + type=_parse_arch, + metavar="{" + ",".join(m.value for m in Arch) + "}", ) parser.add_argument( "--image-registry", From 1662a1bc91155c129e083b313018b6e81deb92e5 Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Tue, 12 May 2026 09:48:20 +0800 Subject: [PATCH 2/2] Bump bootstrap version for macOS xcompile --- misc/python/materialize/xcompile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/python/materialize/xcompile.py b/misc/python/materialize/xcompile.py index b8d337ce6b6e1..728ad34d3e66a 100644 --- a/misc/python/materialize/xcompile.py +++ b/misc/python/materialize/xcompile.py @@ -217,7 +217,7 @@ def _bootstrap_darwin(arch: Arch) -> None: # Building in Docker for Mac is painfully slow, so we install a # cross-compiling toolchain on the host and use that instead. - BOOTSTRAP_VERSION = "6" + BOOTSTRAP_VERSION = "7" BOOTSTRAP_FILE = MZ_ROOT / "target-xcompile" / target(arch) / ".xcompile-bootstrap" try: contents = BOOTSTRAP_FILE.read_text()