Skip to content

Commit 17cba6e

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Back out "add debug statements to debugger shell launching path" (facebook#54977)
Summary: Pull Request resolved: facebook#54977 ## Changelog: [Internal] - Revert of [add debug statements to debugger shell launching path](facebook@c00173f). This is making js tests fail in the OSS CI. Original Phabricator diff: D88955169 Reviewed By: vzaidman Differential Revision: D89764623 fbshipit-source-id: 168295c563b0b506a14bc126e2d8249b11cb4b2e
1 parent 75c00c3 commit 17cba6e

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

packages/debugger-shell/src/node/index.flow.js

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from './private/LaunchUtils';
1515

1616
const {spawn} = require('cross-spawn');
17-
const debug = require('debug')('Metro:Debugger:DebuggerShell');
1817
const path = require('path');
1918

2019
// The 'prebuilt' flavor will use the prebuilt shell binary (and the JavaScript embedded in it).
@@ -56,59 +55,36 @@ async function unstable_spawnDebuggerShellWithArgs(
5655
...env
5756
} = process.env;
5857
const child = spawn(binaryPath, [...baseArgs, ...args], {
59-
stdio: ['ignore', 'pipe', 'pipe'],
58+
stdio: 'inherit',
6059
windowsHide: true,
6160
detached: mode === 'detached',
6261
env,
6362
});
6463
if (mode === 'detached') {
6564
child.on('spawn', () => {
66-
debug('Debugger spawned in detached mode');
6765
resolve();
6866
});
69-
child.on('close', (code: number, signal) => {
70-
debug('Debugger closed with code %s and signal %s', code, signal);
67+
child.on('close', (code: number) => {
7168
if (code !== 0) {
72-
console.error(
73-
'Debugger closed with code %s and signal %s',
74-
code,
75-
signal,
76-
);
7769
reject(
7870
new Error(
7971
`Failed to open debugger shell: exited with code ${code}`,
8072
),
8173
);
8274
}
8375
});
84-
child.on('error', error => {
85-
debug('Debugger shell encountered error: %s', error);
86-
reject(error);
87-
});
88-
child.stdout.on('data', data =>
89-
console.debug('[DebuggerShell stdout] ' + String(data)),
90-
);
91-
child.stderr.on('data', data =>
92-
console.debug('[DebuggerShell stderr] ' + String(data)),
93-
);
9476
child.unref();
9577
} else if (mode === 'syncThenExit') {
9678
child.on('close', function (code, signal) {
97-
debug('Debugger closed with code %s and signal %s', code, signal);
9879
if (code === null) {
99-
console.error(
100-
'Debugger closed with code %s and signal %s',
101-
code,
102-
signal,
103-
);
80+
console.error('Debugger shell exited with signal', signal);
10481
process.exit(1);
10582
}
10683
process.exit(code);
10784
});
10885

10986
const handleTerminationSignal = function (signal: string) {
11087
process.on(signal, function signalHandler() {
111-
debug('The Signal %s received. killing debugger', signal);
11288
if (!child.killed) {
11389
child.kill(signal);
11490
}

0 commit comments

Comments
 (0)