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

x/text: cgo changes broke golang.org/x/text/collate/tools/colcmp on Darwin #22900

Open
bradfitz opened this issue Nov 28, 2017 · 3 comments
Open

x/text: cgo changes broke golang.org/x/text/collate/tools/colcmp on Darwin #22900

bradfitz opened this issue Nov 28, 2017 · 3 comments
Assignees
Milestone

Comments

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Nov 28, 2017

The golang.org/x/text/collate/tools/colcmp binary no longer compiles at Go tip. (It works at Go 1.9 and Go 1.8)

https://build.golang.org/log/6a0073f83d8b33849ca6b8f57120b1161e849c32

# golang.org/x/text/collate/tools/colcmp
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:41: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithBytes
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:48: cannot use nil as type _Ctype_CFAllocatorRef in argument to func literal
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:76: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithCharactersNoCopy
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:79: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithCharactersNoCopy
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:82: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithCharactersNoCopy
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:85: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithCharactersNoCopy
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:93: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithBytesNoCopy
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:98: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithBytesNoCopy
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:101: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithBytesNoCopy
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:106: cannot use nil as type _Ctype_CFAllocatorRef in argument to _Cfunc_CFStringCreateWithBytesNoCopy
/var/folders/dx/k53rs1s93538b4x20g46cj_w0000gn/T/workdir/gopath/src/golang.org/x/text/collate/tools/colcmp/darwin.go:106: too many errors
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 28, 2017

This is due to https://golang.org/cl/66332. It needs to be fixed in x/text.

@ianlancetaylor ianlancetaylor changed the title cmd/cgo: cgo changes broke golang.org/x/text/collate/tools/colcmp on Darwin x/text: cgo changes broke golang.org/x/text/collate/tools/colcmp on Darwin Nov 28, 2017
@gopherbot gopherbot added this to the Unreleased milestone Nov 28, 2017
@bradfitz

This comment has been minimized.

Copy link
Contributor Author

@bradfitz bradfitz commented Nov 28, 2017

Ah, great. I had a fix mostly done but wasn't sure why it was needed.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 28, 2017

Change https://golang.org/cl/80215 mentions this issue: collate/tools/colcmp: fix some breakage from cftypes cgo changes in Go 1.10

gopherbot pushed a commit to golang/text that referenced this issue Nov 28, 2017
…o 1.10

I used C.kCFAllocatorDefault (defined as NULL in C) instead of 0 so
it'd compile on older Go versions.

After this change, only one compilation error remains:

./darwin.go:48: cannot use l (type _Ctype_CFStringRef) as type *_Ctype_struct___CFString in argument to func literal

Updates golang/go#22900

Change-Id: I55dfbf560c18b4ebaedf4d96340423c0b1ae445a
Reviewed-on: https://go-review.googlesource.com/80215
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.