https://www.boundaryml.com logo
🟑 Go package setup issue with baml-cli
# questions
g
I'm trying to setup using golang, and I'm running into this issue
Copy code
go install github.com/boundaryml/baml/go/baml-cli@latest && baml-cli init

go: github.com/boundaryml/baml/go/baml-cli@latest: module github.com/boundaryml/baml/go@latest found (v0.2.0), but does not contain package github.com/boundaryml/baml/go/baml-cli
v
Oh! That’s odd. It should be using v0.205.0
Can you try pinning to that?
g
Same thing
Copy code
go: github.com/boundaryml/baml/go/baml-cli@v0.205.0: module github.com/boundaryml/baml@v0.205.0 found, but does not contain package github.com/boundaryml/baml/go/baml-cli
v
checking!
ah! docs are wrong! Updating now πŸ™‚
Copy code
go install github.com/boundaryml/baml/baml-cli@latest && baml-cli --version
g
v
thanks!
g
Hey! Need your help on one more small bit, I'm struggling with Dockerfile setup. here are my logs and Dockerfile: https://gist.github.com/ag-aion/7c48c9bfc0de1a0c88019b222b0887c7
v
ah! you do need to set:
Copy code
CGO_ENABLED=1
g
I now get this --
Copy code
> [build-env 9/9] RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o /.../bin/api ./cmd/api:                                                                      
1.257 # runtime/cgo
1.257 gcc: error: unrecognized command-line option '-m64'
------
ERROR: failed to solve: process "/bin/sh -c CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o $APP_HOME/bin/api ./cmd/api" did not complete successfully: exit code: 1
v
hmm, could we hop on office hours rq to see if i can help debug this?
alternatively if your project is open source, i can try and run everything locally as well
g
Fixed! It was happening because there was a cross-compile of CGO-enabled golang code from arm64 to amd64 architecture. I had to put
FROM --platform=linux/amd64 golang:1.xx
in the Dockerfile
v
oh awesome!
thanks for investigating this Ayush. if you can share your final go file, would love to post it as well
or just even add to our docs
g
We should also add this step to the docs
Copy code
RUN go install golang.org/x/tools/cmd/goimports@latest