#5970 [Other] add opt-in Rust strata-sysinfo crate for WMI-free OS facts

open · @stuchapin909 · 0 comments · View on GitHub

WindowsLinux

Description

## Problem
strata_control/sysinfo.py avoids Python 3.12's blocking WMI platform.uname() calls by reading environment variables and sys.getwindowsversion(). Providing an opt-in native Rust probe (crates/strata-sysinfo) lets Windows callers and future native tooling read OS version (RtlGetVersion), architecture, processor, and computer name (GetComputerNameW) directly without WMI or a Python runtime, while keeping strata_control/sysinfo.py's pure-Python fallback intact when the binary is not built.

## Changes
- Added crates/strata-sysinfo (std-only Rust crate + JSON CLI binary, Windows RtlGetVersion/GetComputerNameW FFI without WMI).
- Wired strata_control/sysinfo.py to use crates/strata-sysinfo/target/release/strata-sysinfo.exe (or STRATA_SYSINFO_BIN) when present on unmocked Windows, falling back to pure Python otherwise.

## Validation
- **Passed:**
  - cargo test in crates/strata-sysinfo: 3 passed, 0 failed.
  - cargo clippy --all-targets -- -D warnings: 0 warnings.
  - python -m unittest tests/terminal/test_sysinfo.py -v: 10 passed, 0 failed.
  - Differential check (strata-sysinfo.exe vs pure-Python sysinfo): exact JSON field-for-field match on Windows 11 (10.0.26300, AMD64, 32.33 ms cold).
- **Failed:** None.
- **Not run:** Linux/macOS builds and full 	ests/terminal suite outside 	est_sysinfo.py.

Related on this site

Quick links to related pages.