Grafana Windows Development

Hello Everyone I got a Question Regarding Grafana Development on Windows Especialy on How get a Windows Executable from The Build Proccess. I already set up my Enviroment with WSL. And I went through the Documentation

And Everything seems to Work Fine The Build Proccess runs without errors And i Get the Linux Executables out. the only thing that is left is the Problem that i Have no Idea on How to Get a Windows Executable from this Could you please Help me.

Hi @besimsuljic,
If you’re looking to build a Grafana windows binary, then I would suggest you take a look at this README file on the Grafana repository.
Since you have WSL already set up on your machine, try run make build-go. This builds the Grafana binary on your windows machine. The Grafana binaries will be in bin\windows-amd64.

Hope that helps!

Hi Uche thank you for your Quick Response. Should I Run the make build-go Command in my WSL Enviroment or from Windows

V V sre., 5. maj 2021 ob 16:20 je oseba Uche via Grafana Labs Community Forums <grafana@discoursemail.com> napisala:

Here is the Response from the Build Process it Automaticly Targets the Linux Enviroment.
build go files
GO111MODULE=on go run build.go build
Version: 7.5.0-pre, Linux Version: 7.5.0, Package Iteration: 1620224881pre
rm -r ./bin/linux-amd64/grafana-server
rm -r ./bin/linux-amd64/grafana-server.md5
go version
go version go1.16.2 linux/amd64
Targeting linux/amd64
go build -ldflags -w -X main.version=7.5.0-pre -X main.commit=6a97236b7a -X main.buildstamp=1616789583 -X main.buildBranch=master -o ./bin/linux-amd64/grafana-server ./pkg/cmd/grafana-server
rm -r ./bin/linux-amd64/grafana-cli
rm -r ./bin/linux-amd64/grafana-cli.md5
go version
go version go1.16.2 linux/amd64
Targeting linux/amd64
go build -ldflags -w -X main.version=7.5.0-pre -X main.commit=6a97236b7a -X main.buildstamp=1616789583 -X main.buildBranch=master -o ./bin/linux-amd64/grafana-cli ./pkg/cmd/grafana-cli

V V sre., 5. maj 2021 ob 16:30 je oseba Besim Suljic <besim.suljic@gmail.com> napisala:

@besimsuljic
I think you should try running this on your windows command-line environment instead: go run build.go build. But I think this might require you to install GCC on your windows machine as outlined in the README file I mentioned earlier.

Hope that helps!

I will try it thank you a lot for the help and the quick response.

Best Regards

@besimsuljic If my suggestion above doesn’t work, then you should run this command on your WSL environment: env GOOS=windows GOARCH=amd64 go build build.go.
Hope that helps!

Hy Uche Thanks a lot for your Support it Works as Expected I had a little strugle with the GCC Compiler but in the End It is Done Thanks a lot.

Best Regards