Skip to content
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

build break with go 1.10 #160

Closed
jeffallen opened this issue May 28, 2019 · 0 comments · Fixed by #161
Closed

build break with go 1.10 #160

jeffallen opened this issue May 28, 2019 · 0 comments · Fixed by #161

Comments

@jeffallen
Copy link
Contributor

jeffallen commented May 28, 2019

As of 1727806 (committed by @xiang90), building with Go 1.10.8 gives:

# go.etcd.io/bbolt
./bolt_riscv64.go:5:20: maxMapSize redeclared in this block
	previous declaration at ./bolt_amd64.go:4:20
./bolt_riscv64.go:8:22: maxAllocSize redeclared in this block
	previous declaration at ./bolt_amd64.go:7:22
./bolt_riscv64.go:11:5: brokenUnaligned redeclared in this block
	previous declaration at ./bolt_amd64.go:10:5
FAIL	go.etcd.io/bbolt [build failed]

The fix is that all bolt_$ARCH.go files need a build tag at the front of them, so that Go compilers that do not know about newer architectures will not build the files:

diff --git a/bolt_riscv64.go b/bolt_riscv64.go
index 2d962d3..07b4b47 100644
--- a/bolt_riscv64.go
+++ b/bolt_riscv64.go
@@ -1,3 +1,5 @@
+// +build riscv64
+
 package bbolt
 
 // maxMapSize represents the largest mmap size supported by Bolt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant