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

Go module vendor - lib/sqlite3.h: No such file or directory #6

Closed
andrewchambers opened this issue Oct 10, 2018 · 2 comments
Closed

Comments

@andrewchambers
Copy link
Contributor

andrewchambers commented Oct 10, 2018

Go module vendoring does not seem to support C files in a sub directory:

golang/go#26366 (comment)

This means I keep getting

./sqlite3.h:5:10: fatal error: lib/sqlite3.h: No such file or directory
 #include "lib/sqlite3.h"
          ^~~~~~~~~~~~~~~

because the lib directory is not included by go 1.11 vendoring

@bvinc
Copy link
Owner

bvinc commented Oct 11, 2018

Thanks for letting me know.

I tried to reproduce this in go 1.11.1, but I couldn't.

brain@zen:~/go/src/modtest$ export GO111MODULE=on
brain@zen:~/go/src/modtest$ go mod init
go: creating new go.mod: module modtest
brain@zen:~/go/src/modtest$ go mod vendor
go: finding github.com/bvinc/go-sqlite-lite/sqlite3 latest
go: finding github.com/bvinc/go-sqlite-lite v0.4.0
go: downloading github.com/bvinc/go-sqlite-lite v0.4.0
brain@zen:~/go/src/modtest$ go build
brain@zen:~/go/src/modtest$ 

Did they already fix this in go 1.11.1?

Either way, I managed to find this:

golang/go@8fbbf63

If it's officially a bad idea to put the c files in subdirectories, then I'll just change it.

@bvinc
Copy link
Owner

bvinc commented Oct 11, 2018

Ok, I reproduced it in go 1.11. I moved the files to the package directory that uses them and it fixed it.

I made a v0.4.1 release with the fix.

@bvinc bvinc closed this as completed Oct 11, 2018
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

No branches or pull requests

2 participants