Propagate executor OS into turn environments (#41207)

## What changed

- Add the optional `platformOs` field to exec-server environment metadata, with
  local exec servers reporting `std::env::consts::OS` and legacy servers
  remaining compatible when the field is absent.
- Preserve the reported OS in each selected turn environment, including the
  local environment.

## Testing

- Extend protocol serialization and environment-selection coverage for remote
  and local platform values.

GitOrigin-RevId: 0f325f6cb83cd8f8c7ec1ce2a4041f45a29e8f38
This commit is contained in:
iceweasel-oai authored and copyberry committed 2026-08-27 21:05:40 +00:00
1 parent 7f135e1314
commit 19321435b1
3 files changed
+26

No files matched your search

@@ -53,6 +53,8 @@ pub(crate) struct TurnEnvironment {
/// Cached from the selected executor; `None` means it did not report them.
pub(crate) temporary_directories: Option<Vec<PathUri>>,
pub(crate) shell: Option<shell::Shell>,
/// OS reported by the selected executor; `None` for legacy executors.
pub(crate) executor_platform_os: Option<String>,
pub(crate) shell_snapshot: ShellSnapshotTask,
pub(crate) shell_snapshot_v2_supported: bool,
}
@@ -72,6 +74,7 @@ impl TurnEnvironment {
user_home_dir: None,
temporary_directories: None,
shell,
executor_platform_os: None,
shell_snapshot: futures::future::ready(None).boxed().shared(),
shell_snapshot_v2_supported: false,
}
@@ -172,6 +175,7 @@ impl std::fmt::Debug for TurnEnvironment {
.field("user_home_dir", &self.user_home_dir)
.field("temporary_directories", &self.temporary_directories)
.field("shell", &self.shell)
.field("executor_platform_os", &self.executor_platform_os)
.field("config", self.config())
.field("config_origin", &self.config_origin)
.finish_non_exhaustive()