diff --git a/database/__init__.py b/database/__init__.py index 1e76bcf..d7cf558 100644 --- a/database/__init__.py +++ b/database/__init__.py @@ -57,6 +57,11 @@ def main(): with _connect() as conn: create_schema(conn) elif args.command == "jixia": + if not os.environ.get("JIXIA_PATH"): + raise SystemExit( + "JIXIA_PATH is not set. It must point at the jixia binary, e.g. " + "jixia/.lake/build/bin/jixia" + ) # jixia runs each module with cwd=project_root, so the module file # path must be absolute — a relative root would be resolved twice. project = LeanProject(os.path.abspath(args.project_root)) diff --git a/database/__main__.py b/database/__main__.py index 5102d9d..ae88da7 100644 --- a/database/__main__.py +++ b/database/__main__.py @@ -12,6 +12,10 @@ filemode=os.environ.get("LOG_FILEMODE", "a"), level=os.environ.get("LOG_LEVEL", "INFO"), ) -jixia.run.executable = os.environ["JIXIA_PATH"] +# Only the `jixia` subcommand shells out to the analyzer binary. Requiring this +# at import time breaks `schema`, `informal`, and `vector-db`, which never touch +# it; that subcommand validates the variable itself. +if os.environ.get("JIXIA_PATH"): + jixia.run.executable = os.environ["JIXIA_PATH"] main()