Recent WebPositive is stable enough to open the https://vscode.dev (Visual Studio Code for Web). And I found a reasonable way to run vscode-server(or -web) on Haiku.
So I made a custom HaikuLauncher (a.k.a MiniBrowser of HaikuWebKit) build. Combining them is CodePositive. The PoC project of viable VScode like option on Haiku.
It needs some hacks to run, and we need to improve nodejs of Haiku, and some tweks vscode-server part. But it shows some possibility we can get in future.
I don’t work on this much anymore now, as I should focus on porting firefox. But for other people can work on Web frontend or nodejs internals, is this project is interested in?
Native part repo:
- GitHub - kenz-gelsoft/codepositive
- you can build with
cmake . && make
- you need some packages
haikuwebkit_devel
and some essential build dependencies.
- you can build with
VScodium instruction:
- Get minimal VScodium reh-web release
- node webapp part is common for all platforms, so we can choose minimal build
- c.f. https://github.com/VSCodium/vscodium/releases/download/1.94.2.24286/vscodium-reh-web-linux-armhf-1.94.2.24286.tar.gz
- extract and run following commandline
~/Desktop/code+> rm node ~/Desktop/code+> ls bin extensions node_modules out package.json product.json resources ~/Desktop/code+> node out/server-main.js
- We need rm
node
binry in the release, as it’s non-Haiku executable or node script finds that unintentionally and fails.
- We need rm
- find URL for the browser, like
http://localhost:8000?tkn=34af3198-554f-4454-aef4-ae1d6b350711
Server bound to 127.0.0.1:8000 (IPv4) Extension host agent listening on 8000 [05:51:14] Error: Not an executable at Module._extensions..node (node:internal/modules/cjs/loader:1454:18) at Module.load (node:internal/modules/cjs/loader:1208:32) at Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at bindings (/boot/home/Desktop/code+/node_modules/bindings/bindings.js:112:48) at Object.<anonymous> (/boot/home/Desktop/code+/node_modules/@vscode/spdlog/index.js:3:35) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Module.load (node:internal/modules/cjs/loader:1208:32) at Module._load (node:internal/modules/cjs/loader:1024:12) at cjsLoader (node:internal/modules/esm/translators:348:17) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:297:7) at ModuleJob.run (node:internal/modules/esm/module_job:222:25) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async Nk (file:///boot/home/Desktop/code+/out/vs/server/node/server.main.js:70:12830) at async Ok._createSpdLogLogger (file:///boot/home/Desktop/code+/out/vs/server/node/server.main.js:70:13904) { code: 'ERR_DLOPEN_FAILED' } [05:51:14] Error: Unsupported platform at Object.<anonymous> (/boot/home/Desktop/code+/node_modules/@vscode/deviceid/dist/index.js:24:11) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Module.load (node:internal/modules/cjs/loader:1208:32) at Module._load (node:internal/modules/cjs/loader:1024:12) at cjsLoader (node:internal/modules/esm/translators:348:17) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:297:7) at ModuleJob.run (node:internal/modules/esm/module_job:222:25) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async T3 (file:///boot/home/Desktop/code+/out/vs/server/node/server.main.js:70:58554) at async Promise.all (index 4) at async mD (file:///boot/home/Desktop/code+/out/vs/server/node/server.main.js:185:418) at async CD (file:///boot/home/Desktop/code+/out/vs/server/node/server.main.js:189:7437) at async file:///boot/home/Desktop/code+/out/server-main.js:16:5305 at async Server.<anonymous> (file:///boot/home/Desktop/code+/out/server-main.js:25:81) Web UI available at http://localhost:8000?tkn=34af3198-554f-4454-aef4-ae1d6b350711 [05:51:14] Extension host agent started. [05:51:14] [File Watcher (node.js)] Failed to watch /boot/home/.vscodium-server/data/Machine for changes using fs.watch() (Error: ENOSYS: function not implemented, watch '/boot/home/.vscodium-server/data/Machine') [05:51:14] [File Watcher (node.js)] Failed to watch /boot/home/.vscodium-server/extensions for changes using fs.watch() (Error: ENOSYS: function not implemented, watch '/boot/home/.vscodium-server/extensions') [05:51:14] [File Watcher (node.js)] Failed to watch /boot/home/.vscodium-server/extensions/extensions.json for changes using fs.watch() (Error: ENOSYS: function not implemented, watch '/boot/home/.vscodium-server/extensions/extensions.json')
Launch the CodePositive:
- Without opening folder, you pass above URL with token
./CodePositive http://localhost:8000?tkn=34af3198-554f-4454-aef4-ae1d6b350711
- With opening folder you should open like this
./CodePositive http://localhost:8000?folder=/boot/home/src/codepositive&tkn=34af3198-554f-4454-aef4-ae1d6b350711
- Opening folder in CodePositive or some other operations result in freeze
Some TODOs:
- Port some platform specific parts of node webapp to Haiku
- VScode codebase supports ONLY support win32, mac, linux (even freebsd aren’t here), freebsd guy replaces “linux” string to “freebsd”, it may work on Haiku too.
- Native app should run nodejs and connect automatically
- app can spawn child process and get token URL from pipe, so above token passing step can be automated.
- Bug fixes