mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 02:48:30 -05:00
Merge vscode 1.67 (#20883)
* Fix initial build breaks from 1.67 merge (#2514) * Update yarn lock files * Update build scripts * Fix tsconfig * Build breaks * WIP * Update yarn lock files * Misc breaks * Updates to package.json * Breaks * Update yarn * Fix breaks * Breaks * Build breaks * Breaks * Breaks * Breaks * Breaks * Breaks * Missing file * Breaks * Breaks * Breaks * Breaks * Breaks * Fix several runtime breaks (#2515) * Missing files * Runtime breaks * Fix proxy ordering issue * Remove commented code * Fix breaks with opening query editor * Fix post merge break * Updates related to setup build and other breaks (#2516) * Fix bundle build issues * Update distro * Fix distro merge and update build JS files * Disable pipeline steps * Remove stats call * Update license name * Make new RPM dependencies a warning * Fix extension manager version checks * Update JS file * Fix a few runtime breaks * Fixes * Fix runtime issues * Fix build breaks * Update notebook tests (part 1) * Fix broken tests * Linting errors * Fix hygiene * Disable lint rules * Bump distro * Turn off smoke tests * Disable integration tests * Remove failing "activate" test * Remove failed test assertion * Disable other broken test * Disable query history tests * Disable extension unit tests * Disable failing tasks
This commit is contained in:
@@ -8,13 +8,13 @@ import { chmodSync, existsSync, readFileSync, statSync, truncateSync, unlinkSync
|
||||
import { homedir, release, tmpdir } from 'os';
|
||||
import type { ProfilingSession, Target } from 'v8-inspect-profiler';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { isAbsolute, join, resolve } from 'vs/base/common/path';
|
||||
import { isAbsolute, resolve } from 'vs/base/common/path';
|
||||
import { IProcessEnvironment, isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||
import { randomPort } from 'vs/base/common/ports';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
import { whenDeleted, writeFileSync } from 'vs/base/node/pfs';
|
||||
import { findFreePort } from 'vs/base/node/ports';
|
||||
import { watchFileContents } from 'vs/base/node/watcher';
|
||||
import { watchFileContents } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcherLib';
|
||||
import { NativeParsedArgs } from 'vs/platform/environment/common/argv';
|
||||
import { buildHelpMessage, buildVersionMessage, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { addArg, parseCLIProcessArgv } from 'vs/platform/environment/node/argvHelper';
|
||||
@@ -22,6 +22,8 @@ import { getStdinFilePath, hasStdinWithoutTty, readFromStdin, stdinDataListener
|
||||
import { createWaitMarkerFile } from 'vs/platform/environment/node/wait';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
import { randomPath } from 'vs/base/common/extpath';
|
||||
import { Utils } from 'vs/platform/profiling/common/profiling';
|
||||
|
||||
function shouldSpawnCliProcess(argv: NativeParsedArgs): boolean {
|
||||
return !!argv['install-source']
|
||||
@@ -32,10 +34,6 @@ function shouldSpawnCliProcess(argv: NativeParsedArgs): boolean {
|
||||
|| !!argv['telemetry'];
|
||||
}
|
||||
|
||||
function createFileName(dir: string, prefix: string): string {
|
||||
return join(dir, `${prefix}-${Math.random().toString(16).slice(-4)}`);
|
||||
}
|
||||
|
||||
interface IMainCli {
|
||||
main: (argv: NativeParsedArgs) => Promise<void>;
|
||||
}
|
||||
@@ -259,7 +257,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
throw new Error('Failed to find free ports for profiler. Make sure to shutdown all instances of the editor first.');
|
||||
}
|
||||
|
||||
const filenamePrefix = createFileName(homedir(), 'prof');
|
||||
const filenamePrefix = randomPath(homedir(), 'prof');
|
||||
|
||||
addArg(argv, `--inspect-brk=${portMain}`);
|
||||
addArg(argv, `--remote-debugging-port=${portRenderer}`);
|
||||
@@ -272,7 +270,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
processCallbacks.push(async _child => {
|
||||
|
||||
class Profiler {
|
||||
static async start(name: string, filenamePrefix: string, opts: { port: number, tries?: number, target?: (targets: Target[]) => Target }) {
|
||||
static async start(name: string, filenamePrefix: string, opts: { port: number; tries?: number; target?: (targets: Target[]) => Target }) {
|
||||
const profiler = await import('v8-inspect-profiler');
|
||||
|
||||
let session: ProfilingSession;
|
||||
@@ -288,17 +286,17 @@ export async function main(argv: string[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
let suffix = '';
|
||||
let profile = await session.stop();
|
||||
let result = await session.stop();
|
||||
if (!process.env['VSCODE_DEV']) {
|
||||
// when running from a not-development-build we remove
|
||||
// absolute filenames because we don't want to reveal anything
|
||||
// about users. We also append the `.txt` suffix to make it
|
||||
// easier to attach these files to GH issues
|
||||
profile = profiler.rewriteAbsolutePaths(profile, 'piiRemoved');
|
||||
result.profile = Utils.rewriteAbsolutePaths(result.profile, 'piiRemoved');
|
||||
suffix = '.txt';
|
||||
}
|
||||
|
||||
await profiler.writeProfile(profile, `${filenamePrefix}.${name}.cpuprofile${suffix}`);
|
||||
writeFileSync(`${filenamePrefix}.${name}.cpuprofile${suffix}`, JSON.stringify(result.profile, undefined, 4));
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -393,7 +391,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
for (const outputType of ['stdout', 'stderr']) {
|
||||
|
||||
// Tmp file to target output to
|
||||
const tmpName = createFileName(tmpdir(), `code-${outputType}`);
|
||||
const tmpName = randomPath(tmpdir(), `code-${outputType}`);
|
||||
writeFileSync(tmpName, '');
|
||||
spawnArgs.push(`--${outputType}`, tmpName);
|
||||
|
||||
@@ -403,8 +401,12 @@ export async function main(argv: string[]): Promise<any> {
|
||||
const stream = outputType === 'stdout' ? process.stdout : process.stderr;
|
||||
|
||||
const cts = new CancellationTokenSource();
|
||||
child.on('close', () => cts.dispose(true));
|
||||
await watchFileContents(tmpName, chunk => stream.write(chunk), cts.token);
|
||||
child.on('close', () => {
|
||||
// We must dispose the token to stop watching,
|
||||
// but the watcher might still be reading data.
|
||||
setTimeout(() => cts.dispose(true), 200);
|
||||
});
|
||||
await watchFileContents(tmpName, chunk => stream.write(chunk), () => { /* ignore */ }, cts.token);
|
||||
} finally {
|
||||
unlinkSync(tmpName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user