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

Go build fails to compile #407

Closed
yukshimizu opened this issue Dec 1, 2020 · 16 comments
Closed

Go build fails to compile #407

yukshimizu opened this issue Dec 1, 2020 · 16 comments

Comments

@yukshimizu
Copy link

Problem

I'm tying to build the code, which just import "github.com/apache/pulsar-client-go/pulsar", and output is below.

go: finding module for package github.com/apache/pulsar-client-go/pulsar
go: downloading github.com/apache/pulsar-client-go v0.3.0
go: found github.com/apache/pulsar-client-go/pulsar in github.com/apache/pulsar-client-go v0.3.0
go: downloading github.com/prometheus/client_golang v1.7.1
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/yahoo/athenz v1.8.55
go: downloading github.com/apache/pulsar-client-go/oauth2 v0.0.0-20200715083626-b9f8c5cedefb
go: downloading github.com/sirupsen/logrus v1.4.2
go: downloading github.com/gogo/protobuf v1.3.1
go: downloading github.com/klauspost/compress v1.10.8
go: downloading github.com/spaolacci/murmur3 v1.1.0
go: downloading github.com/pierrec/lz4 v2.0.5+incompatible
go: downloading github.com/linkedin/goavro/v2 v2.9.8
go: downloading github.com/datadog/zstd v1.4.6-0.20200617134701-89f69fb7df32
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: downloading golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1
go: downloading github.com/golang/snappy v0.0.1
go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: downloading github.com/99designs/keyring v1.1.5
go: downloading golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
go: downloading github.com/dvsekhvalnov/jose2go v0.0.0-20180829124132-7f401d37b68a
go: downloading github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d
go: downloading github.com/mtibben/percent v0.2.1
go: downloading golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/ardielle/ardielle-go v1.5.2
go: downloading github.com/golang/protobuf v1.4.2
go: downloading github.com/prometheus/client_model v0.2.0
go: downloading github.com/prometheus/common v0.10.0
go: downloading github.com/cespare/xxhash/v2 v2.1.1
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/procfs v0.1.3
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading google.golang.org/protobuf v1.23.0
# github.com/keybase/go-keychain
../../../../pkg/mod/github.com/keybase/[email protected]/macos_1.10.go:89:13: could not determine kind of name for C.SecTrustedApplicationCreateFromPath

It may be caused by referring github.com/keybase/[email protected]/macos_1.10.go because that is not latest one.

Environment

os: macOS Mojave 10.14.6
go: go1.15.3 darwin/amd64
pulsar-client-go: 0.3.0

@yukshimizu
Copy link
Author

I also tried with newer version of go key-chain [v0.0.0-20201121013009-976c83ec27a6], and it resolved the original issue. But I had another issue.

go: downloading golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59
# github.com/99designs/keyring
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:136:8: kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:181:9: kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:181:21: undefined: keychain.Access
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:187:9: kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:187:21: undefined: keychain.Access

It looks similar to 99designs/keyring#64.

@merlimat
Copy link
Contributor

merlimat commented Dec 1, 2020

@yukshimizu can you check with master branch? There is a change that might fix this: #404

@yukshimizu
Copy link
Author

Thanks @merlimat. I tried it, but the result was same.

# github.com/99designs/keyring
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:136:8: kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:181:9: kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:181:21: undefined: keychain.Access
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:187:9: kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
../../../../pkg/mod/github.com/99designs/[email protected]/keychain.go:187:21: undefined: keychain.Access

#404 looks it is for MacOS Catalina, but my environment is Mojave.

@bnkamalesh
Copy link

same on my laptop as well.

$ go version
go version go1.15.2 darwin/amd64

image

@wolfstudy
Copy link
Member

@yukshimizu Will updating the dependency of github.com/keybase/go-keychain to the latest one solve your problem?

@yukshimizu
Copy link
Author

Thanks @wolfstudy. I updated the following two dependencies of github.com/keybase/go-keychain to the latests and builded, but the result was same.

golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 [v0.0.0-20201203163018-be400aefbc4c]
github.com/stretchr/testify v1.5.1 [v1.6.1]

@Just4Ease
Copy link

Just4Ease commented Dec 8, 2020

I'm experiencing the exact same issue.

Phweeew 💀

Screen Shot 2020-12-08 at 2 13 15 AM

osX 11.0.1 ( BigSur )
go1.15.5 darwing/amd64

@wolfstudy
Copy link
Member

I'm not sure if this problem is related to the local environment. It can be successfully built locally. Can you help to try the following solutions?

keybase/go-keychain#47 (comment)

@Just4Ease
Copy link

Just4Ease commented Dec 8, 2020

I'm not sure if this problem is related to the local environment. It can be successfully built locally. Can you help to try the following solutions?

keybase/go-keychain#47 (comment)

let me give it a try now, had to catch some sleep

--- Didn't work still

@Alecyrus
Copy link

Alecyrus commented Dec 8, 2020

I have a workaround, add the following line in go.mod:

replace github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4

@yukshimizu
Copy link
Author

replace github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4

This results in same as original issue.

go: downloading github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4
# github.com/keybase/go-keychain
../../../../pkg/mod/github.com/99designs/[email protected]/macos.go:89:13: could not determine kind of name for C.SecTrustedApplicationCreateFromPath

@bnkamalesh
Copy link

github.com/apache/pulsar-client-go v0.3.0
github.com/apache/pulsar-client-go/oauth2 v0.0.0-20201202064457-9fe66edefe0d // indirect
github.com/keybase/go-keychain v0.0.0-20201121013009-976c83ec27a6 // indirect
$ go version
go version go1.15.2 darwin/amd64

It's working for me now. Maybe try the following? P.S: It'll upgrade all the dependencies

$ go get -u ./... && go mod verify && go mod tidy

@yukshimizu
Copy link
Author

Thanks @bnkamalesh, but it still didn't work well. It looks highly depending on MacOS version... Which MacOS version are you using now?

@bnkamalesh
Copy link

bnkamalesh commented Dec 9, 2020

image

OS: 11.0.1 (20B29)
MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports)

Edit: Try updating your Xcode as well.

@yukshimizu
Copy link
Author

I updated xcode to 11.3.1, which is the newest version for macos 10.14 and tried it. But, the result was the same. I may need to update macos to BigSur, but am hesitative about it :-<

@yukshimizu
Copy link
Author

I'm not sure the exact reason, but it works after rebooting mac!
Many thanks @bnkamalesh @Auxxxxlx @wolfstudy @merlimat !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants