go-shiori / shiori

Simple bookmark manager built with Go
MIT License
9.04k stars 546 forks source link

internal/database/database.go:59:10: undefined: OpenSQLiteDatabase #947

Closed lifepillar closed 2 weeks ago

lifepillar commented 3 weeks ago

Data

Describe the bug / actual behavior

Trying to build Shiori from source results in:

internal/database/database.go:59:10: undefined: OpenSQLiteDatabase

Expected behavior

The build should succeed.

To Reproduce

Steps to reproduce the behavior:

  1. git clone https://github.com/go-shiori/shiori.git
  2. git checkout v1.7.0
  3. go build
  4. See error

Notes

Likely not a bug; rather, I'm missing something in the build process.

lifepillar commented 3 weeks ago

The culprit is 02247b215b2fa1c1c18f651561092290ed2a5058. I've got around the error by reinstating OpenSQLiteDatabase() in internal/database/sqlite.go. This seems a FreeBSD-specific problem.

fmartingr commented 3 weeks ago

The culprit is 02247b2. I've got around the error by reinstating OpenSQLiteDatabase() in internal/database/sqlite.go. This seems a FreeBSD-specific problem.

OpenBSD builds were broken so we removed the unimportant CGO dependencies and isolated the SQLite library into it's own build under internal/database/sqlite_openbsd.go. Unsure what's the problem could be with freebsd, maybe just adding the build flag to the same file to use it under freebsd is enough?

https://github.com/go-shiori/shiori/blob/master/internal/database/sqlite_openbsd.go#L1-L2

If FreeBSD works with nonCGO we can add it into the noncgo build flags:

https://github.com/go-shiori/shiori/blob/master/internal/database/sqlite_noncgo.go#L1-L2

lifepillar commented 2 weeks ago

If FreeBSD works with nonCGO we can add it into the noncgo build flags

I can confirm that this way Shiori builds.

fmartingr commented 2 weeks ago

If FreeBSD works with nonCGO we can add it into the noncgo build flags

I can confirm that this way Shiori builds.

Would you be open to submit a PR with those changes?