Skip to content

Commit

Permalink
Update to VS Code 1.82.2 (#6436)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
code-asher committed Sep 20, 2023
1 parent 2e29c23 commit 70d0c60
Show file tree
Hide file tree
Showing 31 changed files with 216 additions and 139 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ jobs:
files: |
docs/**
- name: Install Node.js v16
- name: Install Node.js v18
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
cache: "yarn"

- name: Install doctoc
Expand Down Expand Up @@ -115,11 +115,11 @@ jobs:
files_ignore: |
lib/vscode/**
- name: Install Node.js v16
- name: Install Node.js v18
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Fetch dependencies from cache
if: steps.changed-files.outputs.any_changed == 'true'
Expand Down Expand Up @@ -170,11 +170,11 @@ jobs:
files_ignore: |
lib/vscode/**
- name: Install Node.js v16
- name: Install Node.js v18
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Fetch dependencies from cache
if: steps.changed-files.outputs.any_changed == 'true'
Expand Down Expand Up @@ -212,6 +212,9 @@ jobs:
with:
submodules: true

- name: Install system dependencies
run: sudo apt update && sudo apt install -y libkrb5-dev

- name: Install quilt
uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -221,10 +224,10 @@ jobs:
- name: Patch Code
run: quilt push -a

- name: Install Node.js v16
- name: Install Node.js v18
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Fetch dependencies from cache
id: cache-node-modules
Expand Down Expand Up @@ -292,10 +295,13 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Install Node.js v16
- name: Install system dependencies
run: sudo apt update && sudo apt install -y libkrb5-dev

- name: Install Node.js v18
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Fetch dependencies from cache
id: cache-node-modules
Expand Down Expand Up @@ -348,10 +354,13 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Install Node.js v16
- name: Install system dependencies
run: sudo apt update && sudo apt install -y libkrb5-dev

- name: Install Node.js v18
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Fetch dependencies from cache
id: cache-node-modules
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Install Node.js v16
- name: Install Node.js v18
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Install development tools
run: |
yum install -y epel-release centos-release-scl make
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync python3
# for keytar
yum install -y libsecret-devel
# for kerberos
yum install -y krb5-devel
- name: Install nfpm and envsubst
run: |
Expand Down Expand Up @@ -140,25 +142,25 @@ jobs:
CXX: ${{ format('{0}-g++', matrix.prefix) }}
LINK: ${{ format('{0}-g++', matrix.prefix) }}
NPM_CONFIG_ARCH: ${{ matrix.arch }}
NODE_VERSION: v16.13.0
NODE_VERSION: v18.15.0

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Install Node.js v16
- name: Install Node.js v18
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Install nfpm
run: |
mkdir -p ~/.local/bin
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
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install cross-compiler
run: sudo apt update && sudo apt install $PACKAGE
- name: Install cross-compiler and system dependencies
run: sudo apt update && sudo apt install -y $PACKAGE libkrb5-dev
env:
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}

Expand Down Expand Up @@ -208,10 +210,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Install Node.js v16
- name: Install Node.js v18
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Install nfpm
run: |
Expand Down Expand Up @@ -305,7 +307,7 @@ jobs:
npm version --prefix release "$VERSION"
echo "Updating version in lib/vscode/product.json"
tmp=$(mktemp)
tmp=$(mktemp)
jq ".codeServerVersion = \"$VERSION\"" release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json
# Ensure it has the same permissions as before
chmod 644 release/lib/vscode/product.json
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
with:
fetch-depth: 0

- name: Install Node.js v16
- name: Install Node.js v18
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Fetch dependencies from cache
id: cache-yarn
Expand Down
4 changes: 2 additions & 2 deletions ci/build/npm-postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ main() {
echo "USE AT YOUR OWN RISK!"
fi

if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-16}" ]; then
echo "ERROR: code-server currently requires node v16."
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-18}" ]; then
echo "ERROR: code-server currently requires node v18."
if [ -n "$FORCE_NODE_VERSION" ]; then
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
fi
Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ for [VS
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
Here is what is needed:

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

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

These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for more information.
Expand Down
6 changes: 3 additions & 3 deletions docs/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
```

6. Exit the terminal using `exit` and then reopen the terminal
7. Install and use Node.js 16:
7. Install and use Node.js 18:

```shell
nvm install 16
nvm use 16
nvm install 18
nvm use 18
```

8. Install code-server globally on device with: `npm install --global code-server --unsafe-perm`
Expand Down
4 changes: 2 additions & 2 deletions docs/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ includes installing instructions based on your operating system.
## Node.js version

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

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

```sh
pkg install -y git python npm-node16 pkgconf
pkg install -y git python npm-node18 pkgconf
pkg install -y libinotify
```

Expand Down
2 changes: 1 addition & 1 deletion docs/termux.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ npm config set python python3
node -v
```

you will get node version `v16.15.0`
you will get Node version `v18`

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

Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system};
nodejs = pkgs.nodejs-16_x;
nodejs = pkgs.nodejs-18_x;
yarn' = pkgs.yarn.override { inherit nodejs; };
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nodejs yarn' python3 pkg-config git rsync jq moreutils quilt bats
];
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret libkrb5 ]
++ (with xorg; [ libX11 libxkbfile ])
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
AppKit Cocoa CoreServices Security xcbuild
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ install_npm() {
return
fi
echoerr "Please install npm to install code-server!"
echoerr "You will need at least node v12 and a few C dependencies."
echoerr "You will need at least node v18 and a few C dependencies."
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"

exit 1
Expand Down
2 changes: 1 addition & 1 deletion lib/vscode
Submodule vscode updated 1656 files
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@types/express": "^4.17.8",
"@types/http-proxy": "^1.17.4",
"@types/js-yaml": "^4.0.0",
"@types/node": "^16.0.0",
"@types/node": "^18.0.0",
"@types/pem": "^1.9.5",
"@types/proxy-from-env": "^1.0.1",
"@types/safe-compare": "^1.1.0",
Expand Down Expand Up @@ -82,7 +82,7 @@
"nanoid": "^3.1.31",
"minimist": "npm:minimist-lite@2.2.1",
"glob-parent": "^6.0.1",
"@types/node": "^16.0.0",
"@types/node": "^18.0.0",
"qs": "^6.7.3"
},
"dependencies": {
Expand Down Expand Up @@ -120,7 +120,7 @@
"remote-development"
],
"engines": {
"node": "16"
"node": "18"
},
"jest": {
"transform": {
Expand Down
32 changes: 17 additions & 15 deletions patches/base-path.diff
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -268,16 +268,15 @@ export class WebClientServer {
@@ -269,16 +269,15 @@ export class WebClientServer {
return void res.end();
}

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

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

if (useTestResolver) {
@@ -366,7 +371,7 @@ export class WebClientServer {
@@ -367,7 +372,7 @@ export class WebClientServer {
'default-src \'self\';',
'img-src \'self\' https: data: blob:;',
'media-src \'self\';',
Expand All @@ -168,7 +168,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
'child-src \'self\';',
`frame-src 'self' https://*.vscode-cdn.net data:;`,
'worker-src \'self\' data: blob:;',
@@ -439,3 +444,70 @@ export class WebClientServer {
@@ -440,3 +445,70 @@ export class WebClientServer {
return void res.end(data);
}
}
Expand Down Expand Up @@ -255,23 +255,25 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
@@ -484,6 +484,7 @@ function doCreateUri(path: string, query
});
}
@@ -304,7 +304,8 @@ class LocalStorageURLCallbackProvider ex
this.startListening();
}

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

@@ -495,7 +496,7 @@ function doCreateUri(path: string, query
private startListening(): void {
@@ -569,7 +570,7 @@ function readCookie(name: string): strin
if (!configElement || !configElementAttribute) {
throw new Error('Missing web configuration element');
}
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }

// Create workbench
create(document.body, {
const secretStorageKeyPath = readCookie('vscode-secret-key-path');
const secretStorageCrypto = secretStorageKeyPath && ServerKeyedAESCrypto.supported()
? new ServerKeyedAESCrypto(secretStorageKeyPath) : new TransparentCrypto();
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
Expand Down
Loading

0 comments on commit 70d0c60

Please sign in to comment.