diff --git a/stdlib/benchmarks/lit.cfg.py b/stdlib/benchmarks/lit.cfg.py index 1b8149198b..3810ff84a4 100644 --- a/stdlib/benchmarks/lit.cfg.py +++ b/stdlib/benchmarks/lit.cfg.py @@ -42,10 +42,12 @@ # test_source_root: The root path where tests are located. config.test_source_root = Path(__file__).parent.resolve() - repo_root = Path(__file__).parent.parent.parent + repo_root = Path(__file__).parent.parent.parent.resolve() + # This is important since `benchmark` is closed source # still right now and is always used by the benchmarks. - pre_built_packages_path = ( + pre_built_packages_path = os.environ.get( + "MODULAR_MOJO_NIGHTLY_IMPORT_PATH", repo_root / ".magic" / "envs" / "default" / "lib" / "mojo", ) @@ -61,12 +63,12 @@ # with the Mojo SDK to the appropriate environment variables. # These environment variables are interpreted by the mojo parser # when resolving imports. - os.environ[ - "MODULAR_MOJO_NIGHTLY_IMPORT_PATH" - ] = f"{build_root},{pre_built_packages_path}" - os.environ[ - "MODULAR_MOJO_MAX_NIGHTLY_IMPORT_PATH" - ] = f"{build_root},{pre_built_packages_path}" + os.environ["MODULAR_MOJO_NIGHTLY_IMPORT_PATH"] = ( + f"{build_root},{pre_built_packages_path}" + ) + os.environ["MODULAR_MOJO_MAX_NIGHTLY_IMPORT_PATH"] = ( + f"{build_root},{pre_built_packages_path}" + ) # Pass through several environment variables # to the underlying subprocesses that run the tests.