Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package request: openvscode-server #140344

Closed
colemickens opened this issue Oct 3, 2021 · 14 comments · Fixed by #145012
Closed

package request: openvscode-server #140344

colemickens opened this issue Oct 3, 2021 · 14 comments · Fixed by #145012

Comments

@colemickens
Copy link
Member

Project description

It's like code-server but closer to upstream, as I understand it.

Maybe this can be packaged similarly to how code-server is packaged?

shamelessly ccing past code-server contributors: @offlinehacker @dguenther (hi!) and maybe @ghuntley would be interested, or maybe has a nix derivation already?

Metadata

@ghuntley
Copy link
Member

ghuntley commented Oct 3, 2021

👋 from Gitpod. I am pretty close to finishing packaging this. Happy to open a WIP and get the help of others to finish up.

evanw/esbuild#1621 was causing me grief but is now fixed.

@dguenther
Copy link
Member

Oh cool, this would be great to have packaged! Feel free to cc me if you run into any sticking points, I'd be glad to take a look.

@ghuntley
Copy link
Member

Hey folks (@dguenther @offlinehacker @colemickens ) can I get your help with getting this over the line?

ghuntley@3c56a42

Problems experienced:

  • esbuild continues to attempt downloading linux binaries during the compilation phase in a pure environment

@dguenther
Copy link
Member

Sure, let me try to find some time to poke around at it this week. My guess is that inserting the binary using ESBUILD_BINARY_PATH will be the way to go, and it might be easier/more reliable to compile esbuild in the derivation rather than trying to install a prebuild in one of the earlier phases and copy it through.

@ghuntley
Copy link
Member

ghuntley commented Oct 21, 2021

I hope so; what I experienced was esbuild attempting to pull binaries from the internet during the build phase. Wasn’t aware of ESBUILD_BINARY_PARTH. I tried to mitigate via bumping esbuild version (thus explaining why using my fork)

@dguenther
Copy link
Member

Made some progress -- There are two separate versions of esbuild in the project, one in the root and one in extensions. postinstall runs a script that executes yarn install in a few other directories, which then triggers another postinstall that attempts to download esbuild.

I think you were on the right track with adding --ignore-scripts to that postinstall script, but it seemed a bit tricky to replace via substitution. We could probably patch it instead, but I ended up just reimplementing the postinstall script with find and building the necessary esbuild versions within the derivation.

It got further along in the build, but I think it's looking for the node sources now:

[05:07:58] 'node' errored after 20 s
[05:07:58] Error: getaddrinfo ENOTFOUND nodejs.org
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:26)
    at GetAddrInfoReqWrap.callbackTrampoline (internal/async_hooks.js:131:17)
error Command failed with exit code 1.

    at checkExecSyncError (child_process.js:760:11)
    at Object.execSync (child_process.js:833:15)
    at /build/source/build/gulpfile.server.js:274:7
    at /build/source/build/lib/task.js:45:28
    at new Promise (<anonymous>)
    at _doExecute (/build/source/build/lib/task.js:34:12)
    at _execute (/build/source/build/lib/task.js:25:11)
    at package-server-server-min (/build/source/build/lib/task.js:64:19)
    at async _execute (/build/source/build/lib/task.js:25:5)
    at async Promise.all (index 1)
    at async result (/build/source/build/lib/task.js:73:9)
    at async _execute (/build/source/build/lib/task.js:25:5)
    at async package-server-min (/build/source/build/lib/task.js:64:13)
    at async _execute (/build/source/build/lib/task.js:25:5)
    at async result (/build/source/build/lib/task.js:64:13)
    at async _execute (/build/source/build/lib/task.js:25:5)
error Command failed with exit code 1.

I'll have some more time this weekend to make progress on it, but here's my WIP branch: https://github.com/NixOS/nixpkgs/compare/master...dguenther:openvscode-server?expand=1

@dguenther
Copy link
Member

@ghuntley I have a working version pushed up on the branch I linked in my previous comment. I tested it runs on both Darwin and Linux x64, but I haven't extensively QAed it to make sure everything works as expected.

Would you like to take over submitting a PR for it? I can do it if you prefer, but since you got the ball rolling, I wanted to give you the opportunity if you're interested 😄

@colemickens
Copy link
Member Author

I'm back to being curious about this. GitPod is just very precise about mostly having achieved their goal and about trying to be as minimal as possible to enable the in browser experience properly. They have a new blog post: https://www.gitpod.io/blog/vscode-server

@dguenther
Copy link
Member

Sounds good, I'll clean up my branch based on code review I received in #143930 and put up a PR for it tonight.

I haven't done much research into it, but I'm interested to see if MS will publish any of the work they've made in this direction, either on vscode.dev or GitHub CodeSpaces. Neither of them are exactly comparable to code-server/openvscode-server, but it's nice to see a variety of projects making progress in that direction.

@ghuntley
Copy link
Member

ghuntley commented Nov 5, 2021

Some updates on OpenVSCode server!

https://www.gitpod.io/blog/vscode-server

@dguenther
Copy link
Member

I'm interested to see if MS will publish any of the work they've made in this direction, either on vscode.dev or GitHub CodeSpaces.

Oh, I read the above blog post and it looks like they did, that's great! PR for this issue is open ^

@colemickens
Copy link
Member Author

Thanks a bunch @dguenther, this is really cool and powerful to have available via Nix! I'm very curious to see where upstream/openvscode/code-server go, especially in terms of things like Auth. It'd be neat to be able to tell VSCode to take accept auth information passed via headers, or pass it JWS info to validate a JWT header or something. Although if it's remaining single-user, just disabling auth and letting the reverse proxy handle it seems as elegant as anything.

Anyway, thanks again!

@colemickens
Copy link
Member Author

colemickens commented Nov 14, 2021

Also, I just did notice a difference. OpenVSCode server blocked me from installing extensions that Code-Server allowed (or maybe isn't new enough to try and block?). And I don't have an override but there might exist a way?

Are you on the OpenVSCodeServer Discord @dguenther , or are you both @ghuntley maybe on Matrix? We could spin up a room to share notes?

(EDIT: turns out the one extension it did block was the bracket colorizer, but 1) it wasn't working in code-server anyway, and 2) I think there was a blog post and it's going to become built-in)

@dguenther
Copy link
Member

I'm not in either yet, but I'll hop in the OpenVSCodeServer/Gitpod Discord at least! I know at least one improvement that would be nice to make would be adding back the built-in extensions -- I saw there's a vscode-extensions directory in nixpkgs that might work for building the extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants