expo / sentry-expo

MIT License
202 stars 83 forks source link

Use NODE_BINARY as per https://github.com/getsentry/sentry-react-native/pull/2805 #379

Open jmatsushita opened 8 months ago

jmatsushita commented 8 months ago

Checklist

Why

When running a build from XCode, if the node path is non standard (for instance set with a nix develop environment) the expected path should be set in .xcode.env or .xcode.env.local and scripts should use $NODE_BINARY instead of node. @sentry/react-native already implemented this here https://github.com/getsentry/sentry-react-native/pull/2805 so this expo wrapper should also use $NODE_BINARY.

How

Replace the 2 instances of node by $NODE_BINARY.

Test Plan

Tested locally.

jmatsushita commented 8 months ago

Unfortunately that's not enough because @sentry/cli's bin script has a node shebang https://github.com/getsentry/sentry-cli/issues/421

EDIT: fixed with the commit below.

jmatsushita commented 8 months ago

Note: this should only be an issue when node is not installed globally.

In order for the @sentry/cli shebang line to work #!/usr/bin/env node we need to call the script with node in the path. We do this by adding dirname $NODE_BINARY to the PATH when calling @sentry/cli.