Skip to content

Initialize the output directory for crash reports before loading coreclr. #25820

Description

@rolfbjarne

Set DOTNET_CrashReportRootPath=... before loading CoreCLR.

Ref: #128738.

Criteria:

  • The location should not be automatically backed up (iCloud).
  • The location must be writable.

Which means there are two main candidates:

  • NSTemporaryDirectory
  • NSCachesDirectory

It's not documented as such, but the wording on Apple's site seems to indicate NSTemporaryDirectory is cleared more often than NSCachesDirectory, so we're choosing the latter, NSCachesDirectory.

For all sandboxed apps, this is an app-specific directory, we can set it as-is.

For non-sandboxed apps (which only happens on desktop), we need to use NSCachesDirectory/<CFBundleIdentifier>

This seems like the best way to detect if we're running in a sandbox or not: https://stackoverflow.com/a/47105177/183422

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions