Skip to content

Commit

Permalink
Add all env. vars. used to pass mojo lib. search paths to tutorial
Browse files Browse the repository at this point in the history
The env. var. shown in the tutorial section of the development document
for the Stdlib is (at least in some cases) insufficient to point `mojo`
to a newly build stdlib.mjpkg. This adds all the same variable that are
passed in the `lit` config to hopefully get all edge cases covered and
make getting stared easier.

Signed-off-by: Hristo I. Gueorguiev <53634432+izo0x90@users.noreply.github.com>
  • Loading branch information
izo0x90 committed Feb 14, 2025
1 parent 4c85c36 commit 718a357
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion stdlib/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,14 @@ def main():
print(all_paths.__str__())
```

We also need to set the following environment variable that tells Mojo to
We also need to set the following environment variables that tells Mojo to
prioritize imports from the standard library we just built, over the one that
ships with Mojo:

```bash
MODULAR_MOJO_IMPORT_PATH=../build \
MODULAR_MOJO_MAX_IMPORT_PATH=../build \
MODULAR_MOJO_MAX_NIGHTLY_IMPORT_PATH=../build \
MODULAR_MOJO_NIGHTLY_IMPORT_PATH=../build mojo main.mojo
```

Expand All @@ -288,6 +291,9 @@ you can get with `sudo apt install entr` on Linux, or `brew install entr` on
macOS. Now run:

```bash
export MODULAR_MOJO_IMPORT_PATH=../build
export MODULAR_MOJO_MAX_IMPORT_PATH=../build
export MODULAR_MOJO_MAX_NIGHTLY_IMPORT_PATH=../build
export MODULAR_MOJO_NIGHTLY_IMPORT_PATH=../build

ls **/*.mojo | entr sh -c "./scripts/build-stdlib.sh && mojo main.mojo"
Expand Down

0 comments on commit 718a357

Please sign in to comment.