You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test/cmocka: Run test_graphics_state_stacks_rust on Windows again (LNK2005 on matrix4_*) #2533
#2528 added test_graphics_state_stacks_rust, and on Windows it fails to link (Rust Tier 2 windows-2025-vs2026, run 40401995234):
libobs_rust.lib(obs_graphics-...cgu.4.rcgu.o) : error LNK2005: matrix4_mul already defined in obs.lib(obs.dll)
... matrix4_rotate_aa_i, matrix4_rotate_i, matrix4_scale_i, matrix4_translate3v_i, matrix4_transpose
fatal error LNK1169: one or more multiply defined symbols found
The test calls the matrix4_* exports of obs.dll. The staticlib codegen unit that holds the gs_*_stack_* shims also defines those symbols, so link.exe pulls both. The fix PR skips the target on MSVC to unbreak every PR's Windows lane.
Acceptance: the target builds and runs on windows-2025-vs2026 again, and the AND NOT MSVC guard is removed. Options: have the test reach matrix4 through the staticlib only (don't link the import library's matrix4 symbols); or put the shims in a separate codegen unit or crate; or /FORCE:MULTIPLE if the definitions are known identical (least preferred).
A fourth option to try first, since it's a one-line change: put libobs_rust-static before OBS::libobs in target_link_libraries. link.exe resolves the test's references library by library in command-line order. The gs_*_stack_* shims pull in that codegen unit anyway, and it already defines matrix4_*, so with the staticlib first those symbols resolve there and the __imp_-less matrix4_* members of obs.lib are never pulled. Only the symbols libobs alone provides would come from obs.lib. The catch: if the test also needs obs.dll's own matrix4 state (it doesn't; they are pure functions), this would hide it. I can't claim it until this is /ready.
/ready
Triage: the RED is reproducible: remove the if(NOT MSVC) guard in test/cmocka/tests.d/test_graphics_state_stacks.cmake, and windows-2025-vs2026 fails with LNK2005/LNK1169. The acceptance criteria are in the body, there are no open dependencies, and the choice between the listed options is the worker's. P2, size:S.
Claiming: #2533. Plan: RED drops the MSVC guard (LNK2005 on windows-2025-vs2026); GREEN links libobs_rust-static ahead of OBS::libobs so matrix4_* resolve from the staticlib's codegen unit; falls back to a separate codegen unit if link order isn't enough.
Activity
zackees commentedon Oct 26, 2026
A fourth option to try first, since it's a one-line change: put
libobs_rust-staticbeforeOBS::libobsintarget_link_libraries. link.exe resolves the test's references library by library in command-line order. Thegs_*_stack_*shims pull in that codegen unit anyway, and it already definesmatrix4_*, so with the staticlib first those symbols resolve there and the__imp_-lessmatrix4_*members of obs.lib are never pulled. Only the symbols libobs alone provides would come from obs.lib. The catch: if the test also needs obs.dll's ownmatrix4state (it doesn't; they are pure functions), this would hide it. I can't claim it until this is /ready.zackees commentedon Oct 26, 2026
/ready
Triage: the RED is reproducible: remove the
if(NOT MSVC)guard intest/cmocka/tests.d/test_graphics_state_stacks.cmake, and windows-2025-vs2026 fails with LNK2005/LNK1169. The acceptance criteria are in the body, there are no open dependencies, and the choice between the listed options is the worker's. P2, size:S.zackees commentedon Oct 26, 2026
Claiming: #2533. Plan: RED drops the MSVC guard (LNK2005 on windows-2025-vs2026); GREEN links libobs_rust-static ahead of OBS::libobs so matrix4_* resolve from the staticlib's codegen unit; falls back to a separate codegen unit if link order isn't enough.
test/cmocka: Keep the Linux link order of test_graphics_state_stacks_…
test/cmocka: Keep the Linux link order of test_graphics_state_stacks_…
test/cmocka: Keep the Linux link order of test_graphics_state_stacks_…
test/cmocka: Build test_graphics_state_stacks_rust on MSVC again (RED, …
test/cmocka: Link the Rust staticlib ahead of libobs in test_graphics…
test/cmocka: Keep the Linux link order of test_graphics_state_stacks_…
test/cmocka: Allow the duplicate matrix4_* in test_graphics_state_sta…
test/cmocka: Build test_graphics_state_stacks_rust on MSVC again (RED, …
test/cmocka: Link the Rust staticlib ahead of libobs in test_graphics…
test/cmocka: Keep the Linux link order of test_graphics_state_stacks_…
test/cmocka: Allow the duplicate matrix4_* in test_graphics_state_sta…
test/cmocka: Link test_graphics_state_stacks_rust without /INCREMENTA…
test/cmocka: Build test_graphics_state_stacks_rust on MSVC again (RED, …
test/cmocka: Link the Rust staticlib ahead of libobs in test_graphics…
test/cmocka: Keep the Linux link order of test_graphics_state_stacks_…
test/cmocka: Allow the duplicate matrix4_* in test_graphics_state_sta…
test/cmocka: Link test_graphics_state_stacks_rust without /INCREMENTA…
test/cmocka: Link test_graphics_state_stacks_rust without /WX on MSVC (…
test/cmocka: Run test_graphics_state_stacks_rust on Windows again (ob…