Skip to content

Conversation

ReillyBrogan
Copy link
Contributor

Better-sqlite3 only provides pre-built binaries for Electron versions up to v22. This means that the module is built from source code during logseq builds, which on my machine adds about 45 seconds to the build (a 16-core 7950x3d building from a tmpfs, so likely much more time on CI runners or someone else's machine). Additionally about ~20-30MiB of unnecessary build artifacts from the better-sqlite3 build get included in the Electron package.

To solve both of these issues update to the latest v9.3.0 which provides pre-built binaries for most platforms (might actually be all platforms that Logseq supports, I only tested Linux x64) up through Electron v28. This also updates the used version of sqlite from v3.40.0 to v3.45.0. I looked through the release notes for all versions and didn't see anything that looked like a breaking change, only bugfixes, sqlite3 updates, and Electron pre-build support changes.

Also, FWIW it would be great if updating better-sqlite3 could be added to the workflow of updating Electron versions in order to prevent build times and distribution sizes from regressing again. I saw that there's intent to replace better-sqlite3 with a different sqlite driver for full-text searches but I assume that that is still a ways away.

@CLAassistant
Copy link

CLAassistant commented Jan 18, 2024

CLA assistant check
All committers have signed the CLA.

@andelf andelf self-requested a review January 19, 2024 02:50
Copy link
Collaborator

@andelf andelf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
I'll add a test build later.

@andelf andelf merged commit a6d13fb into logseq:master Jan 19, 2024
@andelf
Copy link
Collaborator

andelf commented Jan 19, 2024

Also, there's a rick of upgraded GLIBC version.
I'll test this on an old Linux distribution.

@andelf
Copy link
Collaborator

andelf commented Jan 19, 2024

Binary builds: https://nightly.link/logseq/logseq/actions/runs/7579906197

@ReillyBrogan ReillyBrogan deleted the better-sqlite3 branch January 19, 2024 06:32
This was referenced Jan 30, 2024
@turtaf turtaf mentioned this pull request Feb 8, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants