sentry-dotnet: MAUI MacCatalyst Apps have a `default.profraw` generated inside the .app bundle when the app exits
Package
Sentry
.NET Flavor
.NET
.NET Version
8.0.0
OS
macOS
SDK Version
4.0.0-beta.4
Self-Hosted Sentry Version
No response
Steps to Reproduce
- dotnet new maui
- Add Sentry, configure it for a MAUI project
- Build/Debug the MacCatalyst target
- Quit the app (IMPORTANT: Quit it gracefully, do not terminate it)
- Observe in the
bin/Debug/net8.0-maccatalyst/MauiApp1.appbundle there should be adefault.profrawfile now - Make a change to some c# and/or xaml in the app
- Build/Debug MacCatalyst target again
- Observe a build error which complains about codesigning and unsigned contents in bundle, ultimately pointing at the
default.profrawfile.
Expected Result
This file should not get created at least in this location.
Actual Result
File gets created, causing subsequent incremental builds to fail.
Video: https://github.com/getsentry/sentry-dotnet/assets/271950/bae02c29-aaa3-42e2-86b0-8322ec208d0f
Sample/Repro project: Archive.zip
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Comments: 17 (15 by maintainers)
Thanks a lot @akoeplinger !! Great to have you contribute here, come again 😃
So this is definitely coming from sentry-cocoa since
nmshows this symbol:This static initializer is used to hook up profiling (INSTR_PROF_PROFILE_RUNTIME_VAR is ___llvm_profile_runtime): https://github.com/llvm/llvm-project/blob/2b1c76c7c4d62f4470fe1527bf239f380c19760a/compiler-rt/lib/profile/InstrProfilingRuntime.cpp#L23
Seems this is enabled via the
-fprofile-instr-generateflag when compiling LLVM https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#compiling-with-coverage-enabledIt looks like sentry-native builds with that if RUN_ANALYZER env var is set: https://github.com/getsentry/sentry-native/blob/0b17731c74e40202dea2e10b6c4aec8d6e66a1cd/tests/cmake.py#L152-L155
Did you perhaps pick the binary from the build that enables this instead of the normal one? https://github.com/getsentry/sentry-native/blob/0b17731c74e40202dea2e10b6c4aec8d6e66a1cd/.github/workflows/ci.yml#L74-L80