From d8a91cf13e090a07a0490017e6aae869b2678b12 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Thu, 1 Apr 2021 16:43:49 +0200 Subject: [PATCH] fixing build for 1.55 (#690) * Fix patch for builds after 1.55 * Remove no longer needed centos7 patch * updating patches for 1.55 Co-authored-by: Atesca <2404098-atesca@users.noreply.gitlab.com> --- patches/binary-name.patch | 2 +- patches/custom-gallery.patch | 14 +++++++------- patches/fix-rpm-spec.patch | 8 -------- patches/update-cache-path.patch | 14 +++++++++----- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/patches/binary-name.patch b/patches/binary-name.patch index 44db574..4458db1 100644 --- a/patches/binary-name.patch +++ b/patches/binary-name.patch @@ -28,7 +28,7 @@ index 50c4460..bf73260 100644 // macOS if (this.environmentMainService.isBuilt) { - return join(this.environmentMainService.appRoot, 'bin', 'code'); -+ return join(this.environmentMainService.appRoot, 'bin', `${product.applicationName}`); ++ return join(this.environmentMainService.appRoot, 'bin', `${this.productService.applicationName}`); } diff --git a/src/vs/workbench/contrib/cli/node/cli.contribution.ts b/src/vs/workbench/contrib/cli/node/cli.contribution.ts index 30972a4..0a9435c 100644 diff --git a/patches/custom-gallery.patch b/patches/custom-gallery.patch index f4c1200..e48d7a5 100644 --- a/patches/custom-gallery.patch +++ b/patches/custom-gallery.patch @@ -1,16 +1,16 @@ diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts -index 2730ee7..4d46c23 100644 +index 251ed36..8065c6f 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts @@ -8,6 +8,7 @@ import { isWeb } from 'vs/base/common/platform'; import { env } from 'vs/base/common/process'; - import { FileAccess } from 'vs/base/common/network'; import { dirname, joinPath } from 'vs/base/common/resources'; -+import { getDefaultUserDataPath } from 'vs/base/node/userDataPath'; + import { IProductConfiguration } from 'vs/platform/product/common/productService'; ++import { getUserDataPath } from 'vs/platform/environment/node/userDataPath'; let product: IProductConfiguration; -@@ -47,6 +48,29 @@ else { +@@ -49,6 +50,29 @@ else { product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath); const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; }; @@ -31,7 +31,7 @@ index 2730ee7..4d46c23 100644 + return result; + }, {}) as any; + -+ const userProduct = require.__$__nodeRequire(joinPath(FileAccess.asFileUri(getDefaultUserDataPath(), require), 'product.json').fsPath); ++ const userProduct = require.__$__nodeRequire(joinPath(FileAccess.asFileUri(getUserDataPath({} as any), require), 'product.json').fsPath); + + product = merge(product, userProduct) + } catch (ex) { @@ -40,7 +40,7 @@ index 2730ee7..4d46c23 100644 // Running out of sources if (env['VSCODE_DEV']) { Object.assign(product, { -@@ -56,6 +80,19 @@ else { +@@ -58,6 +82,19 @@ else { }); } @@ -61,7 +61,7 @@ index 2730ee7..4d46c23 100644 version: pkg.version }); diff --git a/src/vs/platform/product/common/productService.ts b/src/vs/platform/product/common/productService.ts -index 07263ca..0328f58 100644 +index 34acc14..d3a2764 100644 --- a/src/vs/platform/product/common/productService.ts +++ b/src/vs/platform/product/common/productService.ts @@ -67,6 +67,7 @@ export interface IProductConfiguration { diff --git a/patches/fix-rpm-spec.patch b/patches/fix-rpm-spec.patch index c0f2135..6dedacd 100644 --- a/patches/fix-rpm-spec.patch +++ b/patches/fix-rpm-spec.patch @@ -1,13 +1,5 @@ --- vscode/resources/linux/rpm/code.spec.template 2021-03-02 19:26:53.000000000 +0100 +++ vscode/resources/linux/rpm/code.spec.template.new 2021-03-02 19:28:12.000000000 +0100 -@@ -1,6 +1,6 @@ - Name: @@NAME@@ - Version: @@VERSION@@ --Release: @@RELEASE@@.el7 -+Release: @@RELEASE@@.el8 - Summary: Code editing. Redefined. - Group: Development/Tools - Vendor: Microsoft Corporation @@ -69,3 +69,5 @@ /usr/share/pixmaps/@@ICON@@.png /usr/share/bash-completion/completions/@@NAME@@ diff --git a/patches/update-cache-path.patch b/patches/update-cache-path.patch index 096a38f..7cc4e3a 100644 --- a/patches/update-cache-path.patch +++ b/patches/update-cache-path.patch @@ -1,7 +1,11 @@ ---- vscode/src/vs/platform/update/electron-main/updateService.win32.ts 2021-02-05 11:59:17.564060663 -0600 -+++ src/src/vs/platform/update/electron-main/updateService.win32.ts 2021-02-05 11:59:39.780745778 -0600 -@@ -56,3 +56,3 @@ +--- a/src/vs/platform/update/electron-main/updateService.win32.ts ++++ b/src/vs/platform/update/electron-main/updateService.win32.ts +@@ -55,7 +55,7 @@ export class Win32UpdateService extends AbstractUpdateService { + @memoize get cachePath(): Promise { -- const result = path.join(tmpdir(), `vscode-update-${product.target}-${process.arch}`); -+ const result = path.join(tmpdir(), `vscodium-update-${product.target}-${process.arch}`); +- const result = path.join(tmpdir(), `vscode-update-${this.productService.target}-${process.arch}`); ++ const result = path.join(tmpdir(), `${this.productService.nameShort.toLowerCase()}-update-${this.productService.target}-${process.arch}`); + return fs.promises.mkdir(result, { recursive: true }).then(() => result); + } +