Skip to content

Commit 4e97490

Browse files
test
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
1 parent cb66eeb commit 4e97490

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

build/scripts/entrypoint-volume.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,8 @@ fi
121121

122122
echo "[INFO] Node.js dir for running VS Code: $VSCODE_NODEJS_RUNTIME_DIR"
123123

124+
# Test-only repro switch for shellEnv code path (remove after validation).
125+
export CHECODE_TEST_STRIP_LD_LIBRARY_PATH_BEFORE_SPAWN=1
126+
124127
# Run launcher
125128
"$VSCODE_NODEJS_RUNTIME_DIR/node" ./launcher/entrypoint.js

code/src/vs/platform/shell/node/shellEnv.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,17 @@ async function doResolveUnixShellEnv(logService: ILogService, token: Cancellatio
109109
const mark = generateUuid().replace(/-/g, '').substr(0, 12);
110110
const regex = new RegExp(mark + '({.*})' + mark);
111111

112-
const env = {
112+
const env: NodeJS.ProcessEnv = {
113113
...process.env,
114114
ELECTRON_RUN_AS_NODE: '1',
115115
ELECTRON_NO_ATTACH_CONSOLE: '1',
116116
VSCODE_RESOLVING_ENVIRONMENT: '1'
117117
};
118+
if (process.env['CHECODE_TEST_STRIP_LD_LIBRARY_PATH_BEFORE_SPAWN'] === '1') {
119+
// Test-only repro switch: dropping LD_LIBRARY_PATH before spawn can make
120+
// process.execPath fail to start and trigger "resolve shell environment ... code 127".
121+
delete env['LD_LIBRARY_PATH'];
122+
}
118123

119124
logService.trace('getUnixShellEnvironment#env', env);
120125
const systemShellUnix = await getSystemShell(OS, env);

0 commit comments

Comments
 (0)