Repository navigation
Phase 2: finish cmocka suite (os_path, serializer, darray) + CI + Windows/macOS Tier 2 - #10
Merged
Merged
Conversation
…core (#5) - path_extension: safe core + os_get_path_extension shim. NULL path returns NULL (C dereferences it); intentional, documented difference. - array_serializer: safe ArrayOutput core + C ABI shim for the three exported functions; write/seek/get_pos stay private callbacks. - darray: safe DArray + #[repr(C)] struct darray mirror under the header-inline exemption (layout is the contract, nothing exported). - Tier 1 1:1 ports of test_os_path/test_serializer/test_darray, layout tests for struct darray/serializer/array_output_data, and proptest parity against oracle_* builds of the original C (shim and safe core). - Test-only bmalloc/brealloc/bfree linked whole-archive into the oracle. - ENABLE_RUST_LIBOBS=ON drops util/array-serializer.c and util/path-extension.c; linux-validate checks both objects. Refs #5
- Windows: /EXPORT: options from libobs/cmake/rust-exports.txt so obs.dll
exports the Rust shims; export_list.rs keeps the list in sync with the
#[unsafe(no_mangle)] shims.
- macOS: ld64 -unexported_symbols_list hides Rust internals.
- rust/tools/tier2-validate/validate.{sh,ps1}: cmocka OFF/ON plus an
exported-symbol diff on macOS and Windows.
- build-project.yaml (existing workflow only): rust-tests on Linux,
macOS and Windows via setup-soldr + soldr cargo, rust-linux-tier2 and
rust-tier2 jobs.
Refs #5
…ork path on macOS (#5) - obs-c-oracle build.rs: drop canonicalize(), whose verbatim \\?\ path broke MSVC include resolution (C1083 on util/bitstream.c). - rust-linux-tier2: fetch-depth 0 so versionconfig.cmake finds a tag. - tier2-validate/validate.sh: set DYLD_FRAMEWORK_PATH for ctest so the cmocka tests load the built libobs.framework.
…tree (#5) A worktree's .git file and its submodules' gitdir links resolve only on the host, so git describe in versionconfig.cmake failed in the container.
…a tests (#5) ctest runs each test from its own directory, so the relative framework path did not resolve.
…test (#5) macOS: DYLD_LIBRARY_PATH to the obs-deps lib dir (libavcodec etc.). Windows: obs.dll, w32-pthreads.dll and obs-deps FFmpeg DLL dirs on PATH, since the cmocka executables are built apart from them.
…rts (#5) With ENABLE_RUST_LIBOBS=ON the Rust staticlib's compiler_builtins defines ___isOSVersionAtLeast and ___isPlatformVersionAtLeast, which libobs then exported, so nm -gU differed from the C build (Tier 2 macOS).
This was referenced Oct 9, 2026
Closed
Merged
Merged
6 of 7 tasks
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 #5
Phase 2 of the Rust port testing roadmap. It finishes the existing cmocka suite (os_path, serializer, darray), adds CI, and adds Windows/macOS Tier 2.
Commits (kept separate, as #5 decides)
os_get_path_extensionverbatim fromutil/platform.ctoutil/path-extension.c, which is always compiled. Behavior-neutral; no Rust.struct darray/struct serializer/struct array_output_data, and proptest parity againstoracle_*C builds.ENABLE_RUST_LIBOBS=ONdropsarray-serializer.candpath-extension.c./EXPORT:list (rust-exports.txt, kept in sync byexport_list.rs), macOS-unexported_symbols_list,rust/tools/tier2-validate/validate.{sh,ps1}, and three jobs added to the existingbuild-project.yaml(no new workflow file).ninja -t inputs libobsinstead offindon the persistent/buildvolume, where a stale pre-guardarray-serializer.c.ocaused a false failure.Decisions (recorded in #5)
os_get_path_extension(NULL)returns NULL in Rust. C hits UB (strlen(NULL)). Intentional, documented.zackees/setup-soldrpinned by SHA,cache: false, thensoldr cargo test/clippy/fmt), per the approved rule and AGENTS.md.RED -> GREEN (per port)
todo!()-> Tier 1path_extension0/6 passed (RED). Restored -> all pass. Mutation (drop the'\\'separator arm) ->path_extension_parityboth proptests fail.grow_capacity,reserve,ensure_capacity,resize,push_back(_array),clear,free,erase,pop_back,findstubbed -> Tier 1darray0/9 anddarray_parity0/1 (RED). Restored -> pass. Mutation (capacity * 3growth) ->darray_ops_match_cfails.seek_type_from_c,seek_target,plan_write,ArrayOutput::{write,get_pos,seek,reset}stubbed -> Tier 1array_serializer0/12 (RED); the parity binary aborts. Restored -> pass. Mutations:seek_target>->>=fails the shim parity.get_posreturningcur_posoriginally survived, because parity only drove the shim. The parity proptest now also drives the safeArrayOutputcore against the oracle, and that mutation now fails (core after GetPos).Verification (local, Linux x86_64)
soldr cargo test --workspace: all green (incl. path_extension*, darray*, array_serializer*, export_list, bitstream*)soldr cargo clippy --workspace --all-targets -- -D warnings: clean;soldr cargo fmt --all --check: cleanrust/tools/linux-validate/run.sh: cmocka 4/4 OFF and ON; OFF haspath-extension.c.o; ON has no bitstream/array-serializer/path-extension objects; exported symbols IDENTICAL (1752)clang -std=c11 -Wall -Wextra -pedanticclean.Not run locally (no macOS/Windows host): covered by the new CI jobs
rust/tools/tier2-validate/validate.sh(Xcode + Corrosion,nm -gUOFF vs ON)rust/tools/tier2-validate/validate.ps1with vcpkg cmocka (windows-ci-x64,/EXPORT:list)/std:c11