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
Labels
NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin
Milestone

Comments

@bradfitz
Copy link
Contributor

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
@bradfitz bradfitz added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 28, 2017
@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 28, 2017
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 28, 2017
@ianlancetaylor
Copy link
Contributor

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
Copy link
Contributor Author

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

@gopherbot
Copy link

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>
@rsc rsc unassigned mpvl Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin
Projects
None yet
Development

No branches or pull requests

4 participants