mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Move --ms-enable-electron-run-as-node
to a later location (#136786)
* Move `--ms-enable-electron-run-as-node` to a later location, which is not fatal in Electron builds that don't know it * undo bad change
This commit is contained in:
parent
a4ad395f23
commit
e08e4d3fe1
|
@ -83,7 +83,7 @@ export class Askpass implements IIPCHandler {
|
||||||
...this.ipc.getEnv(),
|
...this.ipc.getEnv(),
|
||||||
GIT_ASKPASS: path.join(__dirname, 'askpass.sh'),
|
GIT_ASKPASS: path.join(__dirname, 'askpass.sh'),
|
||||||
VSCODE_GIT_ASKPASS_NODE: process.execPath,
|
VSCODE_GIT_ASKPASS_NODE: process.execPath,
|
||||||
VSCODE_GIT_ASKPASS_EXTRA_ARGS: !!process.versions['electron'] ? '--ms-enable-electron-run-as-node' : '',
|
VSCODE_GIT_ASKPASS_EXTRA_ARGS: (process.versions['electron'] && process.versions['microsoft-build']) ? '--ms-enable-electron-run-as-node' : '',
|
||||||
VSCODE_GIT_ASKPASS_MAIN: path.join(__dirname, 'askpass-main.js')
|
VSCODE_GIT_ASKPASS_MAIN: path.join(__dirname, 'askpass-main.js')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,5 @@ function realpath() { python -c "import os,sys; print(os.path.realpath(sys.argv[
|
||||||
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
|
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
|
||||||
ELECTRON="$CONTENTS/MacOS/Electron"
|
ELECTRON="$CONTENTS/MacOS/Electron"
|
||||||
CLI="$CONTENTS/Resources/app/out/cli.js"
|
CLI="$CONTENTS/Resources/app/out/cli.js"
|
||||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" --ms-enable-electron-run-as-node "$CLI" "$@"
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
@ -50,5 +50,5 @@ fi
|
||||||
|
|
||||||
ELECTRON="$VSCODE_PATH/@@NAME@@"
|
ELECTRON="$VSCODE_PATH/@@NAME@@"
|
||||||
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
||||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" --ms-enable-electron-run-as-node "$CLI" "$@"
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
setlocal
|
setlocal
|
||||||
set VSCODE_DEV=
|
set VSCODE_DEV=
|
||||||
set ELECTRON_RUN_AS_NODE=1
|
set ELECTRON_RUN_AS_NODE=1
|
||||||
"%~dp0..\@@NAME@@.exe" --ms-enable-electron-run-as-node "%~dp0..\resources\app\out\cli.js" %*
|
"%~dp0..\@@NAME@@.exe" "%~dp0..\resources\app\out\cli.js" --ms-enable-electron-run-as-node %*
|
||||||
endlocal
|
endlocal
|
||||||
|
|
|
@ -43,7 +43,7 @@ if [ $IN_WSL = true ]; then
|
||||||
# use the Remote WSL extension if installed
|
# use the Remote WSL extension if installed
|
||||||
WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
||||||
|
|
||||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" --ms-enable-electron-run-as-node "$CLI" --locate-extension $WSL_EXT_ID >/tmp/remote-wsl-loc.txt 2>/dev/null </dev/null
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node --locate-extension $WSL_EXT_ID >/tmp/remote-wsl-loc.txt 2>/dev/null </dev/null
|
||||||
WSL_EXT_WLOC=$(cat /tmp/remote-wsl-loc.txt)
|
WSL_EXT_WLOC=$(cat /tmp/remote-wsl-loc.txt)
|
||||||
|
|
||||||
if [ -n "$WSL_EXT_WLOC" ]; then
|
if [ -n "$WSL_EXT_WLOC" ]; then
|
||||||
|
@ -58,5 +58,5 @@ elif [ -x "$(command -v cygpath)" ]; then
|
||||||
else
|
else
|
||||||
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
||||||
fi
|
fi
|
||||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" --ms-enable-electron-run-as-node "$CLI" "$@"
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
@ -24,7 +24,7 @@ set ELECTRON_ENABLE_LOGGING=1
|
||||||
set ELECTRON_ENABLE_STACK_DUMPING=1
|
set ELECTRON_ENABLE_STACK_DUMPING=1
|
||||||
|
|
||||||
:: Launch Code
|
:: Launch Code
|
||||||
%CODE% --ms-enable-electron-run-as-node --inspect=5874 out\cli.js %~dp0.. %*
|
%CODE% --inspect=5874 out\cli.js --ms-enable-electron-run-as-node %~dp0.. %*
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
:builtin
|
:builtin
|
||||||
|
|
|
@ -34,7 +34,7 @@ function code() {
|
||||||
VSCODE_DEV=1 \
|
VSCODE_DEV=1 \
|
||||||
ELECTRON_ENABLE_LOGGING=1 \
|
ELECTRON_ENABLE_LOGGING=1 \
|
||||||
ELECTRON_ENABLE_STACK_DUMPING=1 \
|
ELECTRON_ENABLE_STACK_DUMPING=1 \
|
||||||
"$CODE" --ms-enable-electron-run-as-node --inspect=5874 "$ROOT/out/cli.js" . "$@"
|
"$CODE" --inspect=5874 "$ROOT/out/cli.js" --ms-enable-electron-run-as-node . "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
code "$@"
|
code "$@"
|
||||||
|
|
|
@ -58,7 +58,7 @@ function code-wsl()
|
||||||
cd $ROOT
|
cd $ROOT
|
||||||
export WSLENV=ELECTRON_RUN_AS_NODE/w:VSCODE_DEV/w:$WSLENV
|
export WSLENV=ELECTRON_RUN_AS_NODE/w:VSCODE_DEV/w:$WSLENV
|
||||||
local WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
local WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
||||||
local WSL_EXT_WLOC=$(echo "" | VSCODE_DEV=1 ELECTRON_RUN_AS_NODE=1 "$ROOT/.build/electron/Code - OSS.exe" --ms-enable-electron-run-as-node "out/cli.js" --locate-extension $WSL_EXT_ID)
|
local WSL_EXT_WLOC=$(echo "" | VSCODE_DEV=1 ELECTRON_RUN_AS_NODE=1 "$ROOT/.build/electron/Code - OSS.exe" "out/cli.js" --ms-enable-electron-run-as-node --locate-extension $WSL_EXT_ID)
|
||||||
cd $CWD
|
cd $CWD
|
||||||
if [ -n "$WSL_EXT_WLOC" ]; then
|
if [ -n "$WSL_EXT_WLOC" ]; then
|
||||||
# replace \r\n with \n in WSL_EXT_WLOC
|
# replace \r\n with \n in WSL_EXT_WLOC
|
||||||
|
|
|
@ -10,7 +10,7 @@ set NAMESHORT=%NAMESHORT: "=%
|
||||||
set NAMESHORT=%NAMESHORT:"=%.exe
|
set NAMESHORT=%NAMESHORT:"=%.exe
|
||||||
set CODE=".build\electron\%NAMESHORT%"
|
set CODE=".build\electron\%NAMESHORT%"
|
||||||
|
|
||||||
%CODE% --ms-enable-electron-run-as-node %*
|
%CODE% %* --ms-enable-electron-run-as-node
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,11 @@ export VSCODE_DEV=1
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
|
ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
|
||||||
"$CODE" \
|
"$CODE" \
|
||||||
--ms-enable-electron-run-as-node \
|
"$@" \
|
||||||
"$@"
|
--ms-enable-electron-run-as-node
|
||||||
else
|
else
|
||||||
ELECTRON_RUN_AS_NODE=1 \
|
ELECTRON_RUN_AS_NODE=1 \
|
||||||
"$CODE" \
|
"$CODE" \
|
||||||
--ms-enable-electron-run-as-node \
|
"$@" \
|
||||||
"$@"
|
--ms-enable-electron-run-as-node
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -106,4 +106,7 @@ export interface NativeParsedArgs {
|
||||||
'allow-insecure-localhost'?: boolean;
|
'allow-insecure-localhost'?: boolean;
|
||||||
'log-net-log'?: string;
|
'log-net-log'?: string;
|
||||||
'vmodule'?: string;
|
'vmodule'?: string;
|
||||||
|
|
||||||
|
// MS Build command line arg
|
||||||
|
'ms-enable-electron-run-as-node'?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ export const OPTIONS: OptionDescriptions<Required<NativeParsedArgs>> = {
|
||||||
'inspect-extensions': { type: 'string', deprecates: 'debugPluginHost', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") },
|
'inspect-extensions': { type: 'string', deprecates: 'debugPluginHost', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") },
|
||||||
'inspect-brk-extensions': { type: 'string', deprecates: 'debugBrkPluginHost', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") },
|
'inspect-brk-extensions': { type: 'string', deprecates: 'debugBrkPluginHost', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") },
|
||||||
'disable-gpu': { type: 'boolean', cat: 't', description: localize('disableGPU', "Disable GPU hardware acceleration.") },
|
'disable-gpu': { type: 'boolean', cat: 't', description: localize('disableGPU', "Disable GPU hardware acceleration.") },
|
||||||
|
'ms-enable-electron-run-as-node': { type: 'boolean' },
|
||||||
'max-memory': { type: 'string', cat: 't', description: localize('maxMemory', "Max memory size for a window (in Mbytes)."), args: 'memory' },
|
'max-memory': { type: 'string', cat: 't', description: localize('maxMemory', "Max memory size for a window (in Mbytes)."), args: 'memory' },
|
||||||
'telemetry': { type: 'boolean', cat: 't', description: localize('telemetry', "Shows all telemetry events which VS code collects.") },
|
'telemetry': { type: 'boolean', cat: 't', description: localize('telemetry', "Shows all telemetry events which VS code collects.") },
|
||||||
|
|
||||||
|
|
|
@ -127,13 +127,14 @@ async function doResolveUnixShellEnv(logService: ILogService, token: Cancellatio
|
||||||
// handle popular non-POSIX shells
|
// handle popular non-POSIX shells
|
||||||
const name = basename(systemShellUnix);
|
const name = basename(systemShellUnix);
|
||||||
let command: string, shellArgs: Array<string>;
|
let command: string, shellArgs: Array<string>;
|
||||||
|
const extraArgs = (process.versions['electron'] && process.versions['microsoft-build']) ? '--ms-enable-electron-run-as-node' : '';
|
||||||
if (/^pwsh(-preview)?$/.test(name)) {
|
if (/^pwsh(-preview)?$/.test(name)) {
|
||||||
// Older versions of PowerShell removes double quotes sometimes so we use "double single quotes" which is how
|
// Older versions of PowerShell removes double quotes sometimes so we use "double single quotes" which is how
|
||||||
// you escape single quotes inside of a single quoted string.
|
// you escape single quotes inside of a single quoted string.
|
||||||
command = `& '${process.execPath}' --ms-enable-electron-run-as-node -p '''${mark}'' + JSON.stringify(process.env) + ''${mark}'''`;
|
command = `& '${process.execPath}' ${extraArgs} -p '''${mark}'' + JSON.stringify(process.env) + ''${mark}'''`;
|
||||||
shellArgs = ['-Login', '-Command'];
|
shellArgs = ['-Login', '-Command'];
|
||||||
} else {
|
} else {
|
||||||
command = `'${process.execPath}' --ms-enable-electron-run-as-node -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
|
command = `'${process.execPath}' ${extraArgs} -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
|
||||||
|
|
||||||
if (name === 'tcsh') {
|
if (name === 'tcsh') {
|
||||||
shellArgs = ['-ic'];
|
shellArgs = ['-ic'];
|
||||||
|
|
Loading…
Reference in a new issue