Open Rucadi opened 9 months ago
I'm also having yarn related issues when building with nix:
Yeah I have been trying to get nixpkgs updated but I just keep running into issues. I got an error similar to the above, it seems to be the line in the install phase that installs production dependencies. I see that we use --ignore-scripts
combined with find
in earlier invocations of yarn
so I tried swapping it out for that but then I got these:
/nix/store/bknngadwym46j65qs14ic2w79rpav888-stdenv-linux/setup: line 1674: warning: here-document at line 1659 delimited by end-of-file (wanted `EOF')
/nix/store/bknngadwym46j65qs14ic2w79rpav888-stdenv-linux/setup: eval: line 1675: unexpected EOF while looking for matching `)'
And I have not looked into this yet. But it feels like maybe I just made a typo somewhere.
@code-asher I've advanced a little bit in this, however yarn/npm and js ecosystems are not my topic.
I managed to compile the latest code-server version modifying it slightly with this commit: https://github.com/Rucadi/nixpkgs/commit/2126fcae7653c9757a2b5f1b16ae0481b545ad02
I had problems with argon2 module missing when trying to execute the app, after that, I manage to go further, but still encounter problems.
I think that this is something that probably someone experienced can easily handle.
[2024-02-08T21:00:48.318Z] info code-server 4.21.0 0c98611e6b43803a9d5dba222d7023b569abfb49
[2024-02-08T21:00:48.319Z] info Using user-data-dir /home/nixos/.local/share/code-server
[2024-02-08T21:00:48.348Z] info Using config file /home/nixos/.config/code-server/config.yaml
[2024-02-08T21:00:48.348Z] info HTTP server listening on http://0.0.0.0:3000/
[2024-02-08T21:00:48.348Z] info - Authentication is disabled
[2024-02-08T21:00:48.348Z] info - Not serving HTTPS
[2024-02-08T21:00:48.348Z] info Session server listening on /home/nixos/.local/share/code-server/code-server-ipc.sock
Loading "minimist" failed
Error: Cannot find module 'minimist'
Require stack:
- /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/bootstrap-amd.js
- /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/util.js
- /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/cli.js
- /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/entry.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at require._load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/plugin.js:54:74)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at i (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:98)
at n.load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:1651)
at _.load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:3:9105)
at o (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:9362)
at Object.errorback (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:9481)
at _.triggerErrorback (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:3:9399)
at /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:3:9150
at n.load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:1668)
at _.load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:3:9105)
at o (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:9362)
at f._loadModule (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:9490)
at f._resolve (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:6:452)
at f.defineModule (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:5585)
at y (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:6:1770)
at v (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:2462)
at Object.<anonymous> (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/server/node/server.main.js:103:28682)
at Object.<anonymous> (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/server/node/server.main.js:218:1971)
at n._createAndEvalScript (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:2506)
at /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:2147
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/bootstrap-amd.js',
'/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/util.js',
'/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/cli.js',
'/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/entry.js'
],
phase: 'loading',
moduleId: 'minimist',
neededBy: [ 'vs/platform/environment/node/argv' ]
}
Here are the modules that depend on it:
[ 'vs/platform/environment/node/argv' ]
Loading "@microsoft/1ds-core-js" failed
Error: Cannot find module '@microsoft/1ds-core-js'
Require stack:
- /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/bootstrap-amd.js
- /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/util.js
- /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/cli.js
- /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/entry.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at require._load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/plugin.js:54:74)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at i (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:98)
at n.load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:1651)
at _.load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:3:9105)
at o (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:9362)
at Object.errorback (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:9481)
at _.triggerErrorback (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:3:9399)
at /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:3:9150
at n.load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:1668)
at _.load (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:3:9105)
at o (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:9362)
at f._loadModule (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:9490)
at f._resolve (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:6:452)
at f.defineModule (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:5:5585)
at y (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:6:1770)
at v (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:2462)
at Object.<anonymous> (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/server/node/server.main.js:174:6116)
at Object.<anonymous> (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/server/node/server.main.js:218:1971)
at n._createAndEvalScript (/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:2506)
at /nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/vs/loader.js:4:2147
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/lib/vscode/out/bootstrap-amd.js',
'/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/util.js',
'/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/cli.js',
'/nix/store/kyl1slqw3yy2nd7rd9srqqg7gfjdqrpl-code-server-4.21.0/libexec/code-server/out/node/entry.js'
],
phase: 'loading',
moduleId: '@microsoft/1ds-core-js',
neededBy: [ 'vs/server/node/telemetryClient' ]
}
Here are the modules that depend on it:
[ 'vs/server/node/telemetryClient' ]```
Ah yeah probably because of --ignore-scripts
it is not running the post-install script that does cd lib/vscode && yarn install
so the Node modules in lib/vscode
are all missing.
I bet the post-install scripts are responsible for building the native modules like argon2
as well.
What is your suggestion?
It would be nice if the NixPkgs version is always up-to-date with the latest release.
Why do you want this feature?
In can only install code-server through nix due to some requirements, and I would like to always have the up-to-date version, specially important due to copilot/copilot-chat
Are there any workarounds to get this functionality today?
I can modify the nixpkgs and build it locally.
Are you interested in submitting a PR for this?
I may be interested to maintain nixpkgs version, but when I tried to modify the nixpkgs repository, I failed to compile due to some yarn errors, that I don't know if they are my fault or that this pkg needs to be compiled with some extra nix configs.