Skip to content

Cannot install the NPM package without X11 anymore (aka missing modifications on vendored vscode?) #4179

Closed
@edvincent

Description

@edvincent

In the end, this might be a documentation update needed - but cutting as a bug report because stuff that used to work without problems for the last couple of releases doesn't work anymore... If only, knowing whether this was voluntary or a miss would be useful :D

OS/Web Information

Linux, with 3.12's NPM package (and I'd expect the same thing to happen for building it from source too?)

Steps to Reproduce

Try to install the npm package on a machine without X11.

Even more precisely, with a newly-spinned EC2 instance running Ubuntu 20.4:

# Install and upgrade node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm install v14.17.6

# Install the couple dependencies to install from the NPM package
sudo apt-get update
sudo apt-get install pkg-config
sudo apt-get install make
sudo apt-get install g++

# Install code-server itself
npm install -g code-server

Expected

That should work because I'd expect patches like #2961 and all the details/modifications highlighted in https://github.com/cdr/code-server/blob/v3.12.0/docs/CONTRIBUTING.md#modifications-to-vs-code to still apply.

Namely, stuff like libx11 and libxkbfile should not be needed anymore.

Actual

During the installation, when pulling native-keymap, when it rebuilds node-gyp with node-gyp rebuild, it tries to run ${PKG_CONFIG:-pkg-config} x11 xkbfile --libs which relies on x11 and libxkbfile, and it fails.

Logs

[4/4] Building fresh packages...
[1/10] ⠈ @vscode/sqlite3
[2/10] ⠈ keytar
[3/10] ⠈ native-is-elevated
[4/10] ⠈ native-keymap
error /home/ubuntu/.nvm/versions/node/v14.17.6/lib/node_modules/code-server/vendor/modules/code-oss-dev/node_modules/native-keymap: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /home/ubuntu/.nvm/versions/node/v14.17.6/lib/node_modules/code-server/vendor/modules/code-oss-dev/node_modules/native-keymap
Output:
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Package xkbfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `xkbfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xkbfile' found
gyp: Call to '${PKG_CONFIG:-pkg-config} x11 xkbfile --cflags | sed s/-I//g' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/ubuntu/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 5.4.0-1018-aws
gyp ERR! command "/home/ubuntu/.nvm/versions/node/v14.17.6/bin/node" "/home/ubuntu/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/.nvm/versions/node/v14.17.6/lib/node_modules/code-server/vendor/modules/code-oss-dev/node_modules/native-keymap

Screenshot

N/A

Notes

This issue can be reproduced in VS Code: No

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghigh-priorityThis issue needs to be resolved ASAP

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions