Repository navigation
Description
Unit
libobs/obs-nix.c.h: the Linux and BSD system info parsing (the /proc/cpuinfo and dmesg.boot line rules and the memory sizes of the startup log), moved to libobs/obs-nix-system-info.c.h and ported to rust/obs-core as a new module nix_system_info.
Phase and position
Phase 6 (libobs core), one unit of the remaining obs-nix.c.h C; tracking issue #4.
Dependencies and existing tests
No other unit. No real-libobs test covers the system-info log, so a characterization test (test_nix_system_info_steps) lands first, feeding saved cpuinfo and dmesg.boot text and memory values through the moved rules.
Scope
Rust takes over these decisions:
log_processor_info(Linux): which key a line holds (model name,physical id,cpu MHz, compared withstrncmpby prefix length, so a longer key with that prefix also matches); the value after the first:(none when there is no:or nothing after it); the physical id asatoireads it; and when a block is printed (a line that is only\n, with a physical id other than the last one printed);log_processor_speed(FreeBSD): the speed of aCPU:line, from after the last(up to the first-;log_memory_info: the MB values,totalram * mem_unit / 1024 / 1024and(freeram + bufferram) * mem_unit / 1024 / 1024inuint64_t, and OpenBSD'smem / 1024 / 1024inint64_t.
C keeps fopen, getline, fclose and free, every dstr_* copy and trim, sysinfo, sysctl, uname, access, getenv, the flatpak config reads, strlist_split/strlist_free, read_distribution_info, check_path, the X11 log and every blog, each where it is today. The NULL checks (the flatpak none/unknown defaults, which extension lists are logged, the desktop names, the data file search) stay C too: they are pointer checks, as in the canvas rules port (#2544). Everything from the hotkey platform calls on is untouched.
Plan
The standard six commits:
- move;
- characterization test;
- Tier 1 RED;
- GREEN in a
libobs.ported-nix-system-infogroup (Linux ported sources; FreeBSD and OpenBSD build the same list); - Tier 3 parity;
- docs.
Notes
No SIMD, no MSVC traps (no division by a variable, no 128-bit multiply). The core is OS-free and takes byte slices, returning offsets into them, so C keeps its own buffers. atoi overflow is undefined in C, so the parity inputs keep the physical id within int.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 28, 2026
Claiming: #2719.
obs-nix.c.hintolibobs/obs-nix-system-info.c.h(hidden, not EXPORT), behaviour-neutral, checked with a move harness.test_nix_system_info_steps.obs_core::nix_system_infoTier 1 againsttodo!()stubs.libobs.ported-nix-system-info.Decisions:
strlist_split's first field, which stays C.Draft PR with the RED commit expected today.
libobs: Move the Linux system info parsing
test: Characterize the Linux system info parsing
obs-core: Test the nix_system_info port
obs-core: Port the Linux system info parsing
obs-core: Check nix_system_info against the C
docs: Record the nix_system_info port
libobs: Move the Linux system info parsing
test: Characterize the Linux system info parsing
obs-core: Test the nix_system_info port
obs-core: Port the Linux system info parsing
obs-core: Check nix_system_info against the C
docs: Record the nix_system_info port
rdoupe commentedon Oct 28, 2026
Fixed by the PR that ports the Linux system info parsing to Rust (#2721), now merged. The
/proc/cpuinfoanddmesg.bootline rules and the startup-log memory sizes now live in thenix_system_infomodule ofrust/obs-core, with the C shims inlibobs/obs-nix-system-info.c.h. The log output is unchanged.What is left: the plain pointer checks (flatpak defaults, extension lists, desktop names, data file search), the
fopen/getline/sysinfo/sysctlcalls, everyblog, and everything from the hotkey platform calls on stay in C inobs-nix.c.h, as this issue's scope said. Those are host calls and pointer checks, not decisions to port, so no follow-up issue is filed for them. The Phase 6 tracking issue (#444) has no checkbox for this unit, so there was nothing to tick.obs-core: Port the Linux system info parsing (obs-rust#2721)