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 error on macOS 10.14 (kcItem.SetAccess undefined, undefined: keychain.Access) #94

Closed
endorama opened this issue Nov 3, 2021 · 8 comments · Fixed by #102
Closed

Comments

@endorama
Copy link

endorama commented Nov 3, 2021

I'm experiencing a build error in a macOS 10.14 test runner with go 1.17.1 for version 1.1.6

This is the relevant logs:

2021-11-02T17:48:27.5633810Z ##[group]Run go test -v
2021-11-02T17:48:27.5634440Z �[36;1mgo test -v�[0m
2021-11-02T17:48:27.5830430Z shell: /bin/bash -e {0}
2021-11-02T17:48:27.5830960Z env:
2021-11-02T17:48:27.5831340Z   GOLANG_VERSION: 1.17.1
2021-11-02T17:48:27.5831920Z   GOROOT: /Users/runner/hostedtoolcache/go/1.17.1/x64
2021-11-02T17:48:27.5832440Z ##[endgroup]
2021-11-02T17:48:29.7078820Z go: downloading github.com/99designs/keyring v1.1.6
2021-11-02T17:48:29.7182240Z go: downloading github.com/OpenPeeDeeP/xdg v1.0.0
2021-11-02T17:48:29.7285450Z go: downloading github.com/atotto/clipboard v0.1.0
2021-11-02T17:48:29.7398930Z go: downloading github.com/boltdb/bolt v1.3.1
2021-11-02T17:48:29.7600460Z go: downloading github.com/docopt/docopt.go v0.0.0-20180111231733-ee0de3bc6815
2021-11-02T17:48:29.7713480Z go: downloading github.com/hgfischer/go-otp v1.0.0
2021-11-02T17:48:29.7789550Z go: downloading github.com/mitchellh/cli v1.1.0
2021-11-02T17:48:29.7901810Z go: downloading github.com/pkg/errors v0.9.1
2021-11-02T17:48:29.7968160Z go: downloading github.com/spf13/viper v1.9.0
2021-11-02T17:48:29.8292050Z go: downloading github.com/dvsekhvalnov/jose2go v1.5.0
2021-11-02T17:48:29.8884850Z go: downloading github.com/keybase/go-keychain v0.0.0-20201121013009-976c83ec27a6
2021-11-02T17:48:29.8987950Z go: downloading github.com/mitchellh/go-homedir v1.1.0
2021-11-02T17:48:29.9090050Z go: downloading github.com/mtibben/percent v0.2.1
2021-11-02T17:48:29.9170520Z go: downloading golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
2021-11-02T17:48:29.9664840Z go: downloading github.com/armon/go-radix v1.0.0
2021-11-02T17:48:29.9764090Z go: downloading github.com/bgentry/speakeasy v0.1.0
2021-11-02T17:48:29.9865140Z go: downloading github.com/fatih/color v1.9.0
2021-11-02T17:48:29.9967210Z go: downloading github.com/mattn/go-isatty v0.0.12
2021-11-02T17:48:30.0067170Z go: downloading github.com/posener/complete v1.2.3
2021-11-02T17:48:30.0523910Z go: downloading github.com/fsnotify/fsnotify v1.5.1
2021-11-02T17:48:30.0727300Z go: downloading github.com/magiconair/properties v1.8.5
2021-11-02T17:48:30.0971020Z go: downloading github.com/mitchellh/mapstructure v1.4.2
2021-11-02T17:48:30.1130490Z go: downloading github.com/spf13/afero v1.6.0
2021-11-02T17:48:30.1533140Z go: downloading github.com/spf13/cast v1.4.1
2021-11-02T17:48:30.1673040Z go: downloading github.com/spf13/jwalterweatherman v1.1.0
2021-11-02T17:48:30.1772980Z go: downloading github.com/spf13/pflag v1.0.5
2021-11-02T17:48:30.2136750Z go: downloading github.com/subosito/gotenv v1.2.0
2021-11-02T17:48:30.2292700Z go: downloading gopkg.in/ini.v1 v1.63.2
2021-11-02T17:48:30.2455100Z go: downloading github.com/mattn/go-colorable v0.1.6
2021-11-02T17:48:30.2836740Z go: downloading golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359
2021-11-02T17:48:30.3088470Z go: downloading github.com/hashicorp/go-multierror v1.1.0
2021-11-02T17:48:30.3711810Z go: downloading golang.org/x/text v0.3.6
2021-11-02T17:48:31.0311310Z go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
2021-11-02T17:48:31.0438220Z go: downloading github.com/hashicorp/hcl v1.0.0
2021-11-02T17:48:31.1632690Z go: downloading github.com/pelletier/go-toml v1.9.4
2021-11-02T17:48:31.2856870Z go: downloading gopkg.in/yaml.v2 v2.4.0
2021-11-02T17:48:31.3107750Z go: downloading github.com/hashicorp/errwrap v1.0.0
2021-11-02T17:48:50.6767980Z # github.com/99designs/keyring
2021-11-02T17:48:50.6876420Z ##[error]../../../go/pkg/mod/github.com/99designs/[email protected]/keychain.go:136:8: kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
2021-11-02T17:48:50.6975510Z ##[error]../../../go/pkg/mod/github.com/99designs/[email protected]/keychain.go:181:9: kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
2021-11-02T17:48:50.7079880Z ##[error]../../../go/pkg/mod/github.com/99designs/[email protected]/keychain.go:181:21: undefined: keychain.Access
2021-11-02T17:48:50.7081830Z FAIL	github.com/endorama/2ami [build failed]
2021-11-02T17:48:50.7181870Z ##[error]../../../go/pkg/mod/github.com/99designs/[email protected]/keychain.go:187:9: kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
2021-11-02T17:48:50.7282550Z ##[error]../../../go/pkg/mod/github.com/99designs/[email protected]/keychain.go:187:21: undefined: keychain.Access
2021-11-02T17:48:50.8041020Z ##[error]Process completed with exit code 2.

The reported issues are:

  • kcItem.SetAccess undefined (type keychain.Item has no field or method SetAccess)
  • undefined: keychain.Access

Referenced at:

@endorama
Copy link
Author

endorama commented Nov 3, 2021

I tried updating keybase/go-keychain to the latest version (v0.0.0-20201121013009-976c83ec27a6) but it does not seem to solve the issue.
Actually I missed that the CI was already using that version.

@endorama
Copy link
Author

endorama commented Nov 4, 2021

I found a proposed solution in apache/pulsar-client-go#594

The solution is to add this replace to go.mod:

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

@pgier
Copy link
Contributor

pgier commented Jan 19, 2022

What project were you building when you ran into this error? The errors are caused by the removal of some deprecated APIs in recent versions of go-keychain (keybase/go-keychain#76). If you were only depending on 99designs/keyring, you should have picked up an older version of keybase/go-keychain, and possibly just seen deprecation warnings instead of the compile error.

I'm just wondering if #102 would fix the issue for you, or if there is some other dependency bringing in the newer version of go-keychain.

@endorama
Copy link
Author

@pgier this is the project https://github.com/endorama/2ami; linked here there is the PR I opened to fix this issue (through the replace directive in go.mod). Looking at the go.mod at the time of the PR keybase/go-keychain is listed as indirect dependency.

@dewey
Copy link

dewey commented Jan 20, 2022

@pgier Without looking too much into it yet, is there a bigger reason why we can't use the newer upstream keybase/go-keychain and have to rely on the older forked 99designs version of it?

I prefer your solution over having a replace statement, but just curious what it would take to directly use upstream.

@mtibben
Copy link
Member

mtibben commented Jan 20, 2022

Upstream made an error removing large portions of code they believed were deprecated APIs in keybase/go-keychain#60. The situation is much more complicated, and while Apple has marked the APIs deprecated it's unlikely they will ever be removed due to the useful features they provide. I've just checked and it appears they've reversed the removals keybase/go-keychain#77 - if that's the case we can possibly move back to upstream

@mtibben
Copy link
Member

mtibben commented Jan 20, 2022

no spoke too soon - keybase/go-keychain#77 hasn't restored the APIs required for keyring

@pgier
Copy link
Contributor

pgier commented Jan 22, 2022

@dewey As @mtibben described, the latest version of upstream keybase/go-keychain has removed the deprecated APIs which are required for this project. The Apple docs don't seem to list any replacements for the deprecated functions, so it seems like we're kind of stuck for now.

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

Successfully merging a pull request may close this issue.

4 participants