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

Not possible to import using go mod vendor #251

Closed
gustafj opened this issue May 21, 2019 · 5 comments · Fixed by #280
Closed

Not possible to import using go mod vendor #251

gustafj opened this issue May 21, 2019 · 5 comments · Fixed by #280

Comments

@gustafj
Copy link

gustafj commented May 21, 2019

Hi, as is now its not possible to import go-gl via the vendor directory using go mod vendor.

The reason is that go mod vendor prunes all directories with .c files that does not have a companion .go file.
This results in failed builds due to lacking .c sources, e.g. vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw.go:4:10: fatal error: 'glfw/src/context.c' file not found

This is expected behavior on the go mod vendor part (see https://github.com/golang/go/wiki/Modules#some-needed-files-may-not-be-present-in-populated-vendor-directory) but basically means that go-gl is not possible to vendor.

Would it be possible to solve this by bundling a dummy.go file in the affected directories?

@pwaller
Copy link
Member

pwaller commented May 24, 2019

Hi! Thanks for reporting this. Your solution of dummy.go sounds fine to me. PR welcome.

@pwaller
Copy link
Member

pwaller commented Nov 24, 2019

@gustafj I've submitted a fix for you in #258 - please take a look and let me know if it fixes your issues or not.

@pwaller pwaller mentioned this issue Nov 24, 2019
pwaller added a commit to pwaller/glfw that referenced this issue Nov 24, 2019
This allows "go mod vendor" to copy the files out of the tree, where otherwise they would be ignored.

Fixes go-gl#251.
pwaller added a commit to pwaller/glfw that referenced this issue Nov 24, 2019
This allows "go mod vendor" to copy the files out of the tree, where otherwise they would be ignored.

Fixes go-gl#251.
@rbrownrigg
Copy link

Can the associated pull request be merged and this issue closed out? I've stumbled across this issue too in the context of modules/vendoring.

Thanks

@pwaller
Copy link
Member

pwaller commented Jan 29, 2020

@rbrownrigg if you test it and leave a message on the PR saying it solves the problem for you, I'll merge it.

@gustafj
Copy link
Author

gustafj commented Jan 31, 2020

Unfortunately it don't 😢, see my comment in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants