Skip to content

Conversation

@codebytere
Copy link
Member

Description of Change

Closes #47671
Refs nodejs/node#58122

Fixes an issue where require('node:sqlite') didn't work - this happened in #47555 via nodejs/node#58122, which added the option to build without sqlite. That didnt get correctly copied to the GN build config.

See upstream at nodejs/node#59017

Checklist

Release Notes

Notes: Fixed an issue where require('node:sqlite') didn't work.

@codebytere codebytere requested a review from a team as a code owner July 10, 2025 08:14
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jul 10, 2025
@deepak1556
Copy link
Member

The sqlite test suites in upstream under test/parallel have calls to require('node:sqlite') wonder why they didn't break in our CI runners ? Ex: https://github.com/nodejs/node/blob/3567fa7d70fee8831ab2891e6940ca63be568b08/test/parallel/test-sqlite-database-sync.js#L7

@codebytere
Copy link
Member Author

codebytere commented Jul 10, 2025

@deepak1556 it's because they all fell into https://github.com/nodejs/node/blob/f8809cef63540492a1e589a55cc6d84cac6245df/test/common/index.js#L687-L691 from the same PR that caused this - the sqlite tests thought sqlite was disabled on purpose.

sources += gypi_values.node_crypto_sources
}
+ if (node_use_sqlite) {
+ sources += gypi_values.node_sqlite_sources
Copy link
Member

Choose a reason for hiding this comment

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

Should we use chromes sqlite instead? Avoid linking two different sqlites

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Ah gotcha, I guess question still stands though, we should route the sqlite dep to chrome's instead of nodes (same as boringssl and v8)

Copy link
Member

Choose a reason for hiding this comment

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

Oh I was under the impression we already did but seems not, agree the deps should be reused from chrome would also help get rid of https://github.com/electron/electron/blob/main/patches/sqlite/fix_rename_sqlite_win32_exports_to_avoid_conflicts_with_node_js.patch

Copy link
Member Author

@codebytere codebytere Jul 10, 2025

Choose a reason for hiding this comment

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

@MarshallOfSound @deepak1556 i tried this initially but there were a serious spate of errors i couldn't figure a way around at the time (i think chrome modifies some sqlite behavior iirc) - i can try again now but i don't think that should block this

Copy link
Member

Choose a reason for hiding this comment

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

Yeah follow-up sounds good to me since we have built in this mode for a while

Choose a reason for hiding this comment

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

Should we use chromes sqlite instead? Avoid linking two different sqlites

Another thing to take into consideration is the SQLite extension support of Node and Chromium.

For example, Node.js has support for the Session Extension, having its own API (nodejs/node#54181), and has also enabled all compile-time flags that enable the rest of the extensions that do not require any other code modifications (nodejs/node#57621).

@deepak1556
Copy link
Member

Thanks @codebytere , that makes sense.

@codebytere codebytere force-pushed the fix-sqlite branch 2 times, most recently from 0df524d to 315ea70 Compare July 11, 2025 13:51
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Jul 14, 2025
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jul 14, 2025
@codebytere codebytere merged commit 17dba93 into main Jul 15, 2025
108 of 112 checks passed
@codebytere codebytere deleted the fix-sqlite branch July 15, 2025 13:39
@release-clerk
Copy link

release-clerk bot commented Jul 15, 2025

Release Notes Persisted

Fixed an issue where require('node:sqlite') didn't work.

@trop
Copy link
Contributor

trop bot commented Jul 15, 2025

I have automatically backported this PR to "36-x-y", please check out #47755

@trop
Copy link
Contributor

trop bot commented Jul 15, 2025

I have automatically backported this PR to "37-x-y", please check out #47756

@trop trop bot removed the target/36-x-y PR should also be added to the "36-x-y" branch. label Jul 15, 2025
@trop
Copy link
Contributor

trop bot commented Jul 15, 2025

I have automatically backported this PR to "38-x-y", please check out #47757

@trop trop bot added in-flight/37-x-y in-flight/38-x-y merged/36-x-y PR was merged to the "36-x-y" branch. merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. and removed target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. in-flight/36-x-y in-flight/37-x-y in-flight/38-x-y labels Jul 15, 2025
kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/36-x-y PR was merged to the "36-x-y" branch. merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in 37.2.0: No such binding: sqlite

5 participants