From 7f34028a19c98edea0f67354b2db0982fa8cf4a8 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Mon, 26 Aug 2024 23:23:18 +0200 Subject: [PATCH 1/2] fix(react-native): Fix RN 0.75 node binary build fail --- .npmignore | 2 +- bin/sentry-cli-dev | 20 ++++++++++++++++++++ src/commands/mod.rs | 1 - 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 bin/sentry-cli-dev diff --git a/.npmignore b/.npmignore index ac6de3b5d8..b758a43b1d 100644 --- a/.npmignore +++ b/.npmignore @@ -5,7 +5,7 @@ !package.json !README.md !LICENSE -!bin +!bin/sentry-cli !js !scripts/install.js !checksums.txt diff --git a/bin/sentry-cli-dev b/bin/sentry-cli-dev new file mode 100755 index 0000000000..12de864665 --- /dev/null +++ b/bin/sentry-cli-dev @@ -0,0 +1,20 @@ +#!/usr/bin/env node + + +'use strict'; + +const childProcess = require('child_process'); +const path = require('path'); + +const child = childProcess + .spawn(path.join(__dirname, "../target/debug/sentry-cli"), process.argv.slice(2), { + stdio: 'inherit', + }) + .on('error', (err) => { + console.error(err); // eslint-disable-line no-console + process.exit(1); + }) + .on('exit', (code) => process.exit(code)); + +process.on('SIGTERM', () => child.kill('SIGTERM')); +process.on('SIGINT', () => child.kill('SIGINT')); diff --git a/src/commands/mod.rs b/src/commands/mod.rs index c125bc4f22..d9b8c7658f 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -95,7 +95,6 @@ fn preexecute_hooks() -> Result { #[cfg(target_os = "macos")] fn sentry_react_native_xcode_wrap() -> Result { if let Ok(val) = env::var("__SENTRY_RN_WRAP_XCODE_CALL") { - env::remove_var("__SENTRY_RN_WRAP_XCODE_CALL"); if &val == "1" { crate::commands::react_native::xcode::wrap_call()?; return Ok(true); From c298870c95eb4054c73f14b11397b5301ec2dc59 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Tue, 27 Aug 2024 10:59:14 +0200 Subject: [PATCH 2/2] fix lint --- bin/sentry-cli-dev | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/sentry-cli-dev b/bin/sentry-cli-dev index 12de864665..ea44cd54ed 100755 --- a/bin/sentry-cli-dev +++ b/bin/sentry-cli-dev @@ -1,13 +1,12 @@ #!/usr/bin/env node - 'use strict'; const childProcess = require('child_process'); const path = require('path'); const child = childProcess - .spawn(path.join(__dirname, "../target/debug/sentry-cli"), process.argv.slice(2), { + .spawn(path.join(__dirname, '../target/debug/sentry-cli'), process.argv.slice(2), { stdio: 'inherit', }) .on('error', (err) => {