-
Notifications
You must be signed in to change notification settings - Fork 102
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
Support Electron 13+ on Windows #151
Merged
+12
−2
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
defined(_MSC_VER)
be here?When using the library from Electron on a Mac (or Linux) machine, this is still the correct thing to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed ci example.
The step is marked as successful, but the tests do crash. Loading the backtrace with lldb on my local machine shows it's the same old missing_symbol error for
ArrayBuffer
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm able to build successfully on my laptop (macOS 13.4.1, M1 macbook air).
One thing that I ran into is that there's a submodule within a submodule in vscode-tree-sitter/vendor/node-tree-sitter/vendor/tree-sitter/ so I had to run
cd vendor/node-tree-sitter/ git submodule init git submodule update
I don't know, you might be right. For context
defined(_MSC_VER)
comes from the original PR #95, which comes from this suggestion electron/electron#29893 (comment) and also the code I mentioned earlierhttps://github.com/cocos/cocos-engine/pull/13394/files#diff-20bf293d344678d153d4509b5cf76d8472d032743bea1c0cc7348831b352b7e1R245
only does it on Windows
#if CC_EDITOR && CC_PLATFORM == CC_PLATFORM_WINDOWS
I noticed that they also do
maybe we need that too.
@kjvalencik or @dogeFu could you comment and help us out here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a windows machine I can try to run this on today, will update.
Also, I wrote a simpler test repo, I copied all the tests from node-tree-sitter and ran them from vscode.
The
Parser.setLogger.when the given callback throws an exception it logs the error to the console
test fails, so I skip it for now, but otherwise they all pass. I think it fails because vscode does something funny with the console during testing (maybe?), I'll also try to fix it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested on Windows (using the test-node-tree-sitter repo, it doesn't work.
I tried once using the npm library (v0.20.4), the tests crashed with this backtrace (from lldb):
And again using selfint/node-tree-sitter,
remove-msc-ver
branch, also crashed but with a slightly different backtrace:A bit of searching for 0xc0000005 errors shows it's probably a memory access violation error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@verhovsky is switching from NaN to n-api (https://github.com/tree-sitter/node-tree-sitter/tree/napi) planned? Maybe then it'll "just work"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no plan. If someone does it, it'll definitely get merged. I think #129 is almost finished, I didn't understand @MichaelBelousov's question about Language so idk how far away it is.
It seems though that even with NAPI there might still be an issue with this exact API for Electron 21+ electron/electron#35801 https://www.electronjs.org/blog/v8-memory-cage