Skip to content

Conversation

@paulfitz
Copy link
Member

This:

  • Merges latest upstream.
  • Eliminates custom build and test steps by placing test hooks in the library, rather than keeping them separate. Separate is clean, but places the burden of dealing with linking problems across all platforms on us.
  • Points binary section of package.json at our repo, so that binaries placed in github releases here get used automatically.

This is a cleaned up version of my own fork of node-sqlite3. The bulk is a fairly uneventful merge, with changes in b9d8102

kewde and others added 30 commits April 19, 2020 14:34
prebuilt: remove Node v10.x
Change-Id: I79000463955d16eec8809c870f7d02c60da53432
Bug: TryGhost#418
Relate-to: TryGhost#1028
Origin: https://github.com/tizenteam/node-sqlite3
Signed-off-by: Philippe Coval <rzr@users.sf.net>
- This updates the README to be inline with what's in master
* Ensure JavaScript exceptions bubble up

* Fix segfault

* Fix mutex segfault

* Fix segfault caused by memory leak

If the database was being closed, and non-exclusive work was scheduled,
it overrode the lock flag such that the state became open=false locked=false
instead of open=false locked=true. This caused queued work to not be
processed, leaking memory, which causes a segfault during napi cleanup.

Make the same changes to other methods for safe measure.
* release: 5.0.1

* release: update log
…d52bdb2d0d6e5b2edd9aee sqlite-autoconf-3340000.tar.gz)
Executing "npm install --build-from-source" only builds the module for
one of the N-API target versions. The build command has to be executed
explicitly to generate builds targeting each of the specified N-API
versions.
This should fix publishing binaries.
* bug: verify toString() returns valid data
* test: faulty toString test
alexanderfloh and others added 21 commits September 8, 2022 22:08
- we shouldn't be tracking this for a library, but it's annoying when
  you're developing locally
closes TryGhost#419

- this adds support for a `change` event which forwards events arising
  from `sqlite3_update_hook`
- added constant exports and missing functions to Database
- this adds support for supplying Darwin ARM64 prebuilt binaries for
  node-sqlite3
refs https://www.sqlite.org/releaselog/3_39_4.html

- sha3-256sum: `431328e30d12c551da9ba7ef2122b269076058512014afa799caaf62ca567090`
refs https://www.sqlite.org/releaselog/3_40_0.html

- sha3-256sum: `7ee8f02b21edb4489df5082b5cf5b7ef47bcebcdb0e209bf14240db69633c878`
- done for DRY purposes when reading the code
- the default repo branch has been renamed to `main`
fixes TryGhost#1663

- Ubuntu 22.04 ships with a newer glibc so the prebuilt binaries end up
  being linked to a more recent version, removing compatibility with
  systems that ship with older variants
- this commit fixes that by downgrading the Ubuntu version
@paulfitz
Copy link
Member Author

paulfitz commented Jan 25, 2023

There is a trial run here: https://github.com/gristlabs/node-sqlite3/actions/runs/4016600020
With binaries collected here: https://github.com/gristlabs/node-sqlite3/releases/tag/v5.1.4-grist.7
(updated)

A prepackaged install can't quite be tested prior to landing, but you can overwrite .node files compiled on your own OS with something downloaded. (tweaked tagging, example of testing in next comment)

I need to mint a new version number, sorry about that. (done)

macos-m1 will depend on finding a volunteer to run a self-hosted runner. (thanks @dsagal)

@paulfitz
Copy link
Member Author

Output can now be tested as follows:

mkdir trial
cd trial
yarn init # hit enter for everything
yarn add https://github.com/gristlabs/node-sqlite3#v5.1.4-grist.7 --verbose

The yarn add step hopefully finishes with something like:

node-pre-gyp info using node-pre-gyp@1.0.10
node-pre-gyp info using node@16.13.1 | linux | x64
node-pre-gyp info check checked for "/home/paulfitz/cvs/take2/trial/node_modules/@gristlabs/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node" (not found)
node-pre-gyp http GET https://github.com/gristlabs/node-sqlite3/releases/download/v5.1.4-grist.7/napi-v6-linux-glibc-x64.tar.gz
node-pre-gyp info install unpacking napi-v6-linux-glibc-x64/node_sqlite3.node

If it starts building, then prebuilt versions didn't work out :(

Then try running node and see if:

require('@gristlabs/sqlite3').VERSION

runs and prints out '3.40.0'.

@dsagal
Copy link
Member

dsagal commented Jan 26, 2023

Works on a Mac!

node-pre-gyp info using node-pre-gyp@1.0.10
node-pre-gyp info using node@14.17.0 | darwin | x64
node-pre-gyp info check checked for "/Users/dmitry/devel/trial7/node_modules/@gristlabs/sqlite3/lib/binding/napi-v6-darwin-unknown-x64/node_sqlite3.node" (not found)
node-pre-gyp http GET https://github.com/gristlabs/node-sqlite3/releases/download/v5.1.4-grist.7/napi-v6-darwin-unknown-x64.tar.gz
node-pre-gyp info install unpacking napi-v6-darwin-unknown-x64/node_sqlite3.node
node-pre-gyp info extracted file count: 1
[@gristlabs/sqlite3] Success: "/Users/dmitry/devel/trial7/node_modules/@gristlabs/sqlite3/lib/binding/napi-v6-darwin-unknown-x64/node_sqlite3.node" is installed via remote
node-pre-gyp info ok

and

> require('@gristlabs/sqlite3').VERSION
'3.40.0'
>

@paulfitz
Copy link
Member Author

Thanks for confirming @dsagal!

@georgegevoian georgegevoian self-requested a review January 30, 2023 18:55
Copy link

@georgegevoian georgegevoian left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks @paulfitz.

@paulfitz paulfitz merged commit 208d600 into grist-main Feb 1, 2023
@paulfitz paulfitz deleted the build-binaries branch February 1, 2023 17:27
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.