vscode: update to 1.96.4
+update to electron33
This commit is contained in:
parent
3661c69d10
commit
488c8c5bfd
@ -1,23 +1,17 @@
|
||||
From afa206dc466066c3d273dfc879103700505b3d7b Mon Sep 17 00:00:00 2001
|
||||
From: Joshua Strobl <joshua@streambits.io>
|
||||
Date: Sun, 22 Aug 2021 14:02:05 +0300
|
||||
Subject: [PATCH 1/1] Disable crash reporter since Microsoft refuses to fix
|
||||
this upstream.
|
||||
|
||||
Unfortunately a PR submitted by a third-party was rejected by Microsoft, which would change the default for crash reporting from true to false and move the telemetry configuration to ensure crash reporting was not being forced on, placed in the argv.json, and cause a crash when improperly set.
|
||||
|
||||
So, disable it entirely. No cookies for you, Visual Studio Code team.
|
||||
---
|
||||
src/bootstrap-fork.js | 3 ---
|
||||
src/main.js | 16 ----------------
|
||||
src/vs/code/electron-main/app.ts | 2 +-
|
||||
3 files changed, 1 insertion(+), 20 deletions(-)
|
||||
|
||||
diff --git a/src/main.js b/src/main.js
|
||||
index f7e6e49a967..88513af6dec 100644
|
||||
--- a/src/main.js
|
||||
+++ b/src/main.js
|
||||
@@ -46,21 +46,6 @@ const argvConfig = configureCommandlineSwitchesSync(args);
|
||||
diff --git a/src/main.ts b/src/main.ts
|
||||
index ff9a5e89296..13bd078db46 100644
|
||||
--- a/src/main.ts
|
||||
+++ b/src/main.ts
|
||||
@@ -10,7 +10,7 @@ import { performance } from 'perf_hooks';
|
||||
import { configurePortable } from './bootstrap-node.js';
|
||||
import { bootstrapESM } from './bootstrap-esm.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
-import { app, protocol, crashReporter, Menu, contentTracing } from 'electron';
|
||||
+import { app, protocol, Menu, contentTracing } from 'electron';
|
||||
import minimist from 'minimist';
|
||||
import { product } from './bootstrap-meta.js';
|
||||
import { parse } from './vs/base/common/jsonc.js';
|
||||
@@ -72,21 +72,6 @@ const codeCachePath = getCodeCachePath();
|
||||
// Disable default menu (https://github.com/electron/electron/issues/35512)
|
||||
Menu.setApplicationMenu(null);
|
||||
|
||||
@ -39,3 +33,101 @@ index f7e6e49a967..88513af6dec 100644
|
||||
// Set logs path before app 'ready' event if running portable
|
||||
// to ensure that no 'logs' folder is created on disk at a
|
||||
// location outside of the portable directory
|
||||
@@ -391,97 +376,6 @@ function getArgvConfigPath(): string {
|
||||
return path.join(os.homedir(), dataFolderName!, 'argv.json');
|
||||
}
|
||||
|
||||
-function configureCrashReporter(): void {
|
||||
- let crashReporterDirectory = args['crash-reporter-directory'];
|
||||
- let submitURL = '';
|
||||
- if (crashReporterDirectory) {
|
||||
- crashReporterDirectory = path.normalize(crashReporterDirectory);
|
||||
-
|
||||
- if (!path.isAbsolute(crashReporterDirectory)) {
|
||||
- console.error(`The path '${crashReporterDirectory}' specified for --crash-reporter-directory must be absolute.`);
|
||||
- app.exit(1);
|
||||
- }
|
||||
-
|
||||
- if (!fs.existsSync(crashReporterDirectory)) {
|
||||
- try {
|
||||
- fs.mkdirSync(crashReporterDirectory, { recursive: true });
|
||||
- } catch (error) {
|
||||
- console.error(`The path '${crashReporterDirectory}' specified for --crash-reporter-directory does not seem to exist or cannot be created.`);
|
||||
- app.exit(1);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- // Crashes are stored in the crashDumps directory by default, so we
|
||||
- // need to change that directory to the provided one
|
||||
- console.log(`Found --crash-reporter-directory argument. Setting crashDumps directory to be '${crashReporterDirectory}'`);
|
||||
- app.setPath('crashDumps', crashReporterDirectory);
|
||||
- }
|
||||
-
|
||||
- // Otherwise we configure the crash reporter from product.json
|
||||
- else {
|
||||
- const appCenter = product.appCenter;
|
||||
- if (appCenter) {
|
||||
- const isWindows = (process.platform === 'win32');
|
||||
- const isLinux = (process.platform === 'linux');
|
||||
- const isDarwin = (process.platform === 'darwin');
|
||||
- const crashReporterId = argvConfig['crash-reporter-id'];
|
||||
- const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
||||
- if (crashReporterId && uuidPattern.test(crashReporterId)) {
|
||||
- if (isWindows) {
|
||||
- switch (process.arch) {
|
||||
- case 'x64':
|
||||
- submitURL = appCenter['win32-x64'];
|
||||
- break;
|
||||
- case 'arm64':
|
||||
- submitURL = appCenter['win32-arm64'];
|
||||
- break;
|
||||
- }
|
||||
- } else if (isDarwin) {
|
||||
- if (product.darwinUniversalAssetId) {
|
||||
- submitURL = appCenter['darwin-universal'];
|
||||
- } else {
|
||||
- switch (process.arch) {
|
||||
- case 'x64':
|
||||
- submitURL = appCenter['darwin'];
|
||||
- break;
|
||||
- case 'arm64':
|
||||
- submitURL = appCenter['darwin-arm64'];
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
- } else if (isLinux) {
|
||||
- submitURL = appCenter['linux-x64'];
|
||||
- }
|
||||
- submitURL = submitURL.concat('&uid=', crashReporterId, '&iid=', crashReporterId, '&sid=', crashReporterId);
|
||||
- // Send the id for child node process that are explicitly starting crash reporter.
|
||||
- // For vscode this is ExtensionHost process currently.
|
||||
- const argv = process.argv;
|
||||
- const endOfArgsMarkerIndex = argv.indexOf('--');
|
||||
- if (endOfArgsMarkerIndex === -1) {
|
||||
- argv.push('--crash-reporter-id', crashReporterId);
|
||||
- } else {
|
||||
- // if the we have an argument "--" (end of argument marker)
|
||||
- // we cannot add arguments at the end. rather, we add
|
||||
- // arguments before the "--" marker.
|
||||
- argv.splice(endOfArgsMarkerIndex, 0, '--crash-reporter-id', crashReporterId);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- // Start crash reporter for all processes
|
||||
- const productName = (product.crashReporter ? product.crashReporter.productName : undefined) || product.nameShort;
|
||||
- const companyName = (product.crashReporter ? product.crashReporter.companyName : undefined) || 'Microsoft';
|
||||
- const uploadToServer = Boolean(!process.env['VSCODE_DEV'] && submitURL && !crashReporterDirectory);
|
||||
- crashReporter.start({
|
||||
- companyName,
|
||||
- productName: process.env['VSCODE_DEV'] ? `${productName} Dev` : productName,
|
||||
- submitURL,
|
||||
- uploadToServer,
|
||||
- compress: true
|
||||
- });
|
||||
-}
|
||||
-
|
||||
function getJSFlags(cliArgs: NativeParsedArgs): string | null {
|
||||
const jsFlags: string[] = [];
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
# Template file for 'vscode'
|
||||
pkgname=vscode
|
||||
version=1.91.1
|
||||
version=1.96.4
|
||||
revision=1
|
||||
_electronver=24.3.0
|
||||
_npmver=8.6.0
|
||||
hostmakedepends="pkg-config python3 python3-setuptools nodejs yarn tar git ripgrep"
|
||||
makedepends="libxkbfile-devel libsecret-devel libxml2-devel mit-krb5-devel ncurses-devel electron24"
|
||||
depends="libXtst ncurses nss xdg-utils ripgrep electron24"
|
||||
_electronver=33.0.2
|
||||
_npmver=10.8.3
|
||||
hostmakedepends="pkg-config python3 python3-setuptools nodejs tar git ripgrep"
|
||||
makedepends="libxkbfile-devel libsecret-devel libxml2-devel mit-krb5-devel nodejs-devel ncurses-devel electron33-devel"
|
||||
depends="libXtst ncurses nss xdg-utils ripgrep electron33"
|
||||
short_desc="Microsoft Code for Linux"
|
||||
maintainer="shizonic <realtiaz@gmail.com>, Alex Lohr <alexthkloss@web.de>"
|
||||
license="MIT"
|
||||
homepage="https://code.visualstudio.com/"
|
||||
distfiles="https://github.com/microsoft/vscode/archive/refs/tags/${version}.tar.gz"
|
||||
checksum=d2ed726dd34d2e8e71d40b09c0ea648bf9b37b15982b39dddcb70d0cbfcdb45e
|
||||
checksum=cbd16ab3cfe5322a532899f7c7ef4a203512c70f464c405465e6aa8b85a4c22b
|
||||
nocross=yes # x64 build does not cut it, it contains native code
|
||||
|
||||
if [ "$XBPS_TARGET_WORDSIZE" = "32" ]; then
|
||||
@ -24,7 +24,7 @@ fi
|
||||
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
|
||||
|
||||
do_configure() {
|
||||
# Use yarn to install dependencies
|
||||
# Use npm to install dependencies
|
||||
echo "" > build/npm/preinstall.js
|
||||
|
||||
# redirect telemetry urls to 0.0.0.0
|
||||
@ -34,17 +34,7 @@ do_configure() {
|
||||
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
|
||||
|
||||
# set used electron version
|
||||
vsed -e "s/^target .*/target \"${_electronver}\"/" -i .yarnrc
|
||||
|
||||
# @vscode/ripgrep attempts to install an own version of ripgrep and provides a path
|
||||
# we want to use our own version instead, so all we need is the fixed path (/bin/rg)
|
||||
# remove @vscode/ripgrep from all package.json files it is in:
|
||||
_PACKAGE_PATTERN="\"@vscode.ripgrep\":"
|
||||
grep -rl --exclude-dir=.git -E $_PACKAGE_PATTERN | xargs sed -i -E "/${_PACKAGE_PATTERN}/d"
|
||||
# replace path import with fixed path:
|
||||
_IMPORT_PATTERN="import.*from '@vscode.ripgrep';"
|
||||
_IMPORT_REPLACEMENT="s/${_IMPORT_PATTERN}/const rgPath = '\/bin\/rg';/"
|
||||
grep -rl --exclude-dir=.git -E "$_IMPORT_PATTERN" | xargs sed -i -E "$_IMPORT_REPLACEMENT"
|
||||
vsed -e "s/^target=\".*\"/target=\"${_electronver}\"/" -i .npmrc
|
||||
}
|
||||
|
||||
do_build() {
|
||||
@ -58,32 +48,25 @@ do_build() {
|
||||
|
||||
export NODE_OPTIONS="${_mem_limit}"
|
||||
|
||||
/usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
|
||||
--target=$_electronver \
|
||||
--tarball=/usr/include/electron${_electronver%%.*}/node_headers.tar.gz
|
||||
|
||||
# ignore nodejs version checks, we can not pass it as an argument to
|
||||
# yarn install because it doesn't inherit properly
|
||||
echo "ignore-engines true" >> .yarnrc
|
||||
# npm install because it doesn't inherit properly
|
||||
echo "ignore-engines=true" >> .npmrc
|
||||
|
||||
yarn install --frozen-lockfile --arch=x64
|
||||
|
||||
# patch node fs with graceful-fs to avoid using too many file descriptors
|
||||
yarn add --dev graceful-fs@4.2.11
|
||||
echo "require('graceful-fs').gracefulify(require('fs'));" > ${wrksrc}/use-graceful-fs.js
|
||||
export NODE_OPTIONS="${_mem_limit} --require ${wrksrc}/use-graceful-fs.js"
|
||||
npm ci
|
||||
|
||||
# do not checksum electron, since we're using our own build
|
||||
vsed -e "s/validateChecksum: true/validateChecksum: false/g" -i build/lib/electron.*s
|
||||
|
||||
export CFLAGS="$CFLAGS -I/usr/include/node"
|
||||
yarn run gulp vscode-linux-x64-min
|
||||
npm run gulp vscode-linux-x64-min
|
||||
}
|
||||
|
||||
do_install() {
|
||||
vmkdir usr/lib/code-oss
|
||||
vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
|
||||
vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
|
||||
# Replace statically included binary with system copy
|
||||
ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules/@vscode/ripgrep/bin/rg
|
||||
vmkdir usr/bin
|
||||
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
|
||||
vmkdir usr/share/applications
|
||||
|
Loading…
x
Reference in New Issue
Block a user