Closed hafeoz closed 5 months ago
An error was encountered during my attempt to build on Alpine (musl-based distribution):
musl
# github.com/mattn/go-sqlite3 sqlite3-binding.c:34670:42: error: 'pread64' undeclared here (not in a function); did you mean 'pread'? 34670 | { "pread64", (sqlite3_syscall_ptr)pread64, 0 }, | ^~~~~~~ | pread sqlite3-binding.c:34688:42: error: 'pwrite64' undeclared here (not in a function); did you mean 'pwrite'? 34688 | { "pwrite64", (sqlite3_syscall_ptr)pwrite64, 0 }, | ^~~~~~~~ | pwrite sqlite3-binding.c: In function 'seekAndRead': sqlite3-binding.c:34674:49: error: unknown type name 'off64_t'; did you mean 'off_t'? 34674 | #define osPread64 ((ssize_t(*)(int,void*,size_t,off64_t))aSyscall[10].pCurrent) | ^~~~~~~ sqlite3-binding.c:37536:11: note: in expansion of macro 'osPread64' 37536 | got = osPread64(id->h, pBuf, cnt, offset); | ^~~~~~~~~ sqlite3-binding.c:34674:58: error: expected ')' before 'aSyscall' 34674 | #define osPread64 ((ssize_t(*)(int,void*,size_t,off64_t))aSyscall[10].pCurrent) | ~ ^~~~~~~~ sqlite3-binding.c:37536:11: note: in expansion of macro 'osPread64' 37536 | got = osPread64(id->h, pBuf, cnt, offset); | ^~~~~~~~~ sqlite3-binding.c: In function 'seekAndWriteFd': sqlite3-binding.c:34692:57: error: unknown type name 'off64_t'; did you mean 'off_t'? 34692 | #define osPwrite64 ((ssize_t(*)(int,const void*,size_t,off64_t))\ | ^~~~~~~ sqlite3-binding.c:37665:17: note: in expansion of macro 'osPwrite64' 37665 | do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR); | ^~~~~~~~~~ sqlite3-binding.c:34693:21: error: expected ')' before 'aSyscall' 34693 | aSyscall[13].pCurrent) | ^~~~~~~~ sqlite3-binding.c:37665:17: note: in expansion of macro 'osPwrite64' 37665 | do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR); | ^~~~~~~~~~ sqlite3-binding.c:34692:21: note: to match this '(' 34692 | #define osPwrite64 ((ssize_t(*)(int,const void*,size_t,off64_t))\ | ^ sqlite3-binding.c:37665:17: note: in expansion of macro 'osPwrite64' 37665 | do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR); | ^~~~~~~~~~
A quick google search points to https://github.com/mattn/go-sqlite3/issues/1164#issuecomment-1975022901. After updating go-sqlite3 version in go.mod and running go tidy I was able to compile without problem:
go-sqlite3
go.mod
go tidy
go.mod 7c7 < github.com/mattn/go-sqlite3 v1.14.11 --- > github.com/mattn/go-sqlite3 v1.14
I don't have any experience in go and I can't find any changelog for go-sqlite3, so I'm not sure if it breaks anything. The updated build works on my machine though :)
go
Thanks for reporting this! If you want to submit a PR to resolve this, I'd accept.
An error was encountered during my attempt to build on Alpine (
musl
-based distribution):A quick google search points to https://github.com/mattn/go-sqlite3/issues/1164#issuecomment-1975022901. After updating
go-sqlite3
version ingo.mod
and runninggo tidy
I was able to compile without problem:I don't have any experience in
go
and I can't find any changelog forgo-sqlite3
, so I'm not sure if it breaks anything. The updated build works on my machine though :)