[runtime] Initialize the output directory for crash reports before loading CoreCLR. Fixes #25820#25823
[runtime] Initialize the output directory for crash reports before loading CoreCLR. Fixes #25820#25823rolfbjarne wants to merge 1 commit into
Conversation
…ading CoreCLR. Set DOTNET_CrashReportRootPath to <NSCachesDirectory> before calling coreclr_initialize, so that CoreCLR knows where to write crash reports. A new xamarin_is_sandboxed() function detects whether the app is sandboxed: - On iOS/tvOS it returns true unconditionally (always sandboxed). - On macOS/Mac Catalyst it queries the com.apple.security.app-sandbox entitlement using SecTaskCopyValueForEntitlement. For non-sandboxed apps, the bundle identifier is appended to the caches path to keep the directory app-specific (sandboxed apps already get an app-specific caches directory from the OS). The environment variable is not overwritten if already set. Fixes #25820 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ [PR Build #b34c3c6] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #b34c3c6] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [PR Build #b34c3c6] Build passed (Build macOS tests) ✅Pipeline on Agent |
🔥 [CI Build #b34c3c6] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 30 tests failed, 198 tests passed. Failures❌ dotnettests tests (macOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ fsharp tests2 tests failed, 2 tests passed.Failed tests
Html Report (VSDrops) Download ❌ introspection tests4 tests failed, 2 tests passed.Failed tests
Html Report (VSDrops) Download ❌ linker tests (tvOS)21 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ xcframework tests2 tests failed, 2 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
CoreCLR can write crash reports to a configurable directory via the
DOTNET_CrashReportRootPathenvironment variable. This PR sets that variable beforecoreclr_initializeis called, pointing it at<NSCachesDirectory>-- a writable location that is not backed up by iCloud.A new
xamarin_is_sandboxed()helper detects whether the current process is sandboxed by querying thecom.apple.security.app-sandboxentitlement viaSecTaskCopyValueForEntitlement. On iOS/tvOS it returnstrueunconditionally. For non-sandboxed desktop apps (macOS, Mac Catalyst), the bundle identifier is appended to the caches path so each app gets its own directory.Ref: dotnet/runtime#128738
Fixes #25820
🤖 Pull request created by Copilot