Skip to main content

platform_defaults

Function platform_defaults 

Source
pub fn platform_defaults(
    platform: RunnerPlatform,
    runtime: &Path,
    inherited: &Inherited,
    exists: impl Fn(&Path) -> bool,
) -> Vec<(&'static str, OsString)>
Expand description

The variables platform sets for a runner whose attempt directory is runtime, before runner.env is applied.

  • macOS: PATH with each of MACOS_TOOL_DIRECTORIES that exists (exists) and is not already listed put in front, when any is; LANG as MACOS_DEFAULT_LANG when the daemon has no locale.
  • Windows: USERPROFILE and HOME at <runtime>\home, and APPDATA and LOCALAPPDATA under it, as a logged-in profile lays them out. The directories are the caller’s to create. Per attempt rather than shared, so one job’s caches and configuration cannot reach the next job, and they go when the attempt’s directory goes. Most of .NET’s known-folder APIs (Environment.GetFolderPath) ask Windows rather than these variables and still answer with the service account’s profile. Local application data is the exception: measured on Windows 11, it follows USERPROFILE, while roaming application data and the profile itself do not.
  • Linux: HOME at <runtime>/home when the daemon’s own HOME cannot be written (Inherited::home_writable); nothing otherwise. A login service’s HOME is the operator’s, and stays theirs.

Then, on every platform, POWERSHELL_TELEMETRY_OPTOUT unless the daemon sets it.