How to build Mojo with commits?

Can anyone guide me build the latest version of Mojo with some specific commits on Github?

Are you asking about the Mojo standard library? The Mojo compiler itself isn’t yet buildable externally, but the standard library is.

For building the standard library, we’re recommending people move to using Bazel as a build system. To build with Bazel, clone the modular repository locally and run

./bazelw build //mojo/stdlib/stdlib

Once that completes, you’ll have a new Mojo package for the standard library in your Bazel build products directory. To get the Mojo compiler to use this new library, set the following environment variable:

export MODULAR_MOJO_MAX_IMPORT_PATH=[...]/modular/bazel-bin/

(Replacing the first part of that path with the actual path to your modular checkout.)

That should let the Mojo compiler use whatever changes you’ve made to your local standard library.

1 Like