-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vscode/electron crash #144
Conversation
when using Buffer instead of ArrayBuffer (in V8), the exported object is of type (in JS) Uint8Array. But the transfer buffers are uint32 arrays, so we need to load them as Uint32Array s manually.
I investigated this a bit in #141. Through github actions, on Windows Server 2019 I ran (in this order) npx prebuild -t 10.0.0 -t 12.0.0 -t 14.0.0 -t 16.0.0 -t 18.0.0 -t 20.0.0
npx prebuild -r electron -t 3.0.0 -t 4.0.0 -t 5.0.0 -t 6.0.0 -t 7.0.0 -t 8.0.0 -t 9.0.0 -t 10.0.0 -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.0 -t 15.0.0 -t 16.0.0 -t 17.0.0 -t 18.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0 -t 23.0.0 -t 24.0.0 -t 25.0.0 under Node 10, 12, 14, 16, 18 and 20 on the old code (not the changes in this repo). Node 10, 12 and 14 fail with this uninteresting error when prebuilding for Node 18:
Node 16, 18 and 20 can prebuild for all Node versions and Electron 3-12 but fail when prebuilding for Electron 13+ with these two errors:
which is saying the functions
Line 59 in 1328145
The errors suggest it's compiling this line https://github.com/tree-sitter/node-tree-sitter/blob/master/src/conversions.cc#L38-L39 so it must not be hitting the The current code in node-tree-sitter is a modification of the code suggested here electron/electron#29893 (comment) (added in #95) which I modified a bit because as I mentioned So I think the first thing is to figure out which of |
This PR seems to produce some memory errors in the CI on Node 16. On Ubuntu:
on macos:
so we obviously can't merge it. |
This PR makes
node-tree-sitter
run in Electron v22 (NODE_MODULE_VERSION 110).The current patch for this is incomplete (#134). This PR finishes it (hopefully).
I've marked this as a draft, since I had trouble with this #if:
Both
_MSC_VER
andNODE_RUNTIME_ELECTRON
were not set, and I couldn't figure out how to set them.Otherwise this worked for me when running from this VSCode on an M1 mac:
Testing repo: https://github.com/selfint/vscode-tree-sitter