-
Notifications
You must be signed in to change notification settings - Fork 14
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
Issue building vscode against >=electron-21 #104
Comments
I've not heard any other reports of this. We've been on Electron 21 for a decent amount of time now... and no one on the team has mentioned this and our localization pipelines are still running fine post-Electron 21. Maybe you should start by telling me how you are building VS Code. |
I realize that!
Sure thing. Here it is: https://github.com/PF4Public/gentoo-overlay/blob/master/app-editors/vscode/vscode-9999.ebuild Most interesting parts might be following:
#TODO: should work starting with electron-22
if use electron-20 || use electron-21 || use electron-22 || use electron-23 || use electron-24 ; then
CPPFLAGS="${CPPFLAGS} -std=c++17";
use build-online || eerror "build-online should be enabled for nan substitution to work" || die;
sed -i 's$"resolutions": {$"resolutions": {"nan": "^2.17.0",$' package.json || die;
fi
ebegin "Installing node_modules"
# yarn config set yarn-offline-mirror ${T}/yarn_cache || die
OLD_PATH=$PATH
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin/node-gyp-bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}:$PATH"
export PATH
export CFLAGS="${CFLAGS} -I/usr/include/electron-${ELECTRON_SLOT}/node"
export CPPFLAGS="${CPPFLAGS} -I/usr/include/electron-${ELECTRON_SLOT}/node"
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
# echo "$PATH"
yarn config set disable-self-update-check true || die
yarn config set nodedir /usr/include/electron-${ELECTRON_SLOT}/node || die
if ! use build-online
then
ONLINE_OFFLINE="--offline"
yarn config set yarn-offline-mirror "${DISTDIR}" || die
fi
yarn install --frozen-lockfile ${ONLINE_OFFLINE} \
--arch=${VSCODE_ARCH} --no-progress || die
OLD_PATH=$PATH
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin/node-gyp-bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}:$PATH"
export PATH
node --max_old_space_size=8192 node_modules/gulp/bin/gulp.js vscode-linux-${VSCODE_ARCH}-min || die
export PATH=${OLD_PATH}
OLD_PATH=$PATH
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin/node-gyp-bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}:$PATH"
export PATH
YARN_CACHE_FOLDER="${T}/.yarn-cache" node node_modules/gulp/bin/gulp.js vscode-linux-${VSCODE_ARCH}-prepare-deb || die Interesting observation: in GitHub actions it fails at the preparing Debian deb file. On a real hardware it fails at I tried following: #! Although this allows the build to continue, it renders vscode unusable
einfo "Fixing l10n-dev"
sed -i 's/return await import_web_tree_sitter/return null; await import_web_tree_sitter/' node_modules/@vscode/l10n-dev/dist/main.js || die It solves the issue, but the resulting vscode is obviously unusable. Like I've mentioned in vscode issue, I've bisected it to microsoft/vscode@0510da8 and indeed microsoft/vscode@88c8146 is the last functioning commit for me. |
What version of node are you using to build vscode? |
I'm using |
You're using electron as the node used to build VS Code instead of using regular node to build VS Code? |
Exactly. |
Why are you doing this instead of the recommended way to build VS Code which is to use actual Node.js? I don't think we can expect this to work. |
I use it mainly to lower the number of dependencies that are required to build vscode. I must admit this must be indeed a very rare edge-case. Still it is curious how it worked flawlessly until electron 21. Thank you for suggesting to try the real node. Using it just for the failing steps seems to resolve the issue. |
Really, we should get an issue going over here: https://github.com/tree-sitter/tree-sitter-typescript Because clearly the error comes from there. Would you like to get that going? @PF4Public maybe we can get some interesting info from the real experts. |
Of course! Even though this could be fixed by using real node, I'm still curious why it stopped working with electron acting as node. Would you like me to open issue there? |
That'd be great! Feel free to tag me. |
Created this to track bumping our version of tree-sitter when the day comes #114 |
I've posted this into vscode repo, but maybe you guys have any idea what may be causing this?
The error
tree_sitter_tsx_external_scanner_create
comes fromvscode-l10n/l10n-dev/src/ast/analyzer.ts
Lines 41 to 52 in b941cad
Both wasm files come pre-built from @vscode/l10n-dev.
Changing the dependency to version 0.0.24 changes the error (although that may be a race condition between the two):
Lines 259 and 270 from the error look as follows:
In this case
tree_sitter_typescript_external_scanner_create
is absent fromtree-sitter-tsx.wasm
, but present intree-sitter-typescript.wasm
.I have no idea, why is it trying to load a function that is absent from wasm file. Broken wasm files in @vscode/l10n-dev?
It is interesting that electron-19 and electron-20 show no such behaviour. See fresh logs here.
The text was updated successfully, but these errors were encountered: