-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/cgo: CoreFoundation go-keychain compile failure on tip #26721
Comments
I added the release blocker tag since the code in question works fine on Go 1.10 but breaks on Go 1.11. If the problem is determined to be in the go-keychain code, please feel free to remove the tag! |
This is expected. We've expanded the cases where we change the |
Go commit golang/go@94076feef changed the way that some C types are handled. Per Keith Randall, "places where they weren't being converted caused mismatches between source files in the same package." He suggested on golang/go#26721 that we should change the `nil` types to `0`. Doing so makes the code compile on tip. Further, add a `.travis.yml` so we can automatically compile + test on master. A sample build can be found here: https://travis-ci.org/kevinburkeomg/go-keychain/jobs/410508844
Go commit golang/go@94076feef changed the way that some C types are handled. Per Keith Randall, "places where they weren't being converted caused mismatches between source files in the same package." He suggested on golang/go#26721 that we should change the `nil` types to `0`. Doing so makes the code compile on tip. Further, add a `.travis.yml` so we can automatically compile + test on master. A sample build can be found here: https://travis-ci.org/kevinburkeomg/go-keychain/jobs/410508844
If there are more cases in Go 1.10, then we should say something in the 1.11 release notes. I don't see anything there now. |
This is the only library I've seen with a compatibility issue, though maybe we could do a fancy Github code search for, say, |
There are a fair number of results here and there are 3 other function calls in the linked file that have compatibility issues so maybe I'll submit some patches against these projects. To be honest I don't really understand the underlying problem that well - even after reading through the linked issue - so I might just write "this needs to change for Go 1.11 and changing https://github.com/search?p=2&q=language%3Ago+CFDataCreate%28nil&type=Code |
An alternate fix I implemented in keybase/go-keychain#31 is to use the typed constant This takes care of the common case in CoreFoundation where either |
Previously this would fail with a compilation error. For more information see: golang/go@94076feef golang/go#26721 keybase/go-keychain#30
Change https://golang.org/cl/127975 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What did you do?
Check out tip of github.com/keybase/go-keychain (commit keybase/go-keychain@70b98e9) and run
go build github.com/keybase/go-keychain
What did you expect to see?
I expected the program to compile.
What did you see instead?
Does this issue reproduce with the latest release (go1.10.3)?
No. I can reproduce it using tip though, which suggests that this code will break in the upcoming Go 1.11 release.
A git bisect revealed that commit 94076fe is the first commit to break; versions of Go compiled with commits earlier than this commit successfully compile the go-keychain library, newer ones don't.
System details
The text was updated successfully, but these errors were encountered: