Skip to content

util: Move platform-file and profiler-io host branches into host files (#874) - #2419

Merged
zackees merged 4 commits into
masterfrom
util/874-platform-file-host
Oct 25, 2026
Merged

zackees merged 4 commits into
masterfrom
util/874-platform-file-host

Conversation

@zackees

@zackees zackees commented Oct 25, 2026

Copy link
Copy Markdown
Member

Closes #874.

This moves the last 6 host conditionals in libobs/util/platform-file.c.h (5) and profiler-io.c.h (1) into host files. #2016 already removed the seventh.

Changes

  • platform-file-host-windows.c.h holds the MSVC-CRT bodies of os_wfopen, os_fopen, os_stat, os_fseeki64 and os_ftelli64. platform-file-host-posix.c.h holds the UTF-8/fseeko/ftello ones.
  • profiler-io.c.h now calls a private profiler_gzopen (declared in util/profiler-io-host.h, not exported). profiler-io-host-windows.c.h (gzopen_w) and profiler-io-host-posix.c.h (gzopen) implement it.
  • The host files compile in the existing C-only groups libobs.ported-windows-platform+ and libobs.ported-posix+, which have the same build set as ported-platform+ and ported-profiler-io+. The PCHs gain zlib.h and the private header.
  • Oracle: oracle/platform.c and oracle/profiler_io.c include the matching host bodies, and profiler_gzopen is renamed to oracle_profiler_gzopen.
    • The MinGW concern raised on the issue: windows-gnu takes the Windows bodies, since MinGW's CRT provides _wfopen, _fseeki64 and _ftelli64. So the oracle keeps oracle_os_fopen there, and it now matches real Windows libobs.
  • Ratchet: ci/platform-ifdef-baseline.json drops both files, 6 findings in all.

Evidence

  • RED (test: ... (RED, #874)): ci/test_libobs_util_facade.py fails 3 new cases on master. GREEN: they pass.
  • Cross-compile: cmake/cross/docker.sh win-x64 mac-arm64 exits 0. ported-windows-platform+, ported-posix+, ported-platform+ and ported-profiler-io+ all compiled.
    • This ran before the last commit, which changed profiler_gzopen's return type. This PR's Cross Compile job covers the final tree.
  • Tier 3: soldr cargo test -p obs-util --lib -- platform_file profiler_io in a clean clone: 78 passed, 0 failed. That covers platform_file_parity and the profiler-io parity tests against the oracle.
    • The first oracle build caught a type mismatch with the oracle's zlib shim. Fixed in util: profiler_gzopen returns zlib's gzFile.
  • Tier 2: PR CI's Linux lanes, Rust OFF and ON. I didn't run it locally, to keep the shared machine's load down.

@zackees
zackees enabled auto-merge October 25, 2026 19:48
@zackees

zackees commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

Coordinator review: the POSIX and Windows bodies are the old branches moved out unchanged, and profiler_gzopen keeps gzopen_w on Windows and gzopen elsewhere.

One behaviour note, which looks intended and is worth confirming: os_wfopen used to branch on _MSC_VER, not _WIN32, so a MinGW build took the UTF-8 + fopen path. With the Windows host file chosen per OS, MinGW now gets _wfopen. That's better (wide paths work), but it is a change for any MinGW consumer, not only the oracle. A line in the body or the ledger would cover it. Otherwise this looks good: the ratchet baseline shrinks, and the facade test goes RED → GREEN.

@zackees

zackees commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

Coordinator: the Windows Rust Tests failure here (test-diff: FAILED (3221225621), which is STATUS_INTEGER_OVERFLOW) is the audio_min_ts_parity crash on MSVC from #2406, not this PR. #2420 fixes it and is queued. Rebase after it merges.

@zackees

zackees commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

CI status: both failures look unrelated to this PR.

I'll rebase once #2420 merges and recheck the Linux test.

@zackees
zackees force-pushed the util/874-platform-file-host branch from 8d4a3cb to a434973 Compare October 25, 2026 20:41
@zackees
zackees added this pull request to the merge queue Oct 25, 2026
Merged via the queue into master with commit 7992b0b Oct 25, 2026
38 checks passed
@zackees
zackees deleted the util/874-platform-file-host branch October 26, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

facade: libobs/util/platform.c and profiler-io.c: move 7 platform conditionals into platform-<os> files

1 participant