Repository navigation
util: Move os_mkdirs into platform-mkdirs.c - #1445
Merged
Merged
Conversation
Refs obs-rust#262 (slice 4, directories). Behavior-neutral extraction before the Rust port: os_mkdirs and its static recursive_mkdir move verbatim from libobs/util/platform.c.h into libobs/util/platform-mkdirs.c.h, in the same libobs.platform unity group and precompiled header. The oracle compiles both files. No host conditionals move. test_platform_mkdirs characterizes os_mkdirs, which test_platform only uses for setup: missing and partly existing parents, existing paths, '\' and mixed separators, trailing and doubled slashes, non-ASCII names and a file at the path or in a parent. Two cases are characterized, not endorsed: a file at the path reports MKDIR_EXISTS, and "a/b/" with "a" missing creates both directories but reports MKDIR_EXISTS. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Windows and macOS proof from the stacked port #1446, whose head (
Marking ready. |
swilk19
marked this pull request as ready for review
October 19, 2026 00:36
zackees
approved these changes
Oct 19, 2026
zackees
left a comment
Member
There was a problem hiding this comment.
Coordinator review: LGTM. A verbatim move of os_mkdirs/recursive_mkdir into platform-mkdirs.c.h with its unity group and PCH entry, plus a characterization test (missing parents, an existing path, a file in the way) that pins today's C behavior before #1446.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #262 (slice 4, directories).
Behavior-neutral extraction, as the testing policy asks before a partial-file port:
os_mkdirsand its staticrecursive_mkdirmove verbatim fromlibobs/util/platform.c.hintolibobs/util/platform-mkdirs.c.h. No Rust, no signature, header or behavior change.libobs.platformunity group andlibobs-platform.pch.h.rust/obs-c-oracle/oracle/platform.cincludes it too (os_mkdirswas already renamedoracle_os_mkdirsthere), so the oracle still runs the real C.New characterization test
test_platform_mkdirs(tests.d/fragment, plus the Cargo C-test manifest).test_platformonly usesos_mkdirsfor setup, so this covers missing and partly existing parents, existing paths,\and mixed separators, trailing and doubled slashes, a non-ASCII name, and a file at the path or in a parent. Two cases are characterized, not endorsed:MKDIR_EXISTS;a/b/withamissing creates both directories but reportsMKDIR_EXISTS(the lastos_mkdirofa/b/findsa/b).Local: Tier 2 (
rust/tools/linux-validate/run.sh) has the new cases passing against bothlibobsandlibobs-with-rust, and exported symbols C vs Rust are IDENTICAL (1766)../lint: build-groups, ifdef ratchet, clang-format and gersemi pass. The only failure istest_appimage_vaapi_compat, which also fails on master in my WSL environment.Windows/macOS: PR CI scopes this Linux-only (
ci_scope:windows=False, macos=False). The stacked port PR touchesrust/obs-util/src/platform/, so its CI runs Windows and macOS Tier 2, which builds plainlibobswith this moved file under MSVC and runstest_platform_mkdirs. I'll keep this as a draft until that passes and link the run here. The Rust port (RED, then GREEN) is that follow-up PR.🤖 Generated with Claude Code