# compiling editors/vscode spawns a weird error



## Alain De Vos (Dec 30, 2022)

```
[00:20:49] [16:13:35] Finished [36mbundle-extensions-build[39m after [35m298304 ms[39m
[00:20:49] [16:13:35] Starting [36mcompile-extensions-build[39m ...
[00:20:49] [16:13:35] Finished [36mcompile-extensions-build[39m after [35m0 ms[39m
[00:20:49] [16:13:35] Starting [36mcompile-extension-media-build[39m ...
[00:20:50] [16:13:36] Finished [32mesbuilding extension media[39m /wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/extensions/notebook-renderers/esbuild.js with 0 errors.
[00:20:50] [16:13:36] Finished [32mesbuilding extension media[39m /wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/extensions/markdown-math/esbuild.js with 0 errors.
[00:20:50] [16:13:36] Finished [32mesbuilding extension media[39m /wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/extensions/markdown-language-features/esbuild-preview.js with 0 errors.
[00:20:50] [16:13:36] Finished [32mesbuilding extension media[39m /wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/extensions/markdown-language-features/esbuild-notebook.js with 0 errors.
[00:20:50] [16:13:36] Finished [32mesbuilding extension media[39m /wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/extensions/ipynb/esbuild.js with 0 errors.
[00:20:50] [16:13:36] Finished [32mesbuilding extension media[39m /wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/extensions/simple-browser/esbuild-preview.js with 0 errors.
[00:20:50] [16:13:36] Finished [36mcompile-extension-media-build[39m after [35m954 ms[39m
[00:20:50] [16:13:36] Starting [36mclean-out-vscode[39m ...
[00:20:50] [16:13:36] Finished [36mclean-out-vscode[39m after [35m4 ms[39m
[00:20:50] [16:13:36] Starting [36moptimize-vscode[39m ...
[00:20:51] Loading "vs/workbench/contrib/codeEditor/electron-sandbox/startDebugTextMate.nls.keys" failed
[00:20:51] [Error: EMFILE: too many open files, open 'out-build/vs/workbench/contrib/codeEditor/electron-sandbox/startDebugTextMate.nls.keys.js'] {
[00:20:51]   errno: -24,
[00:20:51]   code: 'EMFILE',
[00:20:51]   syscall: 'open',
[00:20:51]   path: 'out-build/vs/workbench/contrib/codeEditor/electron-sandbox/startDebugTextMate.nls.keys.js',
[00:20:51]   phase: 'loading',
[00:20:51]   moduleId: 'vs/workbench/contrib/codeEditor/electron-sandbox/startDebugTextMate.nls.keys',
[00:20:51]   neededBy: [ '===anonymous200===' ]
[00:20:51] }
[00:20:51] Here are the modules that depend on it:
[00:20:51] [ '===anonymous200===' ]
[00:20:51] [16:13:37] 'vscode-linux-x64-min' errored after 9.67 min
[00:20:51] [16:13:37] Error: {"errno":-24,"code":"EMFILE","syscall":"open","path":"out-build/vs/workbench/contrib/output/common/outputChannelModel.js","phase":"loading","moduleId":"vs/workbench/contrib/output/common/outputChannelModel","neededBy":["vs/workbench/contrib/output/common/outputChannelModelService"]}
[00:20:51]     at formatError (/wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/node_modules/gulp-cli/lib/versioned/^4.0.0/format-error.js:21:10)
[00:20:51]     at Gulp.<anonymous> (/wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/node_modules/gulp-cli/lib/versioned/^4.0.0/log/events.js:33:15)
[00:20:51]     at Gulp.emit (node:events:525:35)
[00:20:51]     at Gulp.emit (node:domain:489:12)
[00:20:51]     at Object.error (/wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/node_modules/undertaker/lib/helpers/createExtensions.js:61:10)
[00:20:51]     at handler (/wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/node_modules/now-and-later/lib/map.js:50:14)
[00:20:51]     at f (/wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/node_modules/once/once.js:25:25)
[00:20:51]     at f (/wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/node_modules/once/once.js:25:25)
[00:20:51]     at tryCatch (/wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/node_modules/async-done/index.js:24:15)
[00:20:51]     at done (/wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/node_modules/async-done/index.js:40:12)
[00:20:51]     at Domain.onError (/wrkdirs/usr/ports/editors/vscode/work/vscode-1.70.2/node_modules/async-done/index.js:51:5)
[00:20:51]     at Object.onceWrapper (node:events:628:26)
[00:20:51]     at Domain.emit (node:events:513:28)
[00:20:51]     at Domain.emit (node:domain:489:12)
[00:20:51]     at Stream.emit (node:domain:540:12)
[00:20:51]     at Stream.onerror (node:internal/streams/legacy:62:12)
[00:20:51] error Command failed with exit code 1.
[00:20:51] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[00:20:51] *** Error code 1
[00:20:51]
[00:20:51] Stop.
[00:20:51] make: stopped in /usr/ports/editors/vscode
[00:20:56] =>> Cleaning up wrkdir
[00:20:56] ===>  Cleaning for vscode-1.70.2_3
[00:21:24] build of editors/vscode | vscode-1.70.2_3 ended at Fri Dec 30 17:14:10 CET 2022
[00:21:24] build time: 00:21:24
[00:21:24] !!! build failure encountered !!!
```
In sysctl.conf i have

```
kern.maxfiles=2593340
kern.maxfilesperproc=2333970
```


----------



## mer (Dec 30, 2022)

man ulimit
take a look at /etc/login.conf too


----------



## Alain De Vos (Dec 30, 2022)

Thanks but neither helped. In login.conf i have unlimited ...


----------



## mer (Dec 30, 2022)

As whatever user is building, does "ulimit" also say "unlimited"?


----------



## cracauer@ (Dec 30, 2022)

What is `ulimit -a` saying?


----------



## Alain De Vos (Dec 30, 2022)

On my system:

```
HOST:root: /root #ulimit -n
2333970
HOST:root: /root #ulimit -c
unlimited
HOST:root: /root #ulimit -u
12142
```


----------



## Alain De Vos (Dec 30, 2022)

ulimit -a

```
-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          33554432
-s: stack size (kbytes)             524288
-c: core file size (blocks)         unlimited
-m: resident set size (kbytes)      unlimited
-l: locked-in-memory size (kbytes)  unlimited
-u: processes                       12142
-n: file descriptors                2333970
-b: socket buffer size (bytes)      unlimited
-v: virtual memory size (kbytes)    unlimited
-p: pseudo-terminals                unlimited
-w: swap size (kbytes)              unlimited
-k: kqueues                         unlimited
-o: umtx shared locks               unlimited
```


----------



## Alain De Vos (Dec 30, 2022)

Aha i Found this,





						Makefile « vscode « editors - ports - FreeBSD ports tree
					






					cgit.freebsd.org
				



Tomorrow i know if this worked.


----------



## mer (Dec 30, 2022)

Ahh I forgot you were using poudrie to build things.  That makes sense


----------

