On August 18, 2026, Modular announced that the Mojo 1.0 compiler and toolchain were released as open source under Apache 2.0 with LLVM exceptions. That does not make a full source build the default installation path. If you only need standard-library work, examples, or MAX targets, start with prebuilt-mojo; choose build-mojo only for compiler source research, debugging, or changes to the compiler itself. Because Modular has not published a reliable Apple Silicon Mac memory floor for a full compiler build, use measured peak pressure and repeatable build success to decide whether to continue locally or move to a high-memory remote Mac. The release details are documented in the official Mojo open-source announcement.
Last updated: August 26, 2026. Facts and commands were checked against the official modular repository, its build instructions, the Mojo system requirements, and the current Bazel command reference available on that date.
This guide is for compiler developers stepping through or modifying Mojo on an Apple Silicon Mac, engineers whose Bazel build is terminated or stalls under swap pressure, and team leads comparing a local Mac, a remote Mac, and the prebuilt workflow.
The first decision: compiler work or normal Mojo development
The expensive mistake is treating an open compiler repository as if every Mojo developer must build it. The repository is public, but the current contribution policy still does not accept compiler and tooling contributions. Modular has stated a plan to open that work by the end of 2026, but that is a plan, not an already available contribution path. The repository and contribution status should therefore be checked before a team invests in a large local build.
Use this decision rule:
- If the task changes compiler parsing, lowering, code generation, diagnostics, or compiler debugging, select
build-mojo. - If the task changes the standard library, runs examples, or develops ordinary Mojo code, select
prebuilt-mojounless the experiment specifically depends on compiler internals. - If the task builds MAX targets, select
prebuilt-mojo. The current documentation states that MAX targets still require the prebuilt compiler. - If the goal is only to inspect the open source tree, clone and inspect first. A successful clone does not justify a full compiler build.
- If the compiler change cannot be submitted under the current contribution policy, record the local experiment and avoid making a full build part of every developer’s daily loop.
This distinction answers the most common build-mojo versus prebuilt-mojo question before any memory tuning begins. A compiler researcher needs the local build. A standard-library developer usually needs a usable compiler, not a newly compiled compiler.
What the official memory requirement does and does not tell you
The Mojo documentation publishes a general minimum requirement for Mojo development. That requirement is not a guarantee that a full compiler source build will fit within the same memory budget. A compiler build may create a much larger dependency graph and may schedule several resource-heavy actions through Bazel. The difference matters on Apple Silicon Mac systems because CPU and GPU memory share unified memory rather than using separate pools.
Do not convert the general requirement into a statement such as “this Mac is guaranteed to build the compiler.” No official source listed for this article gives a dependable lower bound for the complete build-mojo path on Apple Silicon Mac hardware.
Before the first build, record:
- Apple Silicon model and macOS version.
- Xcode or Command Line Tools version.
- Repository revision or commit hash.
- Whether
./bazelwstarts and resolves the repository’s expected Bazel wrapper. - Available unified memory before the build.
- Free disk space.
- Background processes with unusually high memory use.
- macOS memory pressure and swap state.
Apple explains how to inspect memory pressure, compressed memory, and swap-related information in Activity Monitor’s memory view. The purpose is not to find a single magic capacity. It is to separate an unsuitable toolchain from a resource ceiling.
A missing command-line component usually produces a tool-not-found or configuration error. A memory ceiling is more likely to appear as rising memory pressure, heavy swap, an operating-system termination, or a Bazel action that disappears without completing. Disk exhaustion creates a different evidence trail again. Keep those categories separate.
First build: establish a small, reproducible baseline
The first run should answer one question: can the current checkout complete the smallest official compiler validation target? It should not attempt every test, every package, or a full clean rebuild before the environment has been verified.
Step 1: freeze the build identity
Save the repository commit hash, the output of the relevant version commands, the macOS and Xcode or Command Line Tools versions, and the exact Bazel configuration. A later successful run is not useful as a comparison if the source revision or toolchain has changed.
The open repository’s build section is the authority for the current wrapper and target syntax. Do not copy an older command from a forum post if the repository’s README or build documentation has changed.
Step 2: verify the wrapper before spending memory
Run the repository’s documented wrapper check first. The relevant entry point is ./bazelw, not an independently installed Bazel binary selected by shell order. A wrapper mismatch can produce misleading analysis and dependency errors before the compiler build has meaningfully started.
Confirm that the wrapper can read the checkout, resolve its external dependencies, and recognize the requested configuration. Stop at this stage if the failure is a repository or toolchain error.
Step 3: run the smallest build-mojo target
Use the official KGEN target and the repository’s current command form:
./bazelw run --config=build-mojo KGEN:mojo
The exact target spelling should be confirmed against the current repository build instructions before execution. The important diagnostic is the build-mojo configuration combined with the smallest documented KGEN validation path, not an unverified command copied from another checkout.
Do not begin with the full test suite. Capture:
- Start and end time.
- Final exit code.
- The Bazel action or phase that failed.
- Peak memory pressure.
- Swap activity.
- Relevant termination messages.
- The complete Bazel log.
The elapsed time is a baseline for this checkout and machine. It is not a universal performance claim.
Step 4: prove that the local compiler is actually being used
After a successful build, run a minimal Mojo source file through the documented local output path. Keep the file intentionally small. The validation goal is to confirm that the executable or tool selected by the test comes from the local build-mojo result rather than an older prebuilt binary already present in the environment.
Check the resolved executable path and preserve the command output. If a compiler diagnostic or version marker is available, record it with the build log. A passing sample alone does not prove that the newly built compiler was selected.
Step 5: repeat only after the first result is classified
A second run should distinguish a cold build from an incremental build. Do not call an incremental success proof that the initial resource ceiling has disappeared. Conversely, do not call one cold-build failure proof that the configuration is impossible if the failure was caused by a missing toolchain component.
The baseline is useful only when the repository revision, configuration, and environment are recorded alongside it.
Use evidence before changing Bazel resources
When macOS terminates a Mojo Bazel build, first classify the failure rather than increasing swap or changing several flags at once.
| Evidence | Likely class of problem | First response |
|---|---|---|
| Memory pressure rises while swap grows and a Bazel or compiler process is terminated | System memory pressure | Close competing workloads, rerun the smallest target, and reduce local parallel work |
| Bazel remains active but schedules too many heavy actions | Bazel scheduling pressure | Lower local concurrency or adjust the resources exposed to Bazel |
| Errors mention missing tools, SDK components, or Metal support | Toolchain or environment failure | Repair the required toolchain before changing memory settings |
| Writes fail, temporary files cannot be created, or the volume is nearly full | Disk pressure | Free space and repeat the baseline |
| One action fails repeatedly while overall memory remains stable | Isolated action or source failure | Preserve the action log and investigate that target separately |
Bazel’s current command-line reference should determine the exact resource flags for the checkout and wrapper version. Avoid presenting a flag copied from a different Bazel release as a universal fix.
The practical order is conservative:
- Stop unrelated builds, virtual machines, containers, and memory-heavy applications.
- Repeat the smallest target with the same repository revision.
- Reduce local Bazel parallelism using the current command reference.
- Adjust resource declarations only when the effect is understood and recorded.
- Compare memory pressure and the failed action with the original baseline.
- Stop forcing the build through swap if repeated cold runs remain unstable.
Swap can keep a process alive while making the machine unusably slow. It does not turn insufficient physical memory into predictable compiler capacity. If the system repeatedly reaches sustained pressure, a high-memory remote Mac is a more controllable option than repeating the same failure.
Local build, prebuilt compiler, or remote Mac
The right choice depends on what must be local. Compiler stepping and source-level debugging favor a local or remote build-mojo environment. Daily library work favors the prebuilt path. A remote Mac becomes attractive when the build is infrequent but materially disruptive to local work.
| Workflow | Appropriate use | Main cost or limitation | Decision |
|---|---|---|---|
build-mojo on a local Apple Silicon Mac |
Compiler debugging, compiler source changes, local stepping | Unpublished memory floor, local contention, potentially unstable cold builds | Choose only when compiler internals are the task |
prebuilt-mojo on a local Mac |
Standard-library work, examples, ordinary Mojo development | Does not validate a local compiler modification | Default for daily development |
build-mojo on a remote Mac |
Reproducible compiler builds without consuming the developer’s workstation | Remote access, environment control, and artifact transfer must be managed | Choose when local pressure is persistent |
| Mixed workflow | Prebuilt local development plus remote compiler builds | Requires strict path and artifact labeling | Best team compromise when compiler work is occasional |
The official open-source announcement documents the two Bazel configurations, while the repository build notes define how they are invoked. Keep the configurations isolated in logs and shell scripts. A test that silently finds a prebuilt compiler can invalidate the conclusion of a local compiler experiment.
For teams evaluating hardware, the relevant comparison is not simply “more memory is faster.” It is whether the system can complete a cold build without terminating, while leaving enough capacity for the debugger, editor, logs, and other required services. Since no official compiler-build floor is published, a vendor’s generic specification cannot replace a measured acceptance test.
Teams comparing purchase and rental economics can first review JexMac’s available Mac options and then compare the expected build-node duration with JexMac pricing information. The decision should be based on repeatable build evidence, not on a capacity number copied from a general Mojo requirement.
Metal and MAX require a separate evidence chain
A failed compiler build and a missing Metal toolchain can look similar from a distance because both may stop a workflow before a useful output appears. They require different investigations.
Check the required Apple development components and the repository’s documented toolchain checks first. Apple’s Metal developer documentation is the correct reference for Metal-related components and supported development interfaces. If the error names a missing SDK, tool, or Metal component, changing Bazel memory settings will not repair it.
MAX adds a stricter boundary. The current project guidance states that the locally built compiler cannot be used to build MAX targets; changes to MAX kernels or models still require prebuilt-mojo. Therefore, a successful build-mojo compiler result does not prove that a MAX target can be built through the same path.
Use two small validation runs:
./bazelw run --config=build-mojo KGEN:mojo
./bazelw run --config=prebuilt-mojo KGEN:mojo
Confirm both commands against the current repository documentation. Label their outputs separately. Clear or isolate caches when the experiment requires it, and inspect the resolved compiler path. Otherwise, a cached object or a shell PATH entry can make the two workflows appear interchangeable.
The diagnostic questions are distinct:
- Did the compiler source build complete?
- Did the local sample use the compiler just built?
- Did the prebuilt path work independently?
- Is the MAX failure a documented compiler-boundary issue?
- Is the Metal failure caused by a missing component rather than memory?
Answering these in order prevents a toolchain fault from being misreported as a Mac memory fault.
FAQ: decisions that affect the next build
How much memory does a Mac need to build the Mojo compiler from source?
There is no official memory floor for a full Mojo compiler source build on Apple Silicon Mac hardware. The published requirement covers general Mojo development, not every compiler build graph. Record available unified memory, swap activity, Bazel logs, and the failing action during a cold build. Treat repeated system termination as evidence to reduce concurrency or move the build to a higher-memory remote Mac.
When should I use build-mojo instead of prebuilt-mojo?
Use build-mojo only when you need to read, debug, or modify the compiler itself. Use prebuilt-mojo for normal standard-library development, examples, and daily Mojo work. The prebuilt path is also required when building MAX targets because the current local compiler build cannot compile those targets. This separation prevents unnecessary full rebuilds and avoids confusing compiler work with application work.
What should I check when a Mojo Bazel build is terminated by macOS?
First confirm that macOS reports memory pressure and that the Bazel process or a compiler action was terminated. Then inspect swap usage, available disk space, background workloads, and the Bazel log. Reduce local parallelism or adjust the resources exposed to Bazel using the current command reference. If cold builds remain unstable, stop adding swap and use prebuilt-mojo or a remote Mac.
Does changing the Mojo standard library require rebuilding the compiler?
Usually not. Standard-library changes and example development should use the prebuilt compiler unless the change depends on compiler internals or a compiler behavior under investigation. Rebuild with build-mojo when the compiler source itself is part of the experiment. Keep the two paths separate and verify the compiler path used by the test, because an existing prebuilt binary can otherwise make a local compiler change appear ineffective.
Is a remote Mac worthwhile when local Mojo compilation is too slow?
A remote Mac is worth evaluating when local builds repeatedly create sustained memory pressure, trigger termination, or block other development work. It is less suitable when the workflow needs physical devices, local debugger hardware, or consistently light builds. Use a remote machine as a controlled build node, preserve the repository revision and logs, and keep prebuilt-mojo as the fast local path for everyday development.
Build acceptance as a team process
After the first successful experiment, convert the result into a repeatable acceptance record. Store the repository commit hash, macOS version, Xcode or Command Line Tools version, Bazel configuration, target, resource observations, exit code, and relevant logs. This makes a future toolchain update comparable with the current baseline.
A team acceptance run should include:
- A clean or cold
build-mojovalidation where compiler source work is required. - A minimal Mojo sample executed with the intended compiler path.
- The relevant repository tests for the changed area.
- An independent
prebuilt-mojocheck when standard-library or MAX work is involved. - A repeat run that does not end in unexplained system termination.
- A clear record of whether Metal components were required and verified.
The acceptance standard is not “the command eventually returned.” It is “the team can identify which compiler produced the artifact, reproduce the result from a recorded checkout, and distinguish memory pressure from toolchain or source failures.”
Use this final branch before assigning more work to the local Mac:
- Choose local
build-mojoif compiler debugging is essential, the smallest cold build completes reliably, and memory pressure does not terminate the workstation’s other required tasks. - Choose local
prebuilt-mojoif the work is standard-library development, examples, or MAX-related and no compiler internals are being changed. - Choose a remote Mac if compiler work is required but local cold builds repeatedly trigger pressure, swap storms, or termination.
- Pause and repair the environment if the logs show missing tools, SDK problems, Metal components, disk errors, or wrapper mismatches rather than memory exhaustion.
- Do not rent or buy for this workload if the build is occasional, lightweight, and has no need for compiler source changes or sustained local capacity.
For teams that switch machines frequently, a high-memory remote Mac can serve as a consistent compiler build node while developers keep prebuilt-mojo locally. That arrangement avoids making every workstation absorb the cost of a workload that only a small part of the team performs.
A local Mac remains the better option for physical debugging access, low-latency interactive stepping, and stable long-term heavy use when the measured workload fits reliably. A generic cloud host may introduce platform, access, or toolchain differences. A self-managed workstation avoids remote-session overhead but requires the organization to own idle capacity, upgrades, and maintenance.
If the current setup is a local Mac that repeatedly hits memory pressure, a generic cloud VM, or an improvised environment with mixed compiler paths, its real drawbacks are clear: unstable cold builds, unclear failure evidence, and wasted time repeating resource-related experiments. Renting a JexMac Mac can be the cleaner option for temporary compiler research or a controlled remote build node, provided the chosen environment passes the same repository, toolchain, and acceptance checks described here. For a team that needs only short-lived high-memory capacity, that is a more defensible decision than purchasing a permanent machine before the workload has been measured.
FAQ
How much memory does a Mac need to build the Mojo compiler from source?
There is no official memory floor for a full Mojo compiler source build on Apple Silicon Mac hardware. The published requirement covers general Mojo development, not every compiler build graph. Record available unified memory, swap activity, Bazel logs, and the failing action during a cold build. Treat repeated system termination as evidence to reduce concurrency or move the build to a higher-memory remote Mac.
When should I use build-mojo instead of prebuilt-mojo?
Use build-mojo only when you need to read, debug, or modify the compiler itself. Use prebuilt-mojo for normal standard-library development, examples, and daily Mojo work. The prebuilt path is also required when building MAX targets because the current local compiler build cannot compile those targets. This separation prevents unnecessary full rebuilds and avoids confusing compiler work with application work.
What should I check when a Mojo Bazel build is terminated by macOS?
First confirm that macOS reports memory pressure and that the Bazel process or a compiler action was terminated. Then inspect swap usage, available disk space, background workloads, and the Bazel log. Reduce local parallelism or adjust the resources exposed to Bazel using the current command reference. If cold builds remain unstable, stop adding swap and use prebuilt-mojo or a remote Mac.
Does changing the Mojo standard library require rebuilding the compiler?
Usually not. Standard-library changes and example development should use the prebuilt compiler unless the change depends on compiler internals or a compiler behavior under investigation. Rebuild with build-mojo when the compiler source itself is part of the experiment. Keep the two paths separate and verify the compiler path used by the test, because an existing prebuilt binary can otherwise make a local compiler change appear ineffective.
Is a remote Mac worthwhile when local Mojo compilation is too slow?
A remote Mac is worth evaluating when local builds repeatedly create sustained memory pressure, trigger termination, or block other development work. It is less suitable when the workflow needs physical devices, local debugger hardware, or consistently light builds. Use a remote machine as a controlled build node, preserve the repository revision and logs, and keep prebuilt-mojo as the fast local path for everyday development.
Move Your Mojo Build to a Dedicated Remote Mac
Run your Mojo compiler build on a dedicated physical Mac mini M4 when local memory pressure slows development.