| 214 | |
| 215 | |
| 216 | def _bootstrap_darwin(arch: Arch) -> None: |
| 217 | # Building in Docker for Mac is painfully slow, so we install a |
| 218 | # cross-compiling toolchain on the host and use that instead. |
| 219 | |
| 220 | BOOTSTRAP_VERSION = "7" |
| 221 | BOOTSTRAP_FILE = MZ_ROOT / "target-xcompile" / target(arch) / ".xcompile-bootstrap" |
| 222 | try: |
| 223 | contents = BOOTSTRAP_FILE.read_text() |
| 224 | except FileNotFoundError: |
| 225 | contents = "" |
| 226 | if contents == BOOTSTRAP_VERSION: |
| 227 | return |
| 228 | |
| 229 | spawn.runv( |
| 230 | [ |
| 231 | "brew", |
| 232 | "install", |
| 233 | "lld", |
| 234 | f"materializeinc/crosstools/{target(arch)}", |
| 235 | f"materializeinc/crosstools/libfdb-c-{target(arch)}", |
| 236 | ] |
| 237 | ) |
| 238 | spawn.runv(["rustup", "target", "add", target(arch)]) |
| 239 | |
| 240 | BOOTSTRAP_FILE.parent.mkdir(parents=True, exist_ok=True) |
| 241 | BOOTSTRAP_FILE.write_text(BOOTSTRAP_VERSION) |