Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use xcodebuild archive to build sentry-cocoa #2960

Merged
merged 3 commits into from Dec 8, 2023

Conversation

akoeplinger
Copy link
Contributor

Fixes #2954

Without the "archive" command xcodebuild will build with code coverage enabled (-fprofile-instr-generate is passed to clang) and that links in the compiler profiling runtime. This is evidenced by the __llvm_profile_runtime symbol being present in the Sentry binary with nm. The static initializer will hook up profiling and we get a default.profraw file when the app exits.

The fix is to use the "archive" command instead, similar to how upstream sentry-cocoa uses it here: https://github.com/getsentry/sentry-cocoa/blob/ddb47781bffd76406f31ab43e66760362585fcd7/Makefile#L82-L83

Fixes getsentry#2954

Without the "archive" command xcodebuild will build with code coverage enabled (`-fprofile-instr-generate` is passed to clang) and that links in the compiler profiling runtime.
This is evidenced by the `__llvm_profile_runtime` symbol being present in the `Sentry` binary with `nm`. The static initializer will hook up profiling and we get a `default.profraw` file when the app exits.

The fix is to use the "archive" command instead, similar to how upstream sentry-cocoa uses it here: https://github.com/getsentry/sentry-cocoa/blob/ddb47781bffd76406f31ab43e66760362585fcd7/Makefile#L82-L83
@bruno-garcia
Copy link
Member

@akoeplinger

Could add to CHANGELOG.md below ## Unreleased:

### Fixes

- Stop Sentry for MacCatalyst from creating `default.profraw` in the app bundle using xcodebuild archive to build sentry-cocoa ([#2960](https://github.com/getsentry/sentry-dotnet/pull/2960))

@bruno-garcia
Copy link
Member

Thanks a lot for finding the culprit and fixing the problem!!

@akoeplinger
Copy link
Contributor Author

Hmm looks like it's is now building for macOS instead of Catalyst :)

I'll have another look tomorrow.

@bruno-garcia
Copy link
Member

Hmm looks like it's is now building for macOS instead of Catalyst :)

I'll have another look tomorrow.

Oh, we build sentry-native for macOS (+Win/Linux). And sentry-cocoa for iOS and Catalyst (and use ObjSharpie etc)

@akoeplinger
Copy link
Contributor Author

Figured out the issue, we need to use generic/ prefix for the destination arg...

@vaind vaind merged commit d3de3c8 into getsentry:main Dec 8, 2023
18 checks passed
@akoeplinger akoeplinger deleted the fix-sentry-cocoa branch December 8, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MAUI MacCatalyst Apps have a default.profraw generated inside the .app bundle when the app exits
3 participants