From af63affc986b51008a70e0440eed7f67bdb87105 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 1 Jun 2017 11:47:34 +0200 Subject: [PATCH] Fixes #27665: Let the search process never inherit `process.execArgv` --- src/vs/base/parts/ipc/node/ipc.cp.ts | 12 ++++++++++++ .../workbench/services/search/node/searchService.ts | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/src/vs/base/parts/ipc/node/ipc.cp.ts b/src/vs/base/parts/ipc/node/ipc.cp.ts index 940c18638fb..21b1b3f5531 100644 --- a/src/vs/base/parts/ipc/node/ipc.cp.ts +++ b/src/vs/base/parts/ipc/node/ipc.cp.ts @@ -56,6 +56,14 @@ export interface IIPCOptions { */ debugBrk?: number; + /** + * See https://github.com/Microsoft/vscode/issues/27665 + * Allows to pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`. + * e.g. Launching the extension host process with `--debug-brk=xxx` and then forking a process from the extension host + * results in the forked process inheriting `--debug-brk=xxx`. + */ + freshExecArgv?: boolean; + /** * Enables our createQueuedSender helper for this Client. Uses a queue when the internal Node.js queue is * full of messages - see notes on that method. @@ -125,6 +133,10 @@ export class Client implements IChannelClient, IDisposable { forkOpts.env = assign(forkOpts.env, this.options.env); } + if (this.options && this.options.freshExecArgv) { + forkOpts.execArgv = []; + } + if (this.options && typeof this.options.debug === 'number') { forkOpts.execArgv = ['--nolazy', '--debug=' + this.options.debug]; } diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts index 1c2d62c29d1..ac68c6c4e28 100644 --- a/src/vs/workbench/services/search/node/searchService.ts +++ b/src/vs/workbench/services/search/node/searchService.ts @@ -207,6 +207,11 @@ export class DiskSearch { serverName: 'Search', timeout: timeout, args: ['--type=searchService'], + // See https://github.com/Microsoft/vscode/issues/27665 + // Pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`. + // e.g. Launching the extension host process with `--debug-brk=xxx` and then forking a process from the extension host + // results in the forked process inheriting `--debug-brk=xxx`. + freshExecArgv: true, env: { AMD_ENTRYPOINT: 'vs/workbench/services/search/node/searchApp', PIPE_LOGGING: 'true', -- GitLab