benbjohnson/litestream

Build failed: conn.SetFileControlInt undefined

SeriousM opened this issue · 4 comments

Hi! Building the latest tagged git version 749bc0d I get the following error:

if err := conn.SetFileControlInt("main", sqlite3.SQLITE_FCNTL_PERSIST_WAL, 1); err != nil {

.\litestream.go:58:19: conn.SetFileControlInt undefined (type *sqlite3.SQLiteConn has no field or method SetFileControlInt)
.\litestream.go:58:53: undefined: sqlite3.SQLITE_FCNTL_PERSIST_WAL

I have no experience with Go so I really can't fix the issue, but maybe you can?

My machine:

  • Windows 10 22H2 19045
  • Go version go1.20.5 windows/amd64

Steps to reproduce:

  • git clone ...
  • cd litestream
  • go build .\cmd\litestream

Thank you!

@SeriousM before you excuse go build .\cmd\litestream , try to run go mod tidy first.

Thanks @panda8z for the hint. I ran go mod tidy and it downloaded a couple of packages, yet the build error still persists. It seems that the sqlite drive just don't support SetFileControlInt not has it sqlite3.SQLITE_FCNTL_PERSIST_WAL

I got a similar error when cross-compiling litestream from a x86_64 Mac to an arm64 Mac target. I solved it with adding CGO_ENABLED=1 to my go build command, but I'm unsure if that'll work for windows.

hifi commented

I added Windows build to the CI and it seems to build it just fine with CGO_ENABLED=1 so I'm marking this as completed. Please reopen or open a new issue if the problem persists.

As the Windows build is currently unsupported there's unlikely to be more work towards release binaries at this time.