Skip to content

Commit 70d0c60

Browse files
authored
Update to VS Code 1.82.2 (#6436)
* Update VS Code to 1.82.2 * Add new libkrb5 dependency * Update patches The only changes were to context except: - The URL callback provider uses a new _callbackRoute argument and moved locations. - The telemetry provider gets passed the request service as the first argument now. - CSP hash changed, as usual. * Update Node to v18 * Revert back to es2020 es2022 is breaking Safari.
1 parent 2e29c23 commit 70d0c60

31 files changed

+216
-139
lines changed

.github/workflows/build.yaml

+21-12
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ jobs:
5050
files: |
5151
docs/**
5252
53-
- name: Install Node.js v16
53+
- name: Install Node.js v18
5454
if: steps.changed-files.outputs.any_changed == 'true'
5555
uses: actions/setup-node@v3
5656
with:
57-
node-version: "16"
57+
node-version: "18"
5858
cache: "yarn"
5959

6060
- name: Install doctoc
@@ -115,11 +115,11 @@ jobs:
115115
files_ignore: |
116116
lib/vscode/**
117117
118-
- name: Install Node.js v16
118+
- name: Install Node.js v18
119119
if: steps.changed-files.outputs.any_changed == 'true'
120120
uses: actions/setup-node@v3
121121
with:
122-
node-version: "16"
122+
node-version: "18"
123123

124124
- name: Fetch dependencies from cache
125125
if: steps.changed-files.outputs.any_changed == 'true'
@@ -170,11 +170,11 @@ jobs:
170170
files_ignore: |
171171
lib/vscode/**
172172
173-
- name: Install Node.js v16
173+
- name: Install Node.js v18
174174
if: steps.changed-files.outputs.any_changed == 'true'
175175
uses: actions/setup-node@v3
176176
with:
177-
node-version: "16"
177+
node-version: "18"
178178

179179
- name: Fetch dependencies from cache
180180
if: steps.changed-files.outputs.any_changed == 'true'
@@ -212,6 +212,9 @@ jobs:
212212
with:
213213
submodules: true
214214

215+
- name: Install system dependencies
216+
run: sudo apt update && sudo apt install -y libkrb5-dev
217+
215218
- name: Install quilt
216219
uses: awalsh128/cache-apt-pkgs-action@latest
217220
with:
@@ -221,10 +224,10 @@ jobs:
221224
- name: Patch Code
222225
run: quilt push -a
223226

224-
- name: Install Node.js v16
227+
- name: Install Node.js v18
225228
uses: actions/setup-node@v3
226229
with:
227-
node-version: "16"
230+
node-version: "18"
228231

229232
- name: Fetch dependencies from cache
230233
id: cache-node-modules
@@ -292,10 +295,13 @@ jobs:
292295
- name: Checkout repo
293296
uses: actions/checkout@v3
294297

295-
- name: Install Node.js v16
298+
- name: Install system dependencies
299+
run: sudo apt update && sudo apt install -y libkrb5-dev
300+
301+
- name: Install Node.js v18
296302
uses: actions/setup-node@v3
297303
with:
298-
node-version: "16"
304+
node-version: "18"
299305

300306
- name: Fetch dependencies from cache
301307
id: cache-node-modules
@@ -348,10 +354,13 @@ jobs:
348354
- name: Checkout repo
349355
uses: actions/checkout@v3
350356

351-
- name: Install Node.js v16
357+
- name: Install system dependencies
358+
run: sudo apt update && sudo apt install -y libkrb5-dev
359+
360+
- name: Install Node.js v18
352361
uses: actions/setup-node@v3
353362
with:
354-
node-version: "16"
363+
node-version: "18"
355364

356365
- name: Fetch dependencies from cache
357366
id: cache-node-modules

.github/workflows/release.yaml

+12-10
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@ jobs:
3535
- name: Checkout repo
3636
uses: actions/checkout@v3
3737

38-
- name: Install Node.js v16
38+
- name: Install Node.js v18
3939
uses: actions/setup-node@v3
4040
with:
41-
node-version: "16"
41+
node-version: "18"
4242

4343
- name: Install development tools
4444
run: |
4545
yum install -y epel-release centos-release-scl make
4646
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync python3
4747
# for keytar
4848
yum install -y libsecret-devel
49+
# for kerberos
50+
yum install -y krb5-devel
4951
5052
- name: Install nfpm and envsubst
5153
run: |
@@ -140,25 +142,25 @@ jobs:
140142
CXX: ${{ format('{0}-g++', matrix.prefix) }}
141143
LINK: ${{ format('{0}-g++', matrix.prefix) }}
142144
NPM_CONFIG_ARCH: ${{ matrix.arch }}
143-
NODE_VERSION: v16.13.0
145+
NODE_VERSION: v18.15.0
144146

145147
steps:
146148
- name: Checkout repo
147149
uses: actions/checkout@v3
148150

149-
- name: Install Node.js v16
151+
- name: Install Node.js v18
150152
uses: actions/setup-node@v3
151153
with:
152-
node-version: "16"
154+
node-version: "18"
153155

154156
- name: Install nfpm
155157
run: |
156158
mkdir -p ~/.local/bin
157159
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
158160
echo "$HOME/.local/bin" >> $GITHUB_PATH
159161
160-
- name: Install cross-compiler
161-
run: sudo apt update && sudo apt install $PACKAGE
162+
- name: Install cross-compiler and system dependencies
163+
run: sudo apt update && sudo apt install -y $PACKAGE libkrb5-dev
162164
env:
163165
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
164166

@@ -208,10 +210,10 @@ jobs:
208210
- name: Checkout repo
209211
uses: actions/checkout@v3
210212

211-
- name: Install Node.js v16
213+
- name: Install Node.js v18
212214
uses: actions/setup-node@v3
213215
with:
214-
node-version: "16"
216+
node-version: "18"
215217

216218
- name: Install nfpm
217219
run: |
@@ -305,7 +307,7 @@ jobs:
305307
npm version --prefix release "$VERSION"
306308
307309
echo "Updating version in lib/vscode/product.json"
308-
tmp=$(mktemp)
310+
tmp=$(mktemp)
309311
jq ".codeServerVersion = \"$VERSION\"" release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json
310312
# Ensure it has the same permissions as before
311313
chmod 644 release/lib/vscode/product.json

.github/workflows/security.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929
with:
3030
fetch-depth: 0
3131

32-
- name: Install Node.js v16
32+
- name: Install Node.js v18
3333
uses: actions/setup-node@v3
3434
with:
35-
node-version: "16"
35+
node-version: "18"
3636

3737
- name: Fetch dependencies from cache
3838
id: cache-yarn

ci/build/npm-postinstall.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ main() {
6868
echo "USE AT YOUR OWN RISK!"
6969
fi
7070

71-
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-16}" ]; then
72-
echo "ERROR: code-server currently requires node v16."
71+
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-18}" ]; then
72+
echo "ERROR: code-server currently requires node v18."
7373
if [ -n "$FORCE_NODE_VERSION" ]; then
7474
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
7575
fi

docs/CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ for [VS
3737
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
3838
Here is what is needed:
3939

40-
- `node` v16.x
40+
- `node` v18.x
4141
- `git` v2.x or greater
4242
- [`git-lfs`](https://git-lfs.github.com)
4343
- [`yarn`](https://classic.yarnpkg.com/en/)
@@ -63,7 +63,7 @@ Here is what is needed:
6363
If you're developing code-server on Linux, make sure you have installed or install the following dependencies:
6464

6565
```shell
66-
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev python-is-python3
66+
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev libkrb5-dev python-is-python3
6767
```
6868

6969
These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for more information.

docs/android.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
1111
```
1212

1313
6. Exit the terminal using `exit` and then reopen the terminal
14-
7. Install and use Node.js 16:
14+
7. Install and use Node.js 18:
1515

1616
```shell
17-
nvm install 16
18-
nvm use 16
17+
nvm install 18
18+
nvm use 18
1919
```
2020

2121
8. Install code-server globally on device with: `npm install --global code-server --unsafe-perm`

docs/npm.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ includes installing instructions based on your operating system.
3030
## Node.js version
3131

3232
We use the same major version of Node.js shipped with Code's remote, which is
33-
currently `16.x`. VS Code also [lists Node.js
33+
currently `18.x`. VS Code also [lists Node.js
3434
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
3535

3636
Using other versions of Node.js [may lead to unexpected
@@ -79,7 +79,7 @@ Proceed to [installing](#installing)
7979
## FreeBSD
8080

8181
```sh
82-
pkg install -y git python npm-node16 pkgconf
82+
pkg install -y git python npm-node18 pkgconf
8383
pkg install -y libinotify
8484
```
8585

docs/termux.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ npm config set python python3
5656
node -v
5757
```
5858

59-
you will get node version `v16.15.0`
59+
you will get Node version `v18`
6060

6161
5. Now install code-server following our guide on [installing with npm](./npm.md)
6262

flake.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
flake-utils.lib.eachDefaultSystem
88
(system:
99
let pkgs = nixpkgs.legacyPackages.${system};
10-
nodejs = pkgs.nodejs-16_x;
10+
nodejs = pkgs.nodejs-18_x;
1111
yarn' = pkgs.yarn.override { inherit nodejs; };
1212
in {
1313
devShells.default = pkgs.mkShell {
1414
nativeBuildInputs = with pkgs; [
1515
nodejs yarn' python3 pkg-config git rsync jq moreutils quilt bats
1616
];
17-
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
17+
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret libkrb5 ]
1818
++ (with xorg; [ libX11 libxkbfile ])
1919
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
2020
AppKit Cocoa CoreServices Security xcbuild

install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ install_npm() {
441441
return
442442
fi
443443
echoerr "Please install npm to install code-server!"
444-
echoerr "You will need at least node v12 and a few C dependencies."
444+
echoerr "You will need at least node v18 and a few C dependencies."
445445
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"
446446

447447
exit 1

lib/vscode

Submodule vscode updated 1656 files

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@types/express": "^4.17.8",
4545
"@types/http-proxy": "^1.17.4",
4646
"@types/js-yaml": "^4.0.0",
47-
"@types/node": "^16.0.0",
47+
"@types/node": "^18.0.0",
4848
"@types/pem": "^1.9.5",
4949
"@types/proxy-from-env": "^1.0.1",
5050
"@types/safe-compare": "^1.1.0",
@@ -82,7 +82,7 @@
8282
"nanoid": "^3.1.31",
8383
"minimist": "npm:minimist-lite@2.2.1",
8484
"glob-parent": "^6.0.1",
85-
"@types/node": "^16.0.0",
85+
"@types/node": "^18.0.0",
8686
"qs": "^6.7.3"
8787
},
8888
"dependencies": {
@@ -120,7 +120,7 @@
120120
"remote-development"
121121
],
122122
"engines": {
123-
"node": "16"
123+
"node": "18"
124124
},
125125
"jest": {
126126
"transform": {

patches/base-path.diff

+17-15
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
111111
===================================================================
112112
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
113113
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
114-
@@ -268,16 +268,15 @@ export class WebClientServer {
114+
@@ -269,16 +269,15 @@ export class WebClientServer {
115115
return void res.end();
116116
}
117117

@@ -133,7 +133,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
133133
);
134134
if (!remoteAuthority) {
135135
return serveError(req, res, 400, `Bad request.`);
136-
@@ -304,8 +303,12 @@ export class WebClientServer {
136+
@@ -305,8 +304,12 @@ export class WebClientServer {
137137
scopes: [['user:email'], ['repo']]
138138
} : undefined;
139139

@@ -146,7 +146,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
146146
embedderIdentifier: 'server-distro',
147147
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
148148
...this._productService.extensionsGallery,
149-
@@ -340,8 +343,10 @@ export class WebClientServer {
149+
@@ -341,8 +344,10 @@ export class WebClientServer {
150150
const values: { [key: string]: string } = {
151151
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
152152
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
@@ -159,7 +159,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
159159
};
160160

161161
if (useTestResolver) {
162-
@@ -366,7 +371,7 @@ export class WebClientServer {
162+
@@ -367,7 +372,7 @@ export class WebClientServer {
163163
'default-src \'self\';',
164164
'img-src \'self\' https: data: blob:;',
165165
'media-src \'self\';',
@@ -168,7 +168,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
168168
'child-src \'self\';',
169169
`frame-src 'self' https://*.vscode-cdn.net data:;`,
170170
'worker-src \'self\' data: blob:;',
171-
@@ -439,3 +444,70 @@ export class WebClientServer {
171+
@@ -440,3 +445,70 @@ export class WebClientServer {
172172
return void res.end(data);
173173
}
174174
}
@@ -255,23 +255,25 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
255255
===================================================================
256256
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
257257
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
258-
@@ -484,6 +484,7 @@ function doCreateUri(path: string, query
259-
});
260-
}
258+
@@ -304,7 +304,8 @@ class LocalStorageURLCallbackProvider ex
259+
this.startListening();
260+
}
261261

262-
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
263-
return URI.parse(window.location.href).with({ path, query });
264-
}
262+
- return URI.parse(window.location.href).with({ path: this._callbackRoute, query: queryParams.join('&') });
263+
+ const path = (window.location.pathname + "/" + this._callbackRoute).replace(/\/\/+/g, "/");
264+
+ return URI.parse(window.location.href).with({ path: path, query: queryParams.join('&') });
265+
}
265266

266-
@@ -495,7 +496,7 @@ function doCreateUri(path: string, query
267+
private startListening(): void {
268+
@@ -569,7 +570,7 @@ function readCookie(name: string): strin
267269
if (!configElement || !configElementAttribute) {
268270
throw new Error('Missing web configuration element');
269271
}
270272
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
271273
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
272-
273-
// Create workbench
274-
create(document.body, {
274+
const secretStorageKeyPath = readCookie('vscode-secret-key-path');
275+
const secretStorageCrypto = secretStorageKeyPath && ServerKeyedAESCrypto.supported()
276+
? new ServerKeyedAESCrypto(secretStorageKeyPath) : new TransparentCrypto();
275277
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
276278
===================================================================
277279
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts

0 commit comments

Comments
 (0)