[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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…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>
5dd6c8b to
d27d08c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #d27d08c] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #d27d08c] Build passed (Build packages) ✅Pipeline on Agent |
✅ [CI Build #d9ea4b0] Build passed (Build macOS tests) ✅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 |
✅ [CI Build #d9ea4b0] Prepare .NET Release succeeded ✅📦 Published NuGet packages (32 packages)iOS
MacCatalyst
macOS
tvOS
Other
Pipeline on Agent |
🔥 [CI Build #d27d08c] Test results 🔥Test results❌ Tests failed on VSTS: test results 1 tests crashed, 0 tests failed, 207 tests passed. Failures❌ dotnettests tests (iOS)🔥 Failed catastrophically on VSTS: test results - dotnettests_ios (no summary found). 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