Skip to content

obs-core: port public command-line argument getter (#3976) - #3979

Merged
zackees merged 5 commits into
masterfrom
port/3976-cmdline-getter
Nov 8, 2026
Merged

zackees merged 5 commits into
masterfrom
port/3976-cmdline-getter

Conversation

@zackees

@zackees zackees commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Port the public obs_get_cmdline_args getter to obs-core, preserving the stored count, borrowed argument-table pointer, pointer identity and by-value public ABI. Fixes #3976, a native child of #444.

The safe Rust core copies the two stored values; the thin shim reads the C-owned static through an automatically discovered private adapter. The C setter and shutdown retain allocation ownership and use the accessor so individual-source builds remain valid. No public headers or existing C tests changed, no intentional behavior differences, and no logging or protocol changes. Tier 4 does not apply.

Characterization commit b89d9f9 passes the actual-library C test against both implementations. Extraction commit 8f66942 preserves the original getter body verbatim in its own building commit. RED commit 9b65efc fails all three Tier 1 cases at the stub. GREEN commit e0d5b71 passes all six focused Rust tests, including real-public-header size, alignment and every field offset, plus randomized parity against the original C. Incrementing the copied count kills the differential test; restoration passes, with persistence disabled. The follow-up in 192ac15 fixes the independent-source visibility issue found by local review; GCC and Clang reproduce the failure before the fix and compile the fixed individual source successfully. The same reviewer confirmed the fix and returned clean.

Validation passed: full lint; all 190 native-build tests; all 914 utility tests and both doctests; oracle discovery, per-port native registration, native portability, graph ordering and Rust inventory checks. GCC and Clang pass the touched C source, field adapter, original-C oracle and public characterization with nonliteral format warnings treated as errors. No Rust logging stub is needed.

In the slot's warm Docker build volume, the unchanged command-line characterization and three adjacent core tests pass against both the C reference and hybrid libraries. Loader output identifies each intended library path, and all 1,767 dynamic exports match exactly. The new C characterization executable instrumented with ASan and UBSan also passes against both libraries with leak detection enabled; the libraries themselves are the normal Tier 2 builds.

Test cost: six Rust cases share the existing core category binary; one native registration case uses the existing application category binary. Across 25 reduced-case runs, the longest focused module run was 0.018 seconds and peak RSS was 18,296 KiB. No test-owned threads or additional Rust test executable. The final rebase onto current master preserves all five patches unchanged by range comparison. Verified pushed head: 192ac15.

@zackees
zackees force-pushed the port/3976-cmdline-getter branch from c577664 to 192ac15 Compare November 8, 2026 03:50
@zackees
zackees marked this pull request as ready for review November 8, 2026 03:51
@zackees
zackees enabled auto-merge November 8, 2026 03:51
@zackees
zackees disabled auto-merge November 8, 2026 03:52
@zackees
zackees added this pull request to the merge queue Nov 8, 2026
Merged via the queue into master with commit 78776d7 Nov 8, 2026
42 checks passed
@zackees
zackees deleted the port/3976-cmdline-getter branch November 8, 2026 04:49
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.

rust: Port obs.c command-line argument getter to obs-core

1 participant