vulkan-go / vulkan

Vulkan API bindings for Go programming language
MIT License
744 stars 56 forks source link

Not able to use dep to isolate vulkan dependency #14

Closed delaneyj closed 6 years ago

delaneyj commented 6 years ago

Have a working example using go get, go run main.go works fine.

Use dep init to pull the same dependencies to the vendor folder.

  Using master as constraint for direct dep github.com/vulkan-go/vulkan
  Locking in master (f7f4611) for direct dep github.com/vulkan-go/vulkan
  Using ^0.8.0 as constraint for direct dep github.com/pkg/errors
  Locking in v0.8.0 (645ef00) for direct dep github.com/pkg/errors
  Using v3.3 as constraint for direct dep github.com/vulkan-go/glfw
  Locking in v3.3 (72ceac6) for direct dep github.com/vulkan-go/glfw

It appears there is bad path resolution happening.

# learn/vendor/github.com/vulkan-go/glfw/v3.3/glfw
vendor\github.com\vulkan-go\glfw\v3.3\glfw\c_glfw.go:4:30: fatal error: glfw/src/context.c: No such file or directory
compilation terminated.
# learn/vendor/github.com/vulkan-go/vulkan
vendor\github.com\vulkan-go\vulkan\cgo_helpers.go:10:27: fatal error: vulkan/vulkan.h: No such file or directory
compilation terminated.
xlab commented 6 years ago

Hi, it seems that dep omits some sources from the vendored dir, judging by the log lines.

Could you please verify that in this case:

vendor\github.com\vulkan-go\vulkan\cgo_helpers.go:10:27: fatal error: vulkan/vulkan.h: No such file or directory
compilation terminated.

You actually have vendor\github.com\vulkan-go\vulkan\vulkan\vulkan.h in place?

Also, could be a path issue. At this point I'm not sure on which stage of the pipeline the problem is. But in both cases packages have an internal directory with C-only sources, so dep could omit them. I don't have the env to test it by myself.

xlab commented 6 years ago

It looks like an issue https://github.com/golang/dep/issues/1223

that is surpassed by https://github.com/golang/dep/issues/944

screen shot 2018-03-15 at 12 20 17
delaneyj commented 6 years ago

Sorry, log weekend.

You actually have vendor\github.com\vulkan-go\vulkan\vulkan\vulkan.h in place?

No, but it is in C:\tools\mingw64\x86_64-w64-mingw32\include\GLFW and gets picked up when building with a copy at $GOPATH/src/github.com/vulkan-go/vulkan instead of in vendor

xlab commented 6 years ago

@delaneyj see the prune case. Godep removes C sources, it removed vulkan headers from your vendor/

delaneyj commented 6 years ago

Sorry forgot to close here, yeah not your fault just good for others to know. Curious how vgo would handle this.