gitea: Can not build anymore since version 1.9.0

  • Gitea version (or commit ref): 1.9.2
  • Git version:2.16.4
  • Operating system: openSUSE Leap 15.1, openSUSE Leap 15.0, openSUSE Tumbleweed
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

A build using opensuse build service and also local is not possible. First I want to build gitea in the opensuse build service. But this fails, because the build process would like to load different packages from github, even though the files actually exist in the vendor directory of the source. The buildservice does not allow external sources to be downloaded during the build process. Up to version 1.8.2 the build worked without problems. As of version 1.9.0, this is no longer possible. Even a build directly does not work. I first download the 1.9.2 release. Unzip the source and change to the directory. then I do the following: TAGS = “bindata” make generate all It then appears: github.com/klauspost/compress/gzip github.com/blevesearch/bleve/index/scorch make: *** [Makefile: 315: gitea] Error 1

Why are the files in the vendor directory no longer used? What do I have to do to reuse it so that I can recreate a package using opensuse buid service?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

@irreleph4nt
Until the fixes land in a gittea release && compatible GO version lands in epel-7 i use this spec file (please feel free to comment) https://github.com/markVnl/gitea-SPEC/tree/next

test_build @copr: https://copr.fedorainfracloud.org/coprs/markvnl/gitea/

have the same problem on centos and was able to dissect this Issue to make generate Can not give the “silver bullet solution” simply because i’m not really (understatement) an go(loang) expert.

somehow the go:generate go run -mod=vendor main.go does not honer the vendor directory in https://github.com/go-gitea/gitea/blob/master/modules/options/options.go#L7 https://github.com/go-gitea/gitea/blob/master/modules/public/public.go#L21 https://github.com/go-gitea/gitea/blob/master/modules/templates/templates.go#L7

And causes go to pull in the dependency’s, which in a buildchroot without network capability throws all those errors.

the workaround I use is to omit make generate and generate the bindata manually with a simple script in rhe (rpm) spec-file:

for i in options public templates; do 
   pushd modules/$i
   go run -mod=vendor main.go
   popd
done

Hi,

Sorry for the edit spam, but the above alone won’t make 1.9.3 build for CentOS. I had to amend this:

  1. You actually have to call the workaround like this to work: GO111MODULE=on go run -mod=vendor main.go
  2. You need to remove the -i switch in the Makefile on line GOFLAGS := -i -v
  3. Building with debug info does not work so you have to disable it via %global

For dd3ba9b#diff-b67911656ef5d18c4ae36cb6741b7965 to work, a newer version of Go seems to be required.

Thanks, and I can confirm it works like a charm on centOS with go1.13 installed from testing-epel-7

<mock-chroot> sh-4.2# go version
go version go1.13 linux/amd64

<mock-chroot> sh-4.2# ./gitea --version
Gitea version 1.10.0+dev-298-ga60d3cb built with GNU Make 3.82, go1.13 : bindata, pam

have the same problem on centos and was able to dissect this Issue to make generate
Can not give the “silver bullet solution” simply because i’m not really (understatement) an go(loang) expert.

somehow the go:generate go run -mod=vendor main.go does not honer the vendor directory in https://github.com/go-gitea/gitea/blob/master/modules/options/options.go#L7 https://github.com/go-gitea/gitea/blob/master/modules/public/public.go#L21 https://github.com/go-gitea/gitea/blob/master/modules/templates/templates.go#L7

And causes go to pull in the dependency’s, which in a buildchroot without network capability throws all those errors.

the workaround I use is to omit make generate and generate the bindata manually with a simple script in rhe (rpm) spec-file:

for i in options public templates; do 
   pushd modules/$i
   go run -mod=vendor main.go
   popd
done