Skip to content

Build failure on i386 for v1.9 #7736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lovett opened this issue Aug 4, 2019 · 9 comments · Fixed by #7778
Closed

Build failure on i386 for v1.9 #7736

lovett opened this issue Aug 4, 2019 · 9 comments · Fixed by #7778

Comments

@lovett
Copy link

lovett commented Aug 4, 2019

I'm trying to build v1.9 from source on i386, but make fails and I'm not sure why.

My golang version is 1.11.5. I'm building from source rather than using the standard prebuilt binary for i386 because my hardware is very old, and the prebuilt binary fails with an illegal instruction error most likely related to not having SSE2. I was able to build gitea up to v1.8 successfully using golang 1.10. The error is new as of v1.9.

I'm invoking Make like this:
TAGS="bindata sqlite redis" make generate build

It's failing like this:

github.com/chaseadamsio/goorgeous
Makefile:315: recipe for target 'gitea' failed
make: *** [gitea] Error 1

I can't tell whether goorgeous is where the failure happens, or if it's whatever comes after it.

I realize old hardware compatibility isn't exactly something to shed tears over, but I'd be interested in any ideas if this seems fixable.

@lovett lovett changed the title Build failure on i386 Build failure on i386 for v1.9 Aug 4, 2019
@lunny
Copy link
Member

lunny commented Aug 4, 2019

Which OS?

@lovett
Copy link
Author

lovett commented Aug 4, 2019

Debian 9 stretch

@lunny
Copy link
Member

lunny commented Aug 5, 2019

but we have released https://dl.gitea.io/gitea/1.9.0/gitea-1.9.0-linux-386

@zeripath
Copy link
Contributor

zeripath commented Aug 5, 2019

I think that our i386 build may require sse2 x86 extensions. That your cpu does not have these implies it's very old... Are you sure it's powerful enough to run Gitea in general?

Ok, if you're certain you want to carry on. In order to help you figure out what is actually the problem we need the whole of the build log. One line is not going to cut it.

You definitely have standard Go not gcc-go right?

@lovett
Copy link
Author

lovett commented Aug 6, 2019

Yes, the hardware in question is very old. But I haven't had issues running Gitea with it prior to v1.9. My needs are modest.

As I mentioned earlier, it wouldn't be a surprise if not having sse2 was a dealbreaker here. I'm just mildly interested in whether there's an easy-ish fix that could side-step the issue, such as by disabling some module that otherwise isn't critical. But maybe that's not in the cards.

Here's the full output of the build command:
https://gist.github.com/lovett/c13953df47cb347d50311be0773eba46

Here's what go env reports:

$ go env
GOARCH="386"
GOBIN=""
GOCACHE="/home/lovett/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/tmp/gitea-test"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go-1.11"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.11/pkg/tool/linux_386"
GCCGO="gccgo"
GO386="387"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m32 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build606576234=/tmp/go-build -gno-record-gcc-switches"

@zeripath
Copy link
Contributor

zeripath commented Aug 6, 2019

I don't think it's goorgeous that's to blame for your problems with building:

go build golang_org/x/net/dns/dnsmessage: open /usr/lib/go-1.11/pkg/linux_386/vendor/golang_org/x/net/dns/dnsmessage.a: permission denied
go build golang_org/x/crypto/cryptobyte/asn1: open /usr/lib/go-1.11/pkg/linux_386/vendor/golang_org/x/crypto/cryptobyte/asn1.a: permission denied
go build golang_org/x/crypto/internal/chacha20: open /usr/lib/go-1.11/pkg/linux_386/vendor/golang_org/x/crypto/internal/chacha20.a: permission denied
go build golang_org/x/crypto/poly1305: open /usr/lib/go-1.11/pkg/linux_386/vendor/golang_org/x/crypto/poly1305.a: permission denied
go build golang_org/x/crypto/curve25519: open /usr/lib/go-1.11/pkg/linux_386/vendor/golang_org/x/crypto/curve25519.a: permission denied
gopkg.in/asn1-ber.v1
code.gitea.io/gitea/modules/process
go build golang_org/x/text/transform: open /usr/lib/go-1.11/pkg/linux_386/vendor/golang_org/x/text/transform.a: permission denied
go build golang_org/x/text/unicode/bidi: open /usr/lib/go-1.11/pkg/linux_386/vendor/golang_org/x/text/unicode/bidi.a: permission denied
go build golang_org/x/net/http2/hpack: open /usr/lib/go-1.11/pkg/linux_386/vendor/golang_org/x/net/http2/hpack.a: permission denied

I would look in to these errors first.

@Sr4l
Copy link
Contributor

Sr4l commented Aug 6, 2019

I also have problems building gitea 1.9 on Debian 10 Buster x64 with Go1.11 from repository. 1.8 on the other hand works fine.

web-git@server:~/go/src/code.gitea.io/gitea$ TAGS="bindata" make generate build
...SOME BUILD OUTPUT...
GO111MODULE=on go build -mod=vendor -i -v  -tags 'bindata' -ldflags '-s -w  -X "main.MakeVersion=GNU Make 4.2.1" -X "main.Version=1.9.0+10-gaea49d0b9" -X "main.Tags=bindata"' -o gitea
go build golang_org/x/net/dns/dnsmessage: open /usr/lib/go-1.11/pkg/linux_amd64/vendor/golang_org/x/net/dns/dnsmessage.a: permission denied
....SOME MORE PERMISSIONS DENIED...
go build golang_org/x/net/http2/hpack: open /usr/lib/go-1.11/pkg/linux_amd64/vendor/golang_org/x/net/http2/hpack.a: permission denied
go build golang_org/x/text/unicode/bidi: open /usr/lib/go-1.11/pkg/linux_amd64/vendor/golang_org/x/text/unicode/bidi.a: permission denied

I think it is related to this bug: golang/go#27285
Removing -i from GOFLAGS helps, as mentioned by the bug report.

diff --git a/Makefile b/Makefile
index 796a0e3b5..532655052 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ BINDATA := modules/{options,public,templates}/bindata.go
 GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*" ! -path "*/bindata.go")
 GOFMT ?= gofmt -s
 
-GOFLAGS := -i -v
+GOFLAGS := -v
 EXTRA_GOFLAGS ?=
 
 MAKE_VERSION := $(shell make -v | head -n 1)

@sapk
Copy link
Member

sapk commented Aug 7, 2019

@Sr4l can you open a PR with this change ? Following golang/go#27285 (comment) we should not use this flag anymore.

@lovett
Copy link
Author

lovett commented Aug 7, 2019

Dropping the -i flag resolved my issue as well. Thanks @Sr4l

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants