Skip to content

build: preserve native C++ language standards in the shared test graph - #1844

Merged
zackees merged 7 commits into
masterfrom
infra/1332-native-language-standards
Oct 23, 2026
Merged

zackees merged 7 commits into
masterfrom
infra/1332-native-language-standards

Conversation

@zackees

@zackees zackees commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Refs #1332. Fixes #1849. Add typed ISO C++17/C++20 settings to the shared native model and its Cargo/cc::Build and CMake consumers. Apply the setting only to C++/Objective-C++ compilation; C retains its own mode. CMake requires the requested standard and disables extensions, matching OBS's compiler configuration.

Migrate six unchanged Qt-free C++ tests to the graph: disk-space monitor, scene-collection migration, crash-sentinel directory, settings migration, output-start logging and unclean launch. Preserve original source order, includes, libraries (including Threads for disk-space), commands and platform availability. Track frontend utility headers and the three indirect PCH headers under frontend/build/.

Current graph: 158 definitions: 138 core, 12 graphics, 6 VLC, 2 WHIP. A literal scan still finds 218 independent executable declarations; loops and other directories also need migration. No existing C/C++ test or public header changes, new test binary, workflow file or worktree.

RED → GREEN

  • bafc7a9b3: actual mixed C/C++20 executable contract fails with unknown graph field cpp_standard. 6b6ed3a0d tightens the extension-property assertion after review, rejecting unset values as well as extensions being enabled. The fixture's C++20 constructs and ISO-mode check require actual compiler support; C remains independently compiled and linked.
  • 8420b1a95: helper-inventory contract fails with missing canonical test_disk_space_monitor.
  • 3c0fb41f8: indirect-input contract fails because the disk-space PCH path is absent from watches.
  • 36ad39446: typed standard support, six migrations and exact PCH input watches make all six focused graph contracts pass. Both parsers reject numeric, empty, unknown and boolean standard values.

Validation

  • Six focused graph contracts pass, including real mixed C/C++20 compilation and execution through both consumers and metadata/source/link/watch checks for all six helpers.
  • Clippy with libobs-integration and ./lint pass. Same single primary review clean; its extension-assertion finding was fixed.
  • 300 unchanged native core/graphics executions pass, zero skips, matching the current graph's exact case names for both C-reference and Rust-hybrid variants. This includes all six new C++ helpers against both cores.
  • All 158 canonical targets compile through CMake; all 150 core/graphics CMake cases pass, zero skips/failures. Case names independently match the graph.
  • The three PCH watches were added after the full runtime run. This scheduling-metadata-only follow-up does not change compiled behavior; the six focused contracts and full lint pass afterward.

Evidence: /tmp/obs-1332-cpp-standard-{red,green}.log, /tmp/obs-1332-cpp-helpers-red.log, /tmp/obs-1332-cpp-pch-watch-red.log, /tmp/obs-1332-cpp-standards-{contracts-green,clippy,lint}.log, /tmp/obs-1332-cpp-native-validation.log, independently checked /tmp/obs-1332-cpp-evidence-summary.json.

Hosted Windows fixture correction — d7966e46d

Windows Rust job 120153013224 on 36ad39446 exposed an unintended C11 requirement in the new generated fixture: MSVC's unchanged default C mode rejects _Static_assert. The compiler argv and stack confirm the failure occurs in answer.c, before C++ compilation. Existing production/native tests are unaffected.

A strict-C89 syntax check reproduces the failure locally. d7966e46d replaces the fixture assertion with a portable typedef array bound, retaining the __cplusplus guard, integer-width assertion, ISO C++20 constructs and both consumer checks. Strict C89, the actual mixed-language contract, formatting and the same primary review pass. Logs: /tmp/obs-1332-cpp-c-mode-{red,green,contract-green,fmt}.log; hosted failure: /tmp/obs-1332-cpp-ci-windows-rust-failure.log. Current-head Windows CI remains required; the earlier full lint/runtime evidence covers the unchanged implementation.

Windows parity isolation blocker — 23049778a

On d7966e46d, Windows job 120156380454 passed both new C++ contracts, including actual mixed C/C++20 compilation/execution. A separate utility test then failed: safe_write_matches_the_c_file, with existing target / tmp extension / no backup / no marker, C true and Rust false. Utility suite: 698 passed, one failed. Stack and logs are retained in /tmp/obs-1332-cpp-ci-windows-d796-failure.log.

Investigation found that this replacement test ran directly alongside process-spawning tests, contrary to the testing policy's explicit Windows inherited-C-stdio-handle isolation requirement. #1849 records the observed failure and diagnosis limits. 23049778a wraps this existing test in the repository's exact-selector child helper. Its entire 64-case oracle/file-content matrix is unchanged; no retries, skips, production behavior changes, public headers or new binary.

The existing parity case passes locally through the child helper; Clippy, formatting and the same primary review pass. Evidence: /tmp/obs-1332-safe-write-isolation-{green,clippy,fmt}.log. Current-head Windows CI remains required. Full native build/runtime evidence above still covers the unchanged implementation.

Remaining scope

Local native execution above is Linux evidence. Current-head PR CI and the normal merge queue remain required. The full issue still needs the remaining C++/Qt/scripting/generated-input model, non-Linux Cargo test/application orchestration, complete configuration/cache evidence and packaged saved-profile validation. CMake remains authoritative; this PR does not complete #1332.

@zackees

zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

GREEN pushed as 36ad39446ac53cc147ded143b88947faf135d176; following current-head CI https://github.com/obs-rust/obs-studio/actions/runs/39873063770.

Local evidence: six focused graph contracts, Clippy and full lint pass; 300 native core/graphics executions against both cores pass with zero skips, all 158 canonical targets compile via CMake, and all 150 CMake core/graphics cases pass with zero skips/failures. Exact runtime case names match the current graph. Three indirect PCH watches were added afterward as scheduling metadata and covered by focused contracts/lint. Same single primary review is clean.

Holding the branch unchanged for PR CI, then the normal merge queue; next implementation follows after this PR lands. No admin merge. CMake remains authoritative and #1332 stays open.

@zackees

zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Pushed fixture-only fix d7966e46d for Windows Rust job 120153013224: _Static_assert required C11 even though this contract intentionally retains C's existing mode. MSVC defaults exposed the mistake. The generated fixture now uses a portable typedef assertion; its C-language guard and actual C++20 behavior checks remain intact. No production code, existing C/C++ tests, headers or compiler policy changed.

The exact strict-C89 RED reproduces the issue; corrected strict C89 and the actual mixed-language contract pass locally. Formatting and the same primary review pass. Current-head CI will verify Windows. Holding implementation unchanged for the normal merge gate.

@zackees

zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Pushed 23049778a in #1844. Windows job 120156380454 on the preceding head passed the new language-standard/helper contracts, then hit the separate safe-write parity failure recorded in this issue.

The existing safe-write parity case now uses common::isolated with its exact module selector, as required by the testing policy. All 64 combinations and all oracle/file-content assertions remain intact; no retries/skips or production changes. The same case passes locally, Clippy and formatting pass, and the same primary review is clean. Following current-head Windows CI for native confirmation.

@zackees

zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Native Windows confirmation on 23049778a: job 120160576131 passed. safe_write_matches_the_c_file passed with its exact-selector child guard; the full utility suite passed 699 tests with zero failures. The application category also passed 52 tests, including both new C++ contracts, and Clippy passed.

Log retained at /tmp/obs-1332-cpp-ci-2304-windows-rust.log. No assertions, combinations, retries or skips changed. #1844 still awaits the remaining required platform jobs before normal merge queue admission.

@zackees
zackees marked this pull request as ready for review October 23, 2026 00:23
@zackees
zackees added this pull request to the merge queue Oct 23, 2026
@zackees

zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Current-head PR CI passed on 23049778a31bdaa66ccb3180920d56272a634b80: https://github.com/obs-rust/obs-studio/actions/runs/39875088263.

Windows passed both new C++ contracts, the isolated safe-write parity case, all 699 utility tests and Clippy. Native Windows compatibility passed four runs of 189 cases each; macOS passed four runs of 214 each. Rust/macOS and cross-platform lint passed. These component checks use existing CMake-compiled compatibility executables; they are not complete Cargo application proof.

Marked ready and entered the normal merge queue at position 4. Holding this head unchanged for merged-result validation. No admin merge. #1849 awaits landing; #1332 remains open and CMake remains authoritative.

Merged via the queue into master with commit a901385 Oct 23, 2026
31 checks passed
@zackees
zackees deleted the infra/1332-native-language-standards branch October 26, 2026 15:45
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.

test: isolate safe-write parity from concurrent Windows process spawns

1 participant