go-sqlite3 icon indicating copy to clipboard operation
go-sqlite3 copied to clipboard

Can amalgamation files be moved back to separate directory?

Open rittneje opened this issue 3 years ago • 1 comments

In #294, the sqlite3-binding.c, etc. files were moved out of a sub-directory for better compatibility with tools like godep. This in turn caused issues with the libsqlite3 build tag due to the way cgo works, which necessitated that the amalgamation files be manually patched to include an #ifndef USE_LIBSQLITE3 check. This manual patch then must be re-inserted each time we upgrade SQLite.

As godep, etc. are likely no longer maintained in the wake of go mod, we should revisit this point. If the files are moved back to a sub-directory, will it still work properly with go mod? Can we stop having to manually patch the amalgamation files?

rittneje avatar Feb 23 '22 03:02 rittneje

I'm experimentally trying if the C code can be moved to amagramation but seems not to be easy.

https://github.com/mattn/go-sqlite3/tree/move-code

c:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: $WORK\b001\_x005.o:sqlite3.cgo2.c:(.rdata$.refptr.sqlite3_version[.refptr.sqlite3_version]+0x0): undefined reference to `sqlite3_version'                                                                                                                                                                                       collect2.exe: error: ld returned 1 exit status               

mattn avatar Feb 24 '22 00:02 mattn