cosmos-sdk: Build fails in Go 1.10.3, 1.10.4 and 1.11

Summary of Bug

I believe this is from the Ledger dependency:

vendor/github.com/brejski/hid/hid_darwin.go:162: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithBytes
vendor/github.com/brejski/hid/hid_darwin.go:216: cannot use nil as type _Ctype_CFDictionaryRef in argument to func literal

Steps to Reproduce

Run make when using Go 1.10.4 or 1.11. Works with 1.10.1

I did not test 1.10.2 and 1.10.3


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 45 (26 by maintainers)

Most upvoted comments

On a brand-new install, after a successful make get_vendor_deps.

$ go version
go version go1.11 darwin/amd64

$ make install
go install -tags "netgo ledger" -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=416181be" ./cmd/gaia/cmd/gaiad
# github.com/cosmos/cosmos-sdk/vendor/github.com/brejski/hid
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//IOKit.framework/IOKit.tbd and library file /System/Library/Frameworks//IOKit.framework/IOKit are out of sync. Falling back to library file for linking.
# github.com/cosmos/cosmos-sdk/vendor/github.com/brejski/hid
vendor/github.com/brejski/hid/hid_darwin.go:162:41: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithBytes
vendor/github.com/brejski/hid/hid_darwin.go:216:149: cannot use nil as type _Ctype_CFDictionaryRef in argument to func literal

Maybe related?

edit: thanks to @xla I can get it built:

$ env CGO_ENABLED=0 make install
go install -tags "netgo ledger" -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=416181be" ./cmd/gaia/cmd/gaiad
go install -tags "netgo ledger" -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=416181be" ./cmd/gaia/cmd/gaiacli

go version go1.11.1 darwin/amd64

thank you! this line fixed my install error

dep ensure -update github.com/brejski/hid

go version go1.11.1 darwin/amd64

If you update https://github.com/ZondaX/ledger-goclient to master from v0.1

Are folks only having problems on MacOS or linux/windows as well?

Should we pull packages living under ZondaX into the Tendermint org? I think we will have to maintain them

This works for me.

go version
go version go1.11.1 darwin/amd64

git checkout master
dep ensure -update github.com/brejski/hid
make get_vendor_deps
make install

vendor/github.com/ZondaX/hid-go/hid_darwin.go:216: cannot use 0 (type int) as type *_Ctype_struct___CFDictionary in argument to func literal

that’s with the latest update to master as suggested by @zmanian. Notice its the same line but different error as Sunny.

using: go version go1.10.3 darwin/amd64

passes once upgraded to 1.11 for me

I failed too.

go version go1.10.3 linux/amd64

make install go install -tags “netgo ledger” -ldflags “-X github.com/cosmos/cosmos-sdk/version.GitCommit=416181be” ./cmd/gaia/cmd/gaiad

github.com/cosmos/cosmos-sdk/store

store/iavlstore.go:43:8: undefined: iavl.VersionedTree Makefile:61: recipe for target ‘install’ failed make: *** [install] Error 2

go test -v iavlstore_test.go

command-line-arguments

./iavlstore_test.go:32:41: undefined: iavl.VersionedTree ./iavlstore_test.go:32:61: undefined: CommitID ./iavlstore_test.go:33:10: undefined: iavl.NewVersionedTree ./iavlstore_test.go:44:15: undefined: CommitID ./iavlstore_test.go:50:15: undefined: newIAVLStore ./iavlstore_test.go:75:15: undefined: newIAVLStore ./iavlstore_test.go:148:15: undefined: newIAVLStore ./iavlstore_test.go:207:15: undefined: newIAVLStore ./iavlstore_test.go:263:24: undefined: iavlStore ./iavlstore_test.go:325:10: undefined: iavl.NewVersionedTree ./iavlstore_test.go:325:10: too many errors FAIL command-line-arguments [build failed]