[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 3 commits 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>
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.
🔥 [PR Build #68d6c60] Build failed (Build macOS tests) 🔥Build failed for the job 'Build macOS tests' (with job status 'Failed') Pipeline on Agent |
🔥 [CI Build #68d6c60] Test results 🔥Test results❌ Tests failed on VSTS: test results 3 tests crashed, 2 tests failed, 191 tests passed. Failures❌ dotnettests tests (macOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ monotouch tests (iOS)1 tests failed, 17 tests passed.Failed tests
Html Report (VSDrops) Download ❌ Tests on macOS Sonoma (14) tests🔥 Failed catastrophically on VSTS: test results - mac_sonoma (no summary found). Html Report (VSDrops) Download ❌ Tests on macOS Sequoia (15) tests🔥 Failed catastrophically on VSTS: test results - mac_sequoia (no summary found). Html Report (VSDrops) Download ❌ Tests on macOS Tahoe (26) tests🔥 Failed catastrophically on VSTS: test results - mac_tahoe (no summary found). Html Report (VSDrops) Download Successes✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS testsLinux Build VerificationPipeline on Agent |
🔥 [PR Build #5dd6c8b] Build failed (Detect API changes) 🔥Build failed for the job 'Detect API changes' (with job status 'Failed') Pipeline on Agent |
|
🔥 Unable to find the contents for the comment: D:\a\1\s\change-detection\results\gh-comment.md does not exist :fire Pipeline on Agent |
🔥 [PR Build #5dd6c8b] Build failed (Build packages) 🔥Build failed for the job 'Build packages' (with job status 'Failed') Pipeline 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