mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Back out "add debug statements to debugger shell launching path" (#54977)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54977 ## Changelog: [Internal] - Revert of [add debug statements to debugger shell launching path](https://github.com/facebook/react-native/commit/c00173fdb4bd9f852e8ca1908af46cec500887aa). This is making js tests fail in the OSS CI. Original Phabricator diff: D88955169 Reviewed By: vzaidman Differential Revision: D89764623 fbshipit-source-id: 168295c563b0b506a14bc126e2d8249b11cb4b2e
This commit is contained in:
1 parent
75c00c303e
commit
17cba6e1af
1 file changed
+3
-27
@@ -14,7 +14,6 @@ import {
|
||||
} from './private/LaunchUtils';
|
||||
|
||||
const {spawn} = require('cross-spawn');
|
||||
const debug = require('debug')('Metro:Debugger:DebuggerShell');
|
||||
const path = require('path');
|
||||
|
||||
// The 'prebuilt' flavor will use the prebuilt shell binary (and the JavaScript embedded in it).
|
||||
@@ -56,24 +55,17 @@ async function unstable_spawnDebuggerShellWithArgs(
|
||||
...env
|
||||
} = process.env;
|
||||
const child = spawn(binaryPath, [...baseArgs, ...args], {
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
stdio: 'inherit',
|
||||
windowsHide: true,
|
||||
detached: mode === 'detached',
|
||||
env,
|
||||
});
|
||||
if (mode === 'detached') {
|
||||
child.on('spawn', () => {
|
||||
debug('Debugger spawned in detached mode');
|
||||
resolve();
|
||||
});
|
||||
child.on('close', (code: number, signal) => {
|
||||
debug('Debugger closed with code %s and signal %s', code, signal);
|
||||
child.on('close', (code: number) => {
|
||||
if (code !== 0) {
|
||||
console.error(
|
||||
'Debugger closed with code %s and signal %s',
|
||||
code,
|
||||
signal,
|
||||
);
|
||||
reject(
|
||||
new Error(
|
||||
`Failed to open debugger shell: exited with code ${code}`,
|
||||
@@ -81,26 +73,11 @@ async function unstable_spawnDebuggerShellWithArgs(
|
||||
);
|
||||
}
|
||||
});
|
||||
child.on('error', error => {
|
||||
debug('Debugger shell encountered error: %s', error);
|
||||
reject(error);
|
||||
});
|
||||
child.stdout.on('data', data =>
|
||||
console.debug('[DebuggerShell stdout] ' + String(data)),
|
||||
);
|
||||
child.stderr.on('data', data =>
|
||||
console.debug('[DebuggerShell stderr] ' + String(data)),
|
||||
);
|
||||
child.unref();
|
||||
} else if (mode === 'syncThenExit') {
|
||||
child.on('close', function (code, signal) {
|
||||
debug('Debugger closed with code %s and signal %s', code, signal);
|
||||
if (code === null) {
|
||||
console.error(
|
||||
'Debugger closed with code %s and signal %s',
|
||||
code,
|
||||
signal,
|
||||
);
|
||||
console.error('Debugger shell exited with signal', signal);
|
||||
process.exit(1);
|
||||
}
|
||||
process.exit(code);
|
||||
@@ -108,7 +85,6 @@ async function unstable_spawnDebuggerShellWithArgs(
|
||||
|
||||
const handleTerminationSignal = function (signal: string) {
|
||||
process.on(signal, function signalHandler() {
|
||||
debug('The Signal %s received. killing debugger', signal);
|
||||
if (!child.killed) {
|
||||
child.kill(signal);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user