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.
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
@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.
@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!