Skip to content

Unable to compile on windows using Go 1.15 #12588

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
3 of 7 tasks
iamdoubz opened this issue Aug 24, 2020 · 9 comments · Fixed by #12589
Closed
3 of 7 tasks

Unable to compile on windows using Go 1.15 #12588

iamdoubz opened this issue Aug 24, 2020 · 9 comments · Fixed by #12589

Comments

@iamdoubz
Copy link

iamdoubz commented Aug 24, 2020

  • Gitea version (or commit ref): 1.12.3+16-g4a548a033 AND 1.13.0+dev-464-g63f3c42be
  • Git version: 2.28.0.windows.1
  • Operating system: Windows 10 2004 Pro x64
  • 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

When rebuilding Gitea v1.12 for Go v1.15.0, I get a make error.

...
bindata for options already up-to-date
bindata for public already up-to-date
bindata for templates already up-to-date
CGO_CFLAGS="-g -O2 -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -mod=vendor -v  -tags 'bindata sqlite sqlite_unlock_notify' -ldflags '-s -w  -X "main.MakeVersion=GNU Make 4.3" -X "main.Version=1.12.3+16-g4a548a033" -X "main.Tags=bindata sqlite sqlite_unlock_notify"' -o gitea.exe
...
code.gitea.io/gitea/routers/admin
code.gitea.io/gitea/routers/api/v1/repo
code.gitea.io/gitea/routers/api/v1/user
code.gitea.io/gitea/routers/api/v1/admin
code.gitea.io/gitea/routers/api/v1/org
code.gitea.io/gitea/routers/api/v1
code.gitea.io/gitea/routers/routes
code.gitea.io/gitea/cmd
code.gitea.io/gitea
# code.gitea.io/gitea
C:\Tools\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:/Tools/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 79462
collect2.exe: error: ld returned 1 exit status

make: *** [Makefile:521: gitea.exe] Error 2

When rebuilding Gitea v1.13 for Go v1.15.0, I get a make error as well:

...
generating bindata for options
writing bindata.go
generating bindata for public
writing bindata.go
generating bindata for templates
writing bindata.go
CGO_CFLAGS="-g -O2 -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -mod=vendor -v  -tags 'bindata sqlite sqlite_unlock_notify' -ldflags '-s -w  -X "main.MakeVersion=GNU Make 4.3" -X "main.Version=1.13.0+dev-464-g63f3c42be" -X "main.Tags=bindata sqlite sqlite_unlock_notify"' -o gitea.exe
...
code.gitea.io/gitea/routers
code.gitea.io/gitea/routers/admin
code.gitea.io/gitea/routers/api/v1/repo
code.gitea.io/gitea/routers/api/v1/user
code.gitea.io/gitea/routers/api/v1/admin
code.gitea.io/gitea/routers/api/v1/org
code.gitea.io/gitea/routers/api/v1
code.gitea.io/gitea/routers/routes
code.gitea.io/gitea/cmd
code.gitea.io/gitea
# code.gitea.io/gitea
C:\Tools\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:/Tools/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 96057
collect2.exe: error: ld returned 1 exit status

make: *** [Makefile:545: gitea.exe] Error 2

Screenshots

N/A

@6543
Copy link
Member

6543 commented Aug 24, 2020

@iamdoubz it is because of the sqlite3 support - if you dont need sqlite3 you can compile it with go 1.15 on windows

it's a windows related issue only

@iamdoubz
Copy link
Author

Is there a known workaround?

@6543
Copy link
Member

6543 commented Aug 24, 2020

:( no

@techknowlogick techknowlogick changed the title Go 1.15 issue Unable to compile on windows using Go 1.15 Aug 24, 2020
@techknowlogick
Copy link
Member

@iamdoubz thanks for reporting this :) Sadly we also have noticed this. I hope to report this upstream to golang itself. Could you assist me with some information that is needed for me to do so?

I require the output of the following two commands (my access to windows is limited and so I am unable to run these myself)

$ go version
$ go env

@iamdoubz
Copy link
Author

iamdoubz commented Aug 24, 2020

:( no

Sad day.

@iamdoubz thanks for reporting this :) Sadly we also have noticed this. I hope to report this upstream to golang itself. Could you assist me with some information that is needed for me to do so?

I require the output of the following two commands (my access to windows is limited and so I am unable to run these myself)

$ go version
$ go env

I would be more than happy to help.

You should be so lucky to not be so intertwined, rather hard coded, in the Windows environment :/

go version:

iamdoubz@computerMINGW64 ~/Gits/Gitea/12 (release/v1.12)
$ go version
go version go1.15 windows/amd64

go env:

iamdoubz@computer MINGW64 ~/Gits/Gitea/12 (release/v1.12)
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\iamdoubz\AppData\Local\go-build
set GOENV=C:\Users\iamdoubz\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\iamdoubz\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\iamdoubz\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Tools\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Tools\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\iamdoubz\Gits\Gitea\12\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\iamdoubz\AppData\Local\Temp\go-build163858050=/tmp/go-build -gno-record-gcc-switches

@techknowlogick
Copy link
Member

You should be so lucky to not be so intertwined, rather hard coded, in the Windows environment :/

I am thankful every day 😆

Thanks for this information :) Once I create the ticket I'll link it here.

@iamdoubz
Copy link
Author

Just let me know if you need anything else.

@techknowlogick
Copy link
Member

I've just submitted: golang/go#41013

@iamdoubz
Copy link
Author

Patch works for 1.13. Any chance you can backport this to 1.12 as well?

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

3 participants