Grafana error build from source

Hello!

I am trying to build grafana from source in Windows 10 (64-bit) and unfortunately i am having the following error.

Any idea what is wrong with it?

Regards

You may want to check the grafana build instructions

Hello and thanks for your reply!

I have already checked grafana build instructions and unfortunately i have got the same problem as mentioned Grafana building from source error (undefined: server.Initialize) - #8 by zahrazare313 - Installation - Grafana Labs Community Forums
Wire tool is installed in $GOPATH/bin/wire.exe and this path is also added to my environment system path

Any idea that could help me?

Regards

That error trying to run make is likely part of the problem. Have you installed make? Sorry I don’t use windows so can’t really help much with that.

You may also want to ask on the grafana folks as it appears (to me) that this isn’t specifically a go issue, but an issue getting the grafana build going. Thx! Sorry I couldn’t be more helpful.

I have just installed make for windows

and still the same error regarding Windows 10 (Grafana building from source error (undefined: server.Initialize) - #7 by tomschirgi - Installation - Grafana Labs Community Forums)

make gen-go

i get the error: File *.sh not found.
process_begin: CreateProcess(NULL, # Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies., …)

Definitely i will send a feedback (Grafana team), but i am not sure according to the blog post!

Anyone who has compiled it via another operating system and afterwards build it especially for Win (32-bit version) via go environment variables? I think that it would help me a lot!

go_env

Regards

You might try building under cygwin: it seems various common utilities required are not present, such as tr and grep. If memory serves, Microsoft also has “find”, which may be the reason it is failing.

I built console level applications under cygwin that also ran on the cloud and mirrored the output (except for some floating point) without issues, but haven’t built graphically oriented packages, and that may take some mingw magic.

I installed Cygwin (C:\cygwin64) as mentioned and i got the following error

Additionally i got not the expected feedback from grafana support team as they provide ticket support only for commercial solutions.

Unfortunately i will say it again and sorry for that. Anyone who has compiled it via another operating system and afterwards build it especially for Win (32-bit version) via go environment variables?

I think that it would help me a lot!

Regards

I finally managed to run without problem make gen-go command via Cygwin and the following hint for Variables.mk

I have already procuded the following file (wire-ν0.5.0) via make gen-go

unfortunately i can not proceed to the following step due to this error

and of course still the same error

Any idea ?

Regards

I downgraded golang version from 1.20 to 1.14 and fortunately i do not see the above error any more, but something that has to do with go-sqlite version that i attach you

For your better convenience i send you the following link to my go.mod file.

Regards again

Hello!

I finally managed to get a solution for it via removing the following
exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible
from go.mod.

Unfortunately i get the following error when i try to compile it in Windows 10

For your own convenience, i attach you the script output from Cygwin

go run build.go build
Version: 10.1.0, Linux Version: 10.1.0, Package Iteration: 1693311946pre
building binaries build
building grafana ./pkg/cmd/grafana
rm -r ./bin/windows-amd64/grafana.exe
rm -r ./bin/windows-amd64/grafana.exe.md5
go build -ldflags -w -X main.version=10.1.0-pre -X main.commit=unknown-dev -X ma
in.buildstamp=1693311949 -X main.buildBranch=main -buildmode=exe -o ./bin/window
s-amd64/grafana.exe ./pkg/cmd/grafana
go: finding module for package k8s.io/client-go/util/keyutil
go: finding module for package k8s.io/client-go/listers/flowcontrol/v1beta3
go: finding module for package k8s.io/client-go/applyconfigurations/flowcontrol/
v1beta3
go: finding module for package k8s.io/apimachinery/pkg/util/clock
go: finding module for package k8s.io/client-go/dynamic/dynamicinformer
go: finding module for package k8s.io/client-go/tools/events
go: finding module for package k8s.io/client-go/kubernetes/typed/flowcontrol/v1b
eta3
go: finding module for package k8s.io/api/batch/v2alpha1
go: finding module for package k8s.io/client-go/listers/admissionregistration/v1
go: finding module for package k8s.io/api/settings/v1alpha1
go: finding module for package k8s.io/client-go/tools/cache/synctrack
go: finding module for package k8s.io/client-go/applyconfigurations/meta/v1
..\..\pkg\mod\golang.org\x\crypto@v0.11.0\curve25519\curve25519_go120.go:9:8: pa
ckage crypto/ecdh is not in GOROOT (c:\go\src\crypto\ecdh)
..\..\pkg\mod\github.com\grafana\grafana-plugin-sdk-go@v0.165.0\build\common.go:
5:2: package embed is not in GOROOT (c:\go\src\embed)
..\..\pkg\mod\github.com\grafana\grafana-azure-sdk-go@v1.7.0\aztokenprovider\ret
riever_clientsecret.go:8:2: build constraints exclude all Go files in C:\Users\K
Asimakopoulos\go\pkg\mod\github.com\!azure\azure-sdk-for-go\sdk\azcore@v1.2.0
..\..\pkg\mod\github.com\grafana\grafana-azure-sdk-go@v1.7.0\aztokenprovider\ret
riever_clientsecret.go:9:2: build constraints exclude all Go files in C:\Users\K
Asimakopoulos\go\pkg\mod\github.com\!azure\azure-sdk-for-go\sdk\azcore@v1.2.0\cl
oud
..\..\pkg\mod\github.com\grafana\grafana-azure-sdk-go@v1.7.0\aztokenprovider\ret
riever_clientsecret.go:10:2: build constraints exclude all Go files in C:\Users\
KAsimakopoulos\go\pkg\mod\github.com\!azure\azure-sdk-for-go\sdk\azcore@v1.2.0\p
olicy
..\..\pkg\mod\github.com\grafana\grafana-azure-sdk-go@v1.7.0\aztokenprovider\ret
riever_clientsecret.go:11:2: build constraints exclude all Go files in C:\Users\
KAsimakopoulos\go\pkg\mod\github.com\!azure\azure-sdk-for-go\sdk\azidentity@v1.2
.0
pkg\extensions\main.go:7:2: build constraints exclude all Go files in C:\Users\K
Asimakopoulos\go\pkg\mod\github.com\!azure\azure-sdk-for-go\sdk\keyvault\azkeys@
v0.9.0
..\..\pkg\mod\github.com\grafana\kindsys@v0.0.0-20230508162304-452481b63482\bind
_composable.go:3:8: found packages thema (assignable.go) and main (magefile.go)
in C:\Users\KAsimakopoulos\go\pkg\mod\github.com\grafana\thema@v0.0.0-2023071215
3715-375c1b45f3ed
..\..\pkg\mod\github.com\mattn\go-runewidth@v0.0.13\runewidth.go:6:2: found pack
ages uniseg (doc.go) and main (gen_breaktest.go) in C:\Users\KAsimakopoulos\go\p
kg\mod\github.com\rivo\uniseg@v0.3.4
..\..\pkg\mod\github.com\!microsoft\go-winio@v0.6.0\tools.go:5:8: import "golang
.org/x/tools/cmd/stringer" is a program, not an importable package
..\..\pkg\mod\go.opentelemetry.io\contrib\samplers\jaegerremote@v0.9.0\internal\
proto-gen\jaeger-idl\proto\api_v2\sampling.pb.go:11:2: ambiguous import: found p
ackage google.golang.org/genproto/googleapis/api/annotations in multiple modules
:
        google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e (C:\Users\
KAsimakopoulos\go\pkg\mod\google.golang.org\genproto@v0.0.0-20220421151946-72621
c1f0bd3\googleapis\api\annotations)
        google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cb
aebc (C:\Users\KAsimakopoulos\go\pkg\mod\google.golang.org\genproto\googleapis\a
pi@v0.0.0-20230530153820-e85fd2cbaebc\annotations)
..\..\pkg\mod\github.com\google\cel-go@v0.12.6\checker\decls\decls.go:21:2: ambi
guous import: found package google.golang.org/genproto/googleapis/api/expr/v1alp
ha1 in multiple modules:
        google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e (C:\Users\
KAsimakopoulos\go\pkg\mod\google.golang.org\genproto@v0.0.0-20220421151946-72621
c1f0bd3\googleapis\api\expr\v1alpha1)
        google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cb
aebc (C:\Users\KAsimakopoulos\go\pkg\mod\google.golang.org\genproto\googleapis\a
pi@v0.0.0-20230530153820-e85fd2cbaebc\expr\v1alpha1)
..\..\pkg\mod\github.com\grpc-ecosystem\grpc-gateway\v2@v2.16.0\runtime\handler.
go:11:2: ambiguous import: found package google.golang.org/genproto/googleapis/a
pi/httpbody in multiple modules:
        google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e (C:\Users\
KAsimakopoulos\go\pkg\mod\google.golang.org\genproto@v0.0.0-20220421151946-72621
c1f0bd3\googleapis\api\httpbody)
        google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cb
aebc (C:\Users\KAsimakopoulos\go\pkg\mod\google.golang.org\genproto\googleapis\a
pi@v0.0.0-20230530153820-e85fd2cbaebc\httpbody)
..\..\pkg\mod\github.com\googleapis\gax-go\v2@v2.7.1\apierror\internal\proto\err
or.pb.go:27:2: ambiguous import: found package google.golang.org/genproto/google
apis/rpc/code in multiple modules:
        google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e (C:\Users\
KAsimakopoulos\go\pkg\mod\google.golang.org\genproto@v0.0.0-20220421151946-72621
c1f0bd3\googleapis\rpc\code)
        google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cb
aebc (C:\Users\KAsimakopoulos\go\pkg\mod\google.golang.org\genproto\googleapis\r
pc@v0.0.0-20230530153820-e85fd2cbaebc\code)
..\..\pkg\mod\go.opentelemetry.io\otel\exporters\otlp\otlptrace\otlptracegrpc@v1
.14.0\client.go:23:2: ambiguous import: found package google.golang.org/genproto
/googleapis/rpc/errdetails in multiple modules:
        google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e (C:\Users\
KAsimakopoulos\go\pkg\mod\google.golang.org\genproto@v0.0.0-20220421151946-72621
c1f0bd3\googleapis\rpc\errdetails)
        google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cb
aebc (C:\Users\KAsimakopoulos\go\pkg\mod\google.golang.org\genproto\googleapis\r
pc@v0.0.0-20230530153820-e85fd2cbaebc\errdetails)
..\..\pkg\mod\google.golang.org\grpc@v1.45.0\status\status.go:35:2: ambiguous im
port: found package google.golang.org/genproto/googleapis/rpc/status in multiple
 modules:
        google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e (C:\Users\
KAsimakopoulos\go\pkg\mod\google.golang.org\genproto@v0.0.0-20220421151946-72621
c1f0bd3\googleapis\rpc\status)
        google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cb
aebc (C:\Users\KAsimakopoulos\go\pkg\mod\google.golang.org\genproto\googleapis\r
pc@v0.0.0-20230530153820-e85fd2cbaebc\status)
..\..\pkg\mod\golang.org\x\net@v0.10.0\http2\transport.go:19:2: package io/fs is
 not in GOROOT (c:\go\src\io\fs)
..\..\pkg\mod\k8s.io\client-go@v9.0.0+incompatible\kubernetes\scheme\register.go
:36:2: module k8s.io/api@latest found (v0.28.1), but does not contain package k8
s.io/api/batch/v2alpha1
..\..\pkg\mod\k8s.io\client-go@v9.0.0+incompatible\kubernetes\scheme\register.go
:49:2: module k8s.io/api@latest found (v0.28.1), but does not contain package k8
s.io/api/settings/v1alpha1
..\..\pkg\mod\k8s.io\client-go@v9.0.0+incompatible\util\flowcontrol\backoff.go:2
3:2: module k8s.io/apimachinery@latest found (v0.28.1), but does not contain pac
kage k8s.io/apimachinery/pkg/util/clock
..\..\pkg\mod\k8s.io\apiserver@v0.27.1\pkg\util\flowcontrol\apf_controller.go:54
:2: module k8s.io/client-go@latest found (v1.5.2), but does not contain package
k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3
..\..\pkg\mod\github.com\grafana\grafana-apiserver@v0.0.0-20230713001719-88a9ed4
1992d\pkg\client\applyconfiguration\kinds\v1\grafanaresourcedefinition.go:10:2:
module k8s.io/client-go@latest found (v1.5.2), but does not contain package k8s.
io/client-go/applyconfigurations/meta/v1
..\..\pkg\mod\k8s.io\apiserver@v0.27.1\pkg\admission\plugin\validatingadmissionp
olicy\controller_reconcile.go:42:2: module k8s.io/client-go@latest found (v1.5.2
), but does not contain package k8s.io/client-go/dynamic/dynamicinformer
..\..\pkg\mod\k8s.io\apiserver@v0.27.1\pkg\util\flowcontrol\apf_controller.go:55
:2: module k8s.io/client-go@latest found (v1.5.2), but does not contain package
k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3
..\..\pkg\mod\k8s.io\apiserver@v0.27.1\pkg\admission\configuration\mutating_webh
ook_manager.go:29:2: module k8s.io/client-go@latest found (v1.5.2), but does not
 contain package k8s.io/client-go/listers/admissionregistration/v1
..\..\pkg\mod\k8s.io\apiserver@v0.27.1\pkg\util\flowcontrol\apf_controller.go:56
:2: module k8s.io/client-go@latest found (v1.5.2), but does not contain package
k8s.io/client-go/listers/flowcontrol/v1beta3
..\..\pkg\mod\k8s.io\apiserver@v0.27.1\pkg\admission\plugin\validatingadmissionp
olicy\internal\generic\controller.go:34:2: module k8s.io/client-go@latest found
(v1.5.2), but does not contain package k8s.io/client-go/tools/cache/synctrack
..\..\pkg\mod\k8s.io\apiserver@v0.27.1\pkg\server\dynamiccertificates\tlsconfig.
go:31:2: module k8s.io/client-go@latest found (v1.5.2), but does not contain pac
kage k8s.io/client-go/tools/events
..\..\pkg\mod\k8s.io\apiserver@v0.27.1\pkg\server\options\serving.go:36:2: modul
e k8s.io/client-go@latest found (v1.5.2), but does not contain package k8s.io/cl
ient-go/util/keyutil
..\..\pkg\mod\github.com\grafana\thema@v0.0.0-20230712153715-375c1b45f3ed\load\l
oad.go:9:2: package testing/fstest is not in GOROOT (c:\go\src\testing\fstest)
exit status 1
exit status 1

Any idea that could help me?

Regards

Hello!
I have finally managed to build it for Windows 64-bit via the following command

and get the following result

Now i am trying to build it for Win 32-bit via GOARCH=386 and unfortunately i get the following error via Cygwin

searching for -lmingwex
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-
w64-mingw32/bin/ld.exe: cannot find -lmingwex
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-
w64-mingw32/bin/ld.exe: skipping incompatible C:/mingw-w64/mingw64/bin/../lib/gc
c/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingw32.a when
searching for -lmingw32
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-
w64-mingw32/bin/ld.exe: skipping incompatible C:/mingw-w64/mingw64/bin/../lib/gc
c/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmingw32.a when
searching for -lmingw32
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-
w64-mingw32/bin/ld.exe: skipping incompatible C:/mingw-w64/mingw64/bin/../lib/gc
c/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingw32.a when
searching for -lmingw32
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-
w64-mingw32/bin/ld.exe: cannot find -lmingw32
collect2.exe: error: ld returned 1 exit status

exit status 1
exit status 1

For your own convenience, i also attach the following

Any idea that could assist me?

Regards

Hello!
I finally managed to build it via Download | tdm-gcc
and using the following command

Thanks a lot!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.