[GH-ISSUE #947] internal/database/database.go:59:10: undefined: OpenSQLiteDatabase #421

Closed
opened 2026-02-25 23:34:11 +03:00 by kerem · 4 comments
Owner

Originally created by @lifepillar on GitHub (Jun 29, 2024).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/947

Data

  • Shiori version: v1.7.0 branch
  • Database Engine: SQLite (the default).
  • Operating system: FreeBSD 14
  • CLI/Web interface/Web Extension: CLI

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.

Originally created by @lifepillar on GitHub (Jun 29, 2024). Original GitHub issue: https://github.com/go-shiori/shiori/issues/947 ## Data - **Shiori version**: v1.7.0 branch - **Database Engine**: SQLite (the default). - **Operating system**: FreeBSD 14 - **CLI/Web interface/Web Extension**: CLI ## 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.
kerem 2026-02-25 23:34:11 +03:00
  • closed this issue
  • added the
    type:bug
    label
Author
Owner

@lifepillar commented on GitHub (Jun 29, 2024):

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

<!-- gh-comment-id:2198096541 --> @lifepillar commented on GitHub (Jun 29, 2024): The culprit is 02247b215b2fa1c1c18f651561092290ed2a5058. I've got around the error by reinstating `OpenSQLiteDatabase()` in `internal/database/sqlite.go`. This seems a FreeBSD-specific problem.
Author
Owner

@fmartingr commented on GitHub (Jun 29, 2024):

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

<!-- gh-comment-id:2198111520 --> @fmartingr commented on GitHub (Jun 29, 2024): > The culprit is [02247b2](https://github.com/go-shiori/shiori/commit/02247b215b2fa1c1c18f651561092290ed2a5058). 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
Author
Owner

@lifepillar commented on GitHub (Jun 30, 2024):

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

I can confirm that this way Shiori builds.

<!-- gh-comment-id:2198584314 --> @lifepillar commented on GitHub (Jun 30, 2024): >If FreeBSD works with nonCGO we can add it into the noncgo build flags I can confirm that this way Shiori builds.
Author
Owner

@fmartingr commented on GitHub (Jun 30, 2024):

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?

<!-- gh-comment-id:2198586319 --> @fmartingr commented on GitHub (Jun 30, 2024): > > 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?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#421
No description provided.