Cannot build Gitea : invalid operation: 1 << j (shift count type int, must be unsigned integer) #5889

Closed
opened 2025-11-02 06:39:26 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @ThePirateWhoSmellsOfSunflowers on GitHub (Aug 24, 2020).

  • Gitea version (or commit ref): ee047312a1
  • Git version: git version 2.17.1
  • Operating system: Ubuntu 18.04
  • 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

Hi,

I cannot build Gitea from source. The following errors are raised during the compilation:

$ TAGS="sqlite sqlite_unlock_notify" make build
build flag -mod=vendor only valid when using modules
CC= GOOS= GOARCH= go generate -mod=vendor -tags 'sqlite sqlite_unlock_notify' 
CGO_CFLAGS="-g -O2 -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -mod=vendor -v  -tags 'sqlite sqlite_unlock_notify' -ldflags '-s -w  -X "main.MakeVersion=GNU Make 4.1" -X "main.Version=1.13.0+dev-462-gee047312a" -X "main.Tags=sqlite sqlite_unlock_notify"' -o gitea
github.com/minio/md5-simd
# github.com/minio/md5-simd
vendor/github.com/minio/md5-simd/block_amd64.go:157:14: invalid operation: 1 << j (shift count type int, must be unsigned integer)
vendor/github.com/minio/md5-simd/block_amd64.go:194:14: invalid operation: 1 << j (shift count type int, must be unsigned integer)
Makefile:545: recipe for target 'gitea' failed
make: *** [gitea] Error 2

My actual go version is go version go1.12.8 linux/amd64. According to this SO thread, go version 1.13 fixes the shift problem. Is it related to my issue ?

Thanks for the help.

🌻

Originally created by @ThePirateWhoSmellsOfSunflowers on GitHub (Aug 24, 2020). - Gitea version (or commit ref): ee047312a1a3238a8504200f7ded8536ebc838e3 - Git version: git version 2.17.1 - Operating system: Ubuntu 18.04 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description Hi, I cannot build Gitea from source. The following errors are raised during the compilation: ``` $ TAGS="sqlite sqlite_unlock_notify" make build build flag -mod=vendor only valid when using modules CC= GOOS= GOARCH= go generate -mod=vendor -tags 'sqlite sqlite_unlock_notify' CGO_CFLAGS="-g -O2 -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -mod=vendor -v -tags 'sqlite sqlite_unlock_notify' -ldflags '-s -w -X "main.MakeVersion=GNU Make 4.1" -X "main.Version=1.13.0+dev-462-gee047312a" -X "main.Tags=sqlite sqlite_unlock_notify"' -o gitea github.com/minio/md5-simd # github.com/minio/md5-simd vendor/github.com/minio/md5-simd/block_amd64.go:157:14: invalid operation: 1 << j (shift count type int, must be unsigned integer) vendor/github.com/minio/md5-simd/block_amd64.go:194:14: invalid operation: 1 << j (shift count type int, must be unsigned integer) Makefile:545: recipe for target 'gitea' failed make: *** [gitea] Error 2 ``` My actual go version is `go version go1.12.8 linux/amd64`. According to [this SO thread](https://stackoverflow.com/questions/57737743/error-in-shift-operator-using-numeric-literals-but-not-with-numeric-constant), go version 1.13 fixes the shift problem. Is it related to my issue ? Thanks for the help. :sunflower:
Author
Owner

@zeripath commented on GitHub (Aug 24, 2020):

So it appears we only assert that Gitea compiles on 1.12 without sqlite support. Presumably at some point the gosqlite dependency has started requiring 1.13. Unfortunately you're going to have to upgrade if you want to build with sqlite support.

I'd recommend you install go 1.15 though, go is under pretty constant development and go 1.15 should finally fix a preempt bug.

(This is especially important if you want to develop for Gitea - we require that go code is formatted by go fmt - the output of which can change slightly between versions of go. Not having the version of go that our CI checks your formatting with can lead to infuriating bugs.)

@zeripath commented on GitHub (Aug 24, 2020): So it appears we only assert that Gitea compiles on 1.12 without sqlite support. Presumably at some point the gosqlite dependency has started requiring 1.13. Unfortunately you're going to have to upgrade if you want to build with sqlite support. I'd recommend you install go 1.15 though, go is under pretty constant development and go 1.15 should finally fix a preempt bug. (This is especially important if you want to develop for Gitea - we require that go code is formatted by go fmt - the output of which can change slightly between versions of go. Not having the version of go that our CI checks your formatting with can lead to infuriating bugs.)
Author
Owner

@ThePirateWhoSmellsOfSunflowers commented on GitHub (Aug 24, 2020):

I've migrated to go 1.15 and now it works. Thanks

So it appears we only assert that Gitea compiles on 1.12 without sqlite support.

Maybe you can put an explicit warning on the "Installation from source" page within the doc.

🌻

@ThePirateWhoSmellsOfSunflowers commented on GitHub (Aug 24, 2020): I've migrated to go 1.15 and now it works. Thanks > So it appears we only assert that Gitea compiles on 1.12 without sqlite support. Maybe you can put an explicit warning on the "Installation from source" page within the doc. :sunflower:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5889