Building gitea with golang1.18 binary fails #8819

Closed
opened 2025-11-02 08:19:49 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @gesangtome on GitHub (Apr 12, 2022).

I tried to build gitea with the latest binary package of golang, and exported the environment variable $GOROOT, it looked fine at first, but when running go generate, I got this error:

Running go generate...
make[1]: *** No rule to make target 'modules/public/bindata.go', needed by 'gitea'. Stop.
make[1]: Leaving directory '/home/gesangtome/rpm-packages/gitea/BUILD/gitea-1.16.5'

what happened?

Originally created by @gesangtome on GitHub (Apr 12, 2022). I tried to build gitea with the latest binary package of golang, and exported the environment variable $GOROOT, it looked fine at first, but when running go generate, I got this error: Running go generate... make[1]: *** No rule to make target 'modules/public/bindata.go', needed by 'gitea'. Stop. make[1]: Leaving directory '/home/gesangtome/rpm-packages/gitea/BUILD/gitea-1.16.5' what happened?
GiteaMirror added the issue/needs-feedback label 2025-11-02 08:19:49 -06:00
Author
Owner

@techknowlogick commented on GitHub (Apr 12, 2022):

FWIW, gitea's 1.16.x branch is being built with golang 1.18 but it looks like that is somehow related to make instead of go itself.

To confirm an assumption made, is the binary you are using for go have the name go or is it go1.18 or something similar?

@techknowlogick commented on GitHub (Apr 12, 2022): FWIW, gitea's 1.16.x branch is being built with golang 1.18 but it looks like that is somehow related to make instead of go itself. To confirm an assumption made, is the binary you are using for go have the name `go` or is it `go1.18` or something similar?
Author
Owner

@42wim commented on GitHub (Apr 12, 2022):

Can you also paste the output of go env ?

@42wim commented on GitHub (Apr 12, 2022): Can you also paste the output of `go env` ?
Author
Owner

@gesangtome commented on GitHub (Apr 13, 2022):

@techknowlogick
Assuming this error caused by the GOLANG binary package, we need to break it, but I only have one PC and need more test results.

Can it be verified together? Thanks.

https://golang.google.cn/dl/go1.18.1.linux-amd64.tar.gz

@gesangtome commented on GitHub (Apr 13, 2022): @techknowlogick Assuming this error caused by the GOLANG binary package, we need to break it, but I only have one PC and need more test results. Can it be verified together? Thanks. https://golang.google.cn/dl/go1.18.1.linux-amd64.tar.gz
Author
Owner

@gesangtome commented on GitHub (Apr 13, 2022):

@42wim

GOROOT=/home/${username}/golang; export GOROOT
PATH=$GOROOT/bin:$PATH; export PATH

go version
go version go1.18.1 linux/amd64

go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/${username}/.cache/go-build"
GOENV="/home/${username}/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/${username}/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/${username}/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/home/${username}/golang"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/${username}/golang/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/${username}/gitea-1.16.5/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2105614396=/tmp/go-build -gno-record-gcc-switches"

@gesangtome commented on GitHub (Apr 13, 2022): @42wim GOROOT=/home/${username}/golang; export GOROOT PATH=$GOROOT/bin:$PATH; export PATH go version go version go1.18.1 linux/amd64 go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/${username}/.cache/go-build" GOENV="/home/${username}/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/${username}/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/${username}/go" GOPRIVATE="" GOPROXY="https://goproxy.cn,direct" GOROOT="/home/${username}/golang" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/${username}/golang/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.18.1" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/${username}/gitea-1.16.5/go.mod" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2105614396=/tmp/go-build -gno-record-gcc-switches"
Author
Owner

@techknowlogick commented on GitHub (Apr 13, 2022):

To confirm, this works when you use golang 1.17?

@techknowlogick commented on GitHub (Apr 13, 2022): To confirm, this works when you use golang 1.17?
Author
Owner

@gesangtome commented on GitHub (Apr 14, 2022):

@techknowlogick

I verified again with the command TAGS="bindata sqlite sqlite_unlock_notify" make build and the error disappeared, why?

@gesangtome commented on GitHub (Apr 14, 2022): @[techknowlogick](https://github.com/techknowlogick) I verified again with the command TAGS="bindata sqlite sqlite_unlock_notify" make build and the error disappeared, why?
Author
Owner

@techknowlogick commented on GitHub (Apr 14, 2022):

The 1.16.5 tag hasn't changed, so it must be something locally had changed. I suspect it could be related to go generate not making the bindata files initially and so then make couldn't file them.
I'm going to close this as it is now working, but if you have issues later on please open a thread in our forum: https://discourse.gitea.io/

@techknowlogick commented on GitHub (Apr 14, 2022): The 1.16.5 tag hasn't changed, so it must be something locally had changed. I suspect it could be related to go generate not making the bindata files initially and so then make couldn't file them. I'm going to close this as it is now working, but if you have issues later on please open a thread in our forum: https://discourse.gitea.io/
Author
Owner

@gesangtome commented on GitHub (Apr 17, 2022):

@techknowlogick thank

@gesangtome commented on GitHub (Apr 17, 2022): @techknowlogick thank
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8819