-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add vscode via vendor package. #4135
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
Conversation
✨ Coder.com for PR #4135 deployed! It will be updated on every commit.
|
39c8ad1
to
8c7b2b7
Compare
Happy we're doing this. Those npm changes upstream were not fun to debug so glad we can avoid that. |
8c7b2b7
to
9d8bec1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome 🎉
Seems like it's mostly location changes (I'm not seeing a ton of changes related to VS Code itself).
The biggest question for me is what's the explanation behind vendor/modules
? Is this a yarn naming convention or our own? And it doesn't have to happen here, but it would be nice for us to document how VS Code exists in code-server. i.e. how yarn
plays into the story and how this all works (for instance is this still considered a git submodule).
(I wish we would have done this when we switched to a git subtree so that the reasoning behind the change + how it works would have been documented).
This could come in a followup PR as a docs addition though.
Codecov Report
@@ Coverage Diff @@
## main #4135 +/- ##
=======================================
Coverage 64.22% 64.22%
=======================================
Files 36 36
Lines 1873 1873
Branches 379 379
=======================================
Hits 1203 1203
Misses 569 569
Partials 101 101
Continue to review full report at Codecov.
|
Seems to be running just fine locally! I do see this error but guessing extension related (not your changes): Weird...a reload of code-server fixes it 🤷♂️ Search for files and the terminal aren't working :( I tried Screen.Recording.2021-09-10.at.11.23.59.AM.movWhat am I missing? Do I need to manually delete node-modules? |
Yeah I tried deleting
I see the docs say this but I'm not sure how to check that |
Oh no...I think I broke something. So I ran yarn run v1.22.10
$ VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts
[tsc] [11:59:26 AM] Starting compilation in watch mode...
[vscode] $ npm-run-all -lp watch-client watch-extensions
/bin/sh: npm-run-all: command not found
error Command failed with exit code 127.
[vscode] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
vs code watcher terminated unexpectedly
killing vs code watcher
killing tsc
killing watch
error Command failed with exit code 127. I'm wondering if I should not use |
I recommend doing cd vendor/modules/code-oss-dev
npm rebuild From there, |
Oh man... argh, i'm getting this error now saying I need to use
Gonna try running Nope, that didn't work either. Node/yarn/VS Code why are you making my life so hard 😢 |
I'm using Node v14.17.0 if that helps. I wish I knew how to check which Node version corresponded to version 83 vs 89 |
I'm going to delete the code-server repo, reclone and try again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not looked at the fork at all but the changes here look great! Everything seems to run as expected.
Nice work!
run: yarn --frozen-lockfile | ||
|
||
- name: Build code-server | ||
run: yarn build | ||
|
||
# Parse the hash of the latest commit inside lib/vscode | ||
# Parse the hash of the latest commit inside vendor/modules/code-oss-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on keeping it in lib
? (So lib/modules
). Reason being we download other dependencies there (link agent and Node).
ci/lib.sh
Outdated
# exist in node_modules so just symlink it. We have to do this since not only VS | ||
# Code itself but also extensions will look specifically in this directory for | ||
# files (like the ripgrep binary or the oniguruma wasm). | ||
symlink_asar() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We likely need to keep these symlinks. When I built a release there was no vendor/modules/code-oss-dev/node_modules.asar
directory which some extensions rely on.
To reproduce, install the Bracket Pair Colorizer 2 extension. You will see an error in the browser console and the brackets will not be colored.
I think VS Code does something where they duplicate some modules into this directory so maybe eventually we can use their build process instead although it seems like a waste of space. 👨🚀
With regards to the Node module version errors, that might be because the |
Okay I downgraded to v14.15.2 then did How I figured out Node 83?
P.S. @TeffenEllis |
Video✅ Besides Asher's requested changes, everything looks good on my side Screen.Recording.2021-09-10.at.4.01.59.PM.mov |
I thought I disabled this in a previous PR but apparently I didn't 😅 Here is PR to fix that. Feel free to rebase after that gets merged in. |
b33cdf8
to
afb1419
Compare
- Use yarn for vscode vendoring. - Grab hash from package.
afb1419
to
b9d79dc
Compare
f66a71e
to
d366690
Compare
d366690
to
d4dafd8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo!!!
While #4010 resolves some incompatibilities with 1.60.0, it's still in review and needs additional testing. This PR updates
lib/vscode
to use a yarn package pointing to our VS Code fork. Once this is merged, any remaining fork clean up branches will be ported over to the vendored .Fixes #3917
Notable changes from upstream
Our changes
How to review this PR
This is a somewhat unusual PR since we don’t yet have a diff to start with, however, I’ve made a branch on our fork with the previous changes form
lib/vscode
. This allows you compare all the changes from upstream, as well as the adjustments to our code to fix them in 1.60.0coder/vscode@1.57.1-initial...cdr:code-server
Follow up
#4136 can be merged after this. They are only separated to make reviewing the changes easier to follow.