Skip to content

Commit

Permalink
feat(1.94): update patches and build process (#2047)
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam authored Oct 7, 2024
1 parent 5e4ba54 commit 48cabed
Show file tree
Hide file tree
Showing 17 changed files with 316 additions and 280 deletions.
2 changes: 1 addition & 1 deletion docs/howto-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

## <a id="dependencies"></a>Dependencies

- node 18.15
- node 20.14
- yarn
- jq
- git
Expand Down
8 changes: 8 additions & 0 deletions electron.riscv64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -ex

export ELECTRON_VERSION="30.5.1"
export VSCODE_ELECTRON_TAG="v${ELECTRON_VERSION}.riscv1"

echo "dfae1ccddec728faa7e5dcc92fb38ee7c40251e7f7638817da1c2a94dd37b5c2 *electron-v${ELECTRON_VERSION}-linux-riscv64.zip" >> build/checksums/electron.txt
6 changes: 3 additions & 3 deletions package_alpine_reh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ if [[ -d "../patches/alpine/reh/" ]]; then
fi

for i in {1..5}; do # try 5 times
yarn --frozen-lockfile --check-files && break
npm ci && break
if [[ $i == 3 ]]; then
echo "Yarn failed too many times" >&2
echo "Npm install failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
echo "Npm install failed $i, trying again..."
done

node build/azure-pipelines/distro/mixin-npm
Expand Down
20 changes: 10 additions & 10 deletions package_linux_bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ if [[ "${VSCODE_ARCH}" == "riscv64" ]]; then
export VSCODE_ELECTRON_REPO='riscv-forks/electron-riscv-releases'
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
ELECTRON_VERSION="30.4.0"

source ../electron.riscv64.sh

if [[ "${ELECTRON_VERSION}" != "$(yarn config get target)" ]]; then
# Fail the pipeline if electron target doesn't match what is used.
# Look for releases here if electron version used by vscode changed:
# https://github.com/riscv-forks/electron-riscv-releases/releases
echo "Electron RISC-V binary version doesn't match target electron version!"
exit 1
fi
export VSCODE_ELECTRON_TAG="v${ELECTRON_VERSION}.riscv1"
echo "b391bd6e063c34c31b1048615994fca0a5922d5a6b21d6cee6c4335850791516 *electron-v${ELECTRON_VERSION}-linux-riscv64.zip" >> build/checksums/electron.txt
fi

if [[ -d "../patches/linux/client/" ]]; then
Expand All @@ -51,12 +51,12 @@ if [[ -d "../patches/linux/client/" ]]; then
fi

for i in {1..5}; do # try 5 times
yarn --cwd build --frozen-lockfile --check-files && break
npm ci --prefix build && break
if [[ $i == 3 ]]; then
echo "Yarn failed too many times" >&2
echo "Npm install failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
echo "Npm install failed $i, trying again..."
done

if [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
Expand All @@ -66,12 +66,12 @@ else
fi

for i in {1..5}; do # try 5 times
yarn --check-files && break
if [ $i -eq 3 ]; then
echo "Yarn failed too many times" >&2
npm ci && break
if [[ $i -eq 3 ]]; then
echo "Npm install failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
echo "Npm install failed $i, trying again..."
done

node build/azure-pipelines/distro/mixin-npm
Expand Down
16 changes: 8 additions & 8 deletions package_linux_reh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fi

export VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME

sed -i "/target/s/\"20.*\"/\"${NODE_VERSION}\"/" remote/.yarnrc
sed -i "/target/s/\"20.*\"/\"${NODE_VERSION}\"/" remote/.npmrc

if [[ "${NODE_VERSION}" != 16* ]]; then
if [[ -f "../patches/linux/reh/node16.patch" ]]; then
Expand All @@ -73,12 +73,12 @@ if [[ -d "../patches/linux/reh/" ]]; then
fi

for i in {1..5}; do # try 5 times
yarn --cwd build --frozen-lockfile --check-files && break
npm ci --prefix build && break
if [[ $i == 3 ]]; then
echo "Yarn failed too many times" >&2
echo "Npm install failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
echo "Npm install failed $i, trying again..."
done

if [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
Expand All @@ -88,12 +88,12 @@ else
fi

for i in {1..5}; do # try 5 times
yarn --frozen-lockfile --check-files && break
if [ $i -eq 3 ]; then
echo "Yarn failed too many times" >&2
npm ci && break
if [[ $i == 3 ]]; then
echo "Npm install failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
echo "Npm install failed $i, trying again..."
done

node build/azure-pipelines/distro/mixin-npm
Expand Down
263 changes: 132 additions & 131 deletions patches/brand.patch

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions patches/build-version.patch
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
index 85b9b2e..dc33fbc 100644
index e314794..fce8d15 100644
--- a/build/gulpfile.reh.js
+++ b/build/gulpfile.reh.js
@@ -342,2 +342,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
@@ -343,2 +343,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
const name = product.nameShort;
+ const release = packageJson.release;

@@ -345,3 +346,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
@@ -346,3 +347,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
const packageJsonStream = gulp.src(['remote/package.json'], { base: 'remote' })
- .pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined, ...(isESM(`Setting 'type: module' in top level package.json`) ? { type: 'module' } : {}) })) // TODO@esm this should be configured in the top level package.json
+ .pipe(json({ name, version, release, dependencies: undefined, optionalDependencies: undefined, ...(isESM(`Setting 'type: module' in top level package.json`) ? { type: 'module' } : {}) })) // TODO@esm this should be configured in the top level package.json
- .pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined, ...(!isAMD() ? { type: 'module' } : {}) })) // TODO@esm this should be configured in the top level package.json
+ .pipe(json({ name, version, release, dependencies: undefined, optionalDependencies: undefined, ...(!isAMD() ? { type: 'module' } : {}) })) // TODO@esm this should be configured in the top level package.json
.pipe(es.through(function (file) {
@@ -353,3 +354,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
@@ -354,3 +355,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
const productJsonStream = gulp.src(['product.json'], { base: '.' })
- .pipe(json({ commit, date: readISODate('out-build'), version }))
+ .pipe(json({ commit, date: readISODate('out-build'), version, release }))
.pipe(es.through(function (file) {
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
index 8d15015..dc50d78 100644
index 9dfb6a3..a4277ff 100644
--- a/build/gulpfile.vscode.js
+++ b/build/gulpfile.vscode.js
@@ -320,3 +320,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op

- let version = packageJson.version;
+ let version = packageJson.version
const quality = product.quality;
@@ -333,3 +333,4 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
@@ -328,3 +328,4 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
const name = product.nameShort;
- const packageJsonUpdates = { name, version, ...(isESM(`Setting 'type: module' and 'main: out/main.js' in top level package.json`) ? { type: 'module', main: 'out/main.js' } : {}) }; // TODO@esm this should be configured in the top level package.json
- const packageJsonUpdates = { name, version, ...(!isAMD() ? { type: 'module', main: 'out/main.js' } : {}) }; // TODO@esm this should be configured in the top level package.json
+ const release = packageJson.release;
+ const packageJsonUpdates = { name, version, release, ...(isESM(`Setting 'type: module' and 'main: out/main.js' in top level package.json`) ? { type: 'module', main: 'out/main.js' } : {}) }; // TODO@esm this should be configured in the top level package.json
+ const packageJsonUpdates = { name, version, release, ...(!isAMD() ? { type: 'module', main: 'out/main.js' } : {}) }; // TODO@esm this should be configured in the top level package.json

@@ -350,3 +351,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
@@ -345,3 +346,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
const productJsonStream = gulp.src(['product.json'], { base: '.' })
- .pipe(json({ commit, date: readISODate('out-build'), checksums, version }))
+ .pipe(json({ commit, date: readISODate('out-build'), checksums, version, release }))
.pipe(es.through(function (file) {
diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js
index 7959454..4bceb17 100644
index 5fa5a5d..b08e376 100644
--- a/build/gulpfile.vscode.linux.js
+++ b/build/gulpfile.vscode.linux.js
@@ -27,4 +27,2 @@ const commit = getVersion(root);
Expand All @@ -50,47 +50,47 @@ index 7959454..4bceb17 100644
- .pipe(replace('@@VERSION@@', packageJson.version + '-' + linuxPackageRevision))
+ .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
.pipe(replace('@@ARCHITECTURE@@', debArch))
@@ -203,4 +201,3 @@ function prepareRpmPackage(arch) {
@@ -204,4 +202,3 @@ function prepareRpmPackage(arch) {
.pipe(replace('@@ICON@@', product.linuxIconName))
- .pipe(replace('@@VERSION@@', packageJson.version))
- .pipe(replace('@@RELEASE@@', linuxPackageRevision))
+ .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
@@ -279,3 +276,3 @@ function prepareSnapPackage(arch) {
@@ -281,3 +278,3 @@ function prepareSnapPackage(arch) {
.pipe(replace('@@NAME@@', product.applicationName))
- .pipe(replace('@@VERSION@@', commit.substr(0, 8)))
+ .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
// Possible run-on values https://snapcraft.io/docs/architectures
diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js
index 5adfdfb..d6ddead 100644
index 98175f5..afacbe3 100644
--- a/build/gulpfile.vscode.win32.js
+++ b/build/gulpfile.vscode.win32.js
@@ -90,4 +90,4 @@ function buildWin32Setup(arch, target) {
@@ -89,4 +89,4 @@ function buildWin32Setup(arch, target) {
DirName: product.win32DirName,
- Version: pkg.version,
- RawVersion: pkg.version.replace(/-\w+$/, ''),
+ Version: `${pkg.version}.${pkg.release}`,
+ RawVersion: `${pkg.version.replace(/-\w+$/, '')}.${pkg.release}`,
NameVersion: product.win32NameVersion + (target === 'user' ? ' (User)' : ''),
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
index 022d2e6..1523754 100644
index c397b1a..ccf7911 100644
--- a/src/vs/base/common/product.ts
+++ b/src/vs/base/common/product.ts
@@ -58,2 +58,3 @@ export interface IProductConfiguration {
readonly version: string;
+ readonly release: string;
readonly date?: string;
diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts
index 7e0bc11..1fa5310 100644
index 5f6efd5..da3c54d 100644
--- a/src/vs/platform/diagnostics/node/diagnosticsService.ts
+++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts
@@ -231,3 +231,3 @@ export class DiagnosticsService implements IDiagnosticsService {
@@ -232,3 +232,3 @@ export class DiagnosticsService implements IDiagnosticsService {
const output: string[] = [];
- output.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
+ output.push(`Version: ${this.productService.nameShort} ${this.productService.version} ${this.productService.release || 'Release unknown'} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`);
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
index 58278d9..956cdff 100644
index a98043f..b54a78f 100644
--- a/src/vs/platform/product/common/product.ts
+++ b/src/vs/platform/product/common/product.ts
@@ -43,6 +43,7 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
Expand All @@ -104,12 +104,12 @@ index 58278d9..956cdff 100644
+ release: pkg.release
});
diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
index c064ebc..72a9fa9 100644
index 21f62b6..98edd0e 100644
--- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
+++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
@@ -22,2 +22,3 @@ import { defaultButtonStyles, defaultCheckboxStyles, defaultDialogStyles, defaul
import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver';
+import { getReleaseString } from 'vs/workbench/common/release';
import { ResultKind } from '../../../../platform/keybinding/common/keybindingResolver.js';
+import { getReleaseString } from '../../../../workbench/common/release';

@@ -79,2 +80,4 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
const detailString = (useAgo: boolean): string => {
Expand Down Expand Up @@ -142,13 +142,13 @@ index 0000000..2a8ea57
+ return LABELS[language] ?? DEFAULT_LABEL;
+}
diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
index f2cc82a..700d81a 100644
index 6c61a59..e76a188 100644
--- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
+++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
@@ -14,2 +14,3 @@ import { IProductService } from 'vs/platform/product/common/productService';
import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
+import { getReleaseString } from 'vs/workbench/common/release';
import { getActiveWindow } from 'vs/base/browser/dom';
@@ -15,2 +15,3 @@ import { process } from '../../../../base/parts/sandbox/electron-sandbox/globals
import { getActiveWindow } from '../../../../base/browser/dom.js';
+import { getReleaseString } from '../../../../workbench/common/release';

@@ -80,2 +81,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
const osProps = await this.nativeHostService.getOSProperties();
+ const releaseString = getReleaseString();
Expand Down
22 changes: 11 additions & 11 deletions patches/disable-cloud.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts b/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts
index 00914aa..d5cfc18 100644
index 18b5815..51a5d50 100644
--- a/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts
+++ b/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts
@@ -7,3 +7,3 @@ import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { localize } from 'vs/nls';
-import { Action2, MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions';
+import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions';
import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
@@ -7,3 +7,3 @@ import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.j
import { localize } from '../../../../nls.js';
-import { Action2, MenuId, MenuRegistry, registerAction2 } from '../../../../platform/actions/common/actions.js';
+import { Action2, MenuId, registerAction2 } from '../../../../platform/actions/common/actions.js';
import { ContextKeyExpr, IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
@@ -17,3 +17,3 @@ import { AuthenticationSession, AuthenticationSessionsChangeEvent, IAuthenticati
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
-import { EDIT_SESSIONS_SIGNED_IN, EditSession, EDIT_SESSION_SYNC_CATEGORY, IEditSessionsStorageService, EDIT_SESSIONS_SIGNED_IN_KEY, IEditSessionsLogService, SyncResource, EDIT_SESSIONS_PENDING_KEY } from 'vs/workbench/contrib/editSessions/common/editSessions';
+import { EDIT_SESSIONS_SIGNED_IN, EditSession, EDIT_SESSION_SYNC_CATEGORY, IEditSessionsStorageService, EDIT_SESSIONS_SIGNED_IN_KEY, IEditSessionsLogService, SyncResource } from 'vs/workbench/contrib/editSessions/common/editSessions';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { IExtensionService } from '../../../services/extensions/common/extensions.js';
-import { EDIT_SESSIONS_SIGNED_IN, EditSession, EDIT_SESSION_SYNC_CATEGORY, IEditSessionsStorageService, EDIT_SESSIONS_SIGNED_IN_KEY, IEditSessionsLogService, SyncResource, EDIT_SESSIONS_PENDING_KEY } from '../common/editSessions.js';
+import { EDIT_SESSIONS_SIGNED_IN, EditSession, EDIT_SESSION_SYNC_CATEGORY, IEditSessionsStorageService, EDIT_SESSIONS_SIGNED_IN_KEY, IEditSessionsLogService, SyncResource } from '../common/editSessions.js';
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
@@ -93,3 +93,2 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes

- this.registerSignInAction();
this.registerResetAuthenticationAction();
@@ -455,39 +454,2 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes
@@ -456,39 +455,2 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes

- private registerSignInAction() {
- const that = this;
Expand Down
28 changes: 12 additions & 16 deletions patches/disable-signature-verification.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
diff --git a/src/vs/platform/extensionManagement/node/extensionDownloader.ts b/src/vs/platform/extensionManagement/node/extensionDownloader.ts
index 0ddae28..2e3c9b2 100644
--- a/src/vs/platform/extensionManagement/node/extensionDownloader.ts
+++ b/src/vs/platform/extensionManagement/node/extensionDownloader.ts
@@ -11,3 +11,2 @@ import { joinPath } from 'vs/base/common/resources';
import * as semver from 'vs/base/common/semver/semver';
-import { isBoolean } from 'vs/base/common/types';
import { URI } from 'vs/base/common/uri';
@@ -51,2 +50,3 @@ export class ExtensionsDownloader extends Disposable {
@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService,
diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts
index 680e0dd..0b04279 100644
--- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts
+++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts
@@ -86,2 +86,3 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi
@IFileService private readonly fileService: IFileService,
+ // @ts-expect-error no-unused-variable
@IConfigurationService private readonly configurationService: IConfigurationService,
@@ -116,4 +116,3 @@ export class ExtensionsDownloader extends Disposable {

- const value = this.configurationService.getValue('extensions.verifySignature');
- return isBoolean(value) ? value : true;
+ return false;
}
@@ -347,4 +348,3 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi
if (verifySignature) {
- const value = this.configurationService.getValue('extensions.verifySignature');
- verifySignature = isBoolean(value) ? value : true;
+ verifySignature = false;
}
Loading

0 comments on commit 48cabed

Please sign in to comment.