getsentry / sentry-docs

Sentry's documentation (and tools to build it)
https://docs.sentry.io
Other
326 stars 1.43k forks source link

Sentry CLI installed via Homebrew, used in Xcode Build Phase gives 'not installed' message (iOS SDK) #7597

Open sebj opened 1 year ago

sebj commented 1 year ago

Core or SDK?

Platform/SDK

Which part? Which one?

iOS SDK

Description

In the page 'Uploading Debug Symbols', the section 'Xcode Build Phase' lists two different script options which can be copy-pasted into a new Xcode build phase. It seems like if sentry-cli has been installed via Homebrew (which is listed in its documentation as one of the installation methods) on an Apple Silicon Mac, the scripts will log a warning/error that sentry-cli is not installed (even though it's accessible from Terminal)

Suggested Solution

SwiftLint's Xcode build phase documentation section mentions the following, which I think might be applicable to Sentry (at least, it fixed Sentry's script issue for me!), and could be mentioned in the Uploading Debug Symbols page:

If you installed SwiftLint via Homebrew on Apple Silicon, you might experience this warning:

warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint

That is because Homebrew on Apple Silicon installs the binaries into the /opt/homebrew/bin folder by default. To instruct Xcode where to find SwiftLint, you can either add /opt/homebrew/bin to the PATH environment variable in your build phase

if [[ "$(uname -m)" == arm64 ]]; then
    export PATH="/opt/homebrew/bin:$PATH"
fi

// ...

or you can create a symbolic link in /usr/local/bin pointing to the actual binary:

ln -s /opt/homebrew/bin/swiftlint /usr/local/bin/swiftlint
getsantry[bot] commented 1 year ago

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] commented 1 year ago

Routing to @getsentry/product-owners-sdks-mobile for triage ⏲️

kahest commented 1 year ago

Hi @sebj, thanks for reporting this & the suggested solution!