https://www.boundaryml.com logo
baml version/generator issues
# general
m
First time seeing this error: Failed to generate BAML client: on_generate command finished with exit code 127: gofmt -w . && goimports -w . Stdout: Stderr: sh: 1: gofmt: not found BAML does generate, no errors indicated (BAML indicator in bottom toolbar is not red) baml_client was Python, not Go Fresh install into a Python codebase, generators.baml was set to 'go' Error on changing output_type from output_type "go" to output_type "python/pydantic" CLI output: (.venv) 8:46 maceo ~/Dev/****** (top secret repo name) main ± + (.venv) baml-cli init 2026-01-02T08:47:41.688 [BAML INFO] Found valid cached BAML library path="/home/maceo/.cache/baml/libs/0.213.0/libbaml_cffi-x86_64-unknown-linux-gnu.so" 2026-01-02T08:47:41.691 [BAML INFO] BAML (v0.213.0) loaded Also FYI, generators.baml was installed with version "0.213.0" but current === version "0.215.2" Interesting. When I specify python/pydantic the versions are borked. I'll give you and image:
b
Oh boy, that's wrong, thanks for flagging! Looking into it now
Can you check
which baml-cli
and
echo $PATH
both from inside the venv and outside of it?
I can't reproduce your behavior; what I suspect has happened is that your golang baml install is installed globally
Also, if I'm looking at your screenshot correctly, you're using zsh on x64 linux?
m
yep WSL2 Ubuntu
Interesting... now I just have to remember which of my 5 open IDEs I was working in 🤔
b
Haha, fair! Can you check if you have a global install of
baml-cli
?
m
main ± + (.venv) which baml /home/maceo/Dev/silmari-Context-Engine/.venv/bin/baml
b
what if you
deactivate
and then do
which baml
m
did that first actually.
main ± + which baml baml not found
b
what about
baml-cli
?
m
ha! you're right!
main ± + (.venv) which baml-cli /home/maceo/Dev/silmari-Context-Engine/.venv/bin/baml-cli (.venv) 17:32 maceo ~/Dev/silmari-Context-Engine main ± + (.venv) deactivate 17:32 maceo ~/Dev/silmari-Context-Engine main ± + which baml-cli /home/maceo/go/bin/baml-cli
user error strikes again!
(should have known)
(Maceo slinks off as if nothing happened, casually whistling)
b
Well, here's the bizarre thing:
This can actually happen even when you're inside the venv
Apparently zsh and bash both, by design, do some kind of PATH resolution caching. I'm having trouble understanding the behavior of the caching because it seems to WAI normally, but I did manage to reproduce the bizarreness you saw:
Aha! I have it!
If you're inside the venv, and you run
baml-cli init
before
baml-py
is installed, the shell will cache the path to the global
baml-cli
install
After you install
baml-py
, the shell will continue to use the cached global
baml-cli
Shell path resolution caching does use
PATH
in the cache key, but the cache key doesn't respect filesystem state
m
Sam! Thanks for this. Amazing!
7 Views