Skip to content

test: Fix Windows effect parser comparison symbol ownership - #3604

Merged
zackees merged 3 commits into
masterfrom
fix/effect-parser-windows-import
Nov 4, 2026
Merged

zackees merged 3 commits into
masterfrom
fix/effect-parser-windows-import

Conversation

@zackees

@zackees zackees commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Fixes #3603.

test_effect_parser_blocks_rust fails Windows Tier 2 with LNK2005/LNK1169 because the executable loads both the import thunk and the Rust static definition of gs_effect_get_param_by_name. This PR makes its public lookup explicitly import from obs.dll, leaving the private parser shims in the production Rust staticlib. The Rust lookup implementation remains the owner of the hybrid DLL export; the C implementation remains the owner in libobs-c-reference. No /FORCE, removed definitions, changed public headers, or changed existing C test assertions.

Cause, verified with git show and the actual failed log:

  • master RED job, SHA 355af2a: LNK2005 in the obs-graphics cgu.5 object, then LNK1169 for test_effect_parser_blocks_rust.exe and validate.ps1:112.
  • 761da5f1c (libobs: Move the effect parser blocks to own file #3561) introduced the C characterization target. It did not add this Rust staticlib link.
  • 60b38b116 (obs-graphics: Port the effect parser blocks #3595) added test/cmocka/tests.d/test_effect_parser_blocks.cmake:19-34: this new executable compiles libobs/graphics/effect-parser.c.h and links OBS::libobs before libobs_rust-static. The direct public lookup call is libobs/graphics/effect-parser.c.h:1544, inside ep_compile_pass_shaderparams. Even though the test deliberately avoids device compilation at runtime, the reference exists at link time.
  • The Rust codegen object extracted for private shims also defines the public lookup at rust/obs-graphics/src/ffi/effect_lookups.rs:173. The C counterpart is libobs/graphics/effect-lookups.c.h:59, included in the C reference's libobs/build/libobs.ported-graphics+.h.c:7. That C source is already excluded from production hybrid libobs; removing its definition or the Rust definition would misdiagnose the import-thunk collision.

Gate blind spot and owner recommendation:

  • PR run 41755762522: Tier 2 jobs skipped. PR run 41758460868: native Tier 2 skipped; Linux Tier 2 build was still running when inspected, so “every Tier 2 job skipped” is not accurate for that run.
  • .github/workflows/build-project.yaml:3080 selects Windows Tier 2 via check-event.outputs.windows and the CI-mode skip. It does not universally forbid pull_request. ci/ci_scope.py:414-423,472-473 escalates shared core changes to both native platforms only on push to master. ci/ci_scope.py:114-116,313-321 also treats C++ test registrations as shared, but not these C test registrations. PRs and merge groups therefore miss this MSVC-only link failure. push.yaml:4-11 only triggers branch pushes for master and release/**; an ordinary fix branch push does not run Push at all.
  • Recommendation: make the existing Windows Rust-with-C Tier 2 comparison required on merge_group for shared core / linked Rust / C cmocka changes that select Tier 2. Running it once per existing merge batch makes MSVC linking observable before master moves, without adding it to every PR update or reducing batching. Preserve both complete OFF/ON modes, the final gate dependency, cache/proof rules and all current checks. A separate Windows-Tier-2 scope output can avoid unnecessarily selecting the Windows Rust-test job too. The smallest code-only alternative is extending core_master_push_lanes to merge_group, but that also selects both native platforms and their Rust-test lanes, so its cost is broader. A registration-only rule for C targets linking libobs_rust-static would catch obs-graphics: Port the effect parser blocks #3595 but would leave later core-only codegen-object changes exposed; it is insufficient as the complete prevention policy. The workflow budgets 25 minutes for Windows Tier 2, described in its comment as a 10–15 minute lane. Owner decision requested; this recurring native-runner policy expansion is not implemented here. The Windows-named support source in this fix selects the existing native lane without changing policy.

Validation:

  • RED commit 372c808: uv run --no-project python -m unittest discover -s ci -p test_effect_parser_windows_link.py -v fails because the COFF binary does not import the public lookup from obs.dll. LLVM accepts the original competing-definition layout and prefers the static definition, unlike the observed MSVC failure; this probe checks ownership and is not native MSVC proof.
  • GREEN commits 5f81807 and 514ffef: the same COFF test passes (0.5–0.7 s), builds the real test-only bridge, links both definitions without /FORCE, and verifies that the resulting PE imports the public lookup from obs.dll. The small DATA import library supplies only the import address slot, not a conflicting function thunk. The bridge and import library are linked only into this test executable.
  • Focused cmocka CI checks, clang-format 22.1.3, gersemi 0.25.0 and git diff --check pass. Independent clud-review: clean (one reviewer). ./lint also passed (668.0 s).
  • Native MSVC GREEN: Windows Tier 2 job 126344929100, PR head 514ffef, conclusion success, including “Validate Tier 2 on Windows (libobs C vs with Rust)”. The job log shows test_effect_parser_blocks_rust passing in all four harness runs (CMake OFF/ON and Cargo OFF/ON), all 400 tests passing in each run, and both export comparisons IDENTICAL (1795 symbols). This is the native Windows result, not an inference from Linux.
  • Native RED: the verified master job 126335713064 is linked above. No branch RED native run was obtained: the RED commit changes only ci/, and push.yaml does not run Push on ordinary fix branches. The GREEN Windows support source selected native Tier 2 on the PR under existing policy.
  • No Rust behavior is changed, so existing Tier 1/Tier 3 suites remain applicable unchanged; unchanged Tier 2 tests exercise the fix. Tier 4 is not applicable to a test-link configuration change.

@zackees
zackees marked this pull request as ready for review November 4, 2026 02:35
@zackees
zackees added this pull request to the merge queue Nov 4, 2026
Merged via the queue into master with commit f7610b4 Nov 4, 2026
47 checks passed
@zackees
zackees deleted the fix/effect-parser-windows-import branch November 4, 2026 02:50
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.

bug: cmocka: effect parser Rust comparison fails Windows linking with LNK2005

1 participant