mdempsky/unconvert

C: no such file or directory

Closed this issue · 6 comments

xlab commented
$ unconvert -v github.com/vulkan-go/vulkan
2017/07/07 16:17:49 open /Users/xlab/Documents/dev/go/src/github.com/vulkan-go/vulkan/C: no such file or directory
go version go1.9beta2 darwin/amd64

Does anything change if you do go install -v github.com/vulkan-go/vulkan, and then unconvert -v github.com/vulkan-go/vulkan?

xlab commented

@shurcooL I tried, it doesn't help.

$ go install -v github.com/vulkan-go/vulkan
github.com/vulkan-go/vulkan
$ unconvert -v github.com/vulkan-go/vulkan
2017/07/07 18:07:56 open /Users/xlab/Documents/dev/go/src/github.com/vulkan-go/vulkan/C: no such file or directory
cznic commented

It looks like some loader mistakenly attempts to import "C".

xlab commented

@cznic @shurcooL I actually tried to create a minimal reproducible example, but it works fine in handmade cases..

Minimal repro case:

package p

// unsigned int myfunc();
import "C"

func f() interface{} {
	return C.myfunc
}

The "C" file is actually the _cgo_gotypes.go file generated by cgo. The "C" name is synthesized by go/loader.

Looks like this is working now to me: unconvert -v github.com/vulkan-go/vulkan prints a bunch of unnecessary conversions.