Trouble building vscode built-ints

I’m trying to build the vscode built-ins in UBI8-based container. However, doing “yarn” after setting up the vscode submodule reliably fails:

[4/4] Building fresh packages…
[-/12] ⠐ waiting…
[12/12] ⠐ @theia/electron
[-/12] ⠐ waiting…
[-/12] ⠈ waiting…
error /vscode-builtin-extensions/node_modules/@theia/electron: Command failed.
Exit code: 127
Command: node scripts/post-install.js
Arguments:
Directory: /vscode-builtin-extensions/node_modules/@theia/electron
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.19.1 | linux | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /usr/bin/python3 -c import sys; print “%s.%s.%s” % sys.version_info[:3];
gyp ERR! stack File “”, line 1
gyp ERR! stack import sys; print “%s.%s.%s” % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:308:12)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
gyp ERR! System Linux 4.19.128-microsoft-standard
gyp ERR! command “/usr/bin/node” “/vscode-builtin-extensions/node_modules/@theia/electron/node-gyp-cli.js” “rebuild”
gyp ERR! cwd /vscode-builtin-extensions/node_modules/@theia/electron/native
gyp ERR! node -v v12.19.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Error: “…/node-gyp-cli.js” exited with 1
at ChildProcess. (/vscode-builtin-extensions/node_modules/@theia/electron/scripts/post-install.js:36:40)
at Object.onceWrapper (events.js:421:26)

I’m a bit lost here, any pointers would be appreciated.

Maybe @marcdumais-work has a clue?

I do not think node-gyp 3.8.0 can use Python3. Either downgrade to Python2 or upgrade node-gyp. Theia uses 7.x

If I downgrade to python 2 it complains it can’t find /usr/bin/python3.

The example app in that repo has not been updated in a while. Doing so may have a ripple effect, where we’ll pull a newer node-gyp and fix the issue.

Thomas, would you open an issue in the builtins repo? A PR would also be welcome.

For a quick fix, you could try to bypass by removing the example app entries from the package.jon , workspaces list. Do not forget to nuke the repo clean from orbit after: git clean -ffdx

What drives me up the wall is that I can build everything just fine using Ubuntu.

@marcdumais-work I tried to update update dependencies by nuking yarn.lock, but that leads to problems compiling vscode.
I think the root cause is that we’re building vscode inside a package folder hierarchy. This will lead to modules being picked up from /node_modules (@type/htmlparser2, for example). I don’t think that is what we want: the vscode-extensions should not depend on anything in the bundling project. We should have completely distinct folder trees for building vscode and the bundling extensions. We could just move everything from the project root level into a “bundling” folder. Except the vscode submodule, of course.

Hi @tsmaeder,

We should have completely distinct folder trees for building vscode and the bundling extensions

I believe the vscode-bundle script takes care of that, temporarily moving node_modules and restoring it after we’re done:

I think the example app in that repo needs to be updated. I think we could skip building it here and just use a downloaded theia-blueprint, using the built-ins built locally instead of the bundled ones. We could then simplify the repo’s structure.

I believe the vscode-bundle script takes care of that,

not really, because as I understand it, the first thing yarn does is install the dependencies. So if we use the ‘yarn’ default command, we will have the node_folder present while we do extensions:build.