From 92aa676aeb8d290650730348f325b3cfafe9aadc Mon Sep 17 00:00:00 2001 From: Krystof Woldrich <31292499+krystofwoldrich@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:32:36 +0200 Subject: [PATCH] fix(react-native): Fix RN 0.75 node binary build fail (#2131) --- .npmignore | 2 +- bin/sentry-cli-dev | 19 +++++++++++++++++++ src/commands/mod.rs | 1 - 3 files changed, 20 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..ea44cd54ed --- /dev/null +++ b/bin/sentry-cli-dev @@ -0,0 +1,19 @@ +#!/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);