Repository navigation
rust: Fix the Windows Rust tests after the base port - #74
Merged
Merged
Conversation
oracle/base.c includes util/threading.h, which includes <pthread.h> unconditionally. MSVC has no such header, so since the base port the oracle, and every Rust test on Windows, fails to build. libobs uses the pthreads-win32 headers in deps/w32-pthreads; the oracle now adds the same include directory under MSVC. base.c only needs the declarations, so nothing new is linked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The capture helper asserted that dup2 returns the new fd, as POSIX specifies. The MSVC CRT's _dup2 returns 0 on success, so the assert fired while stderr was redirected, the capture worker exited 101 with no message, and default_handler_output_matches_oracle and default_handler_truncates_like_c failed on Windows. Check for -1, the failure value on both. Co-Authored-By: Claude Opus 5.5 <[email protected]>
6 tasks done
zackees
added a commit
to nathan-v/obs-studio
that referenced
this pull request
Oct 10, 2026
With the Windows oracle building again (obs-rust#74), input_matches_oracle found that after a failed _fseeki64 to a negative absolute offset the MSVC CRT reports the read-ahead position from ftell. Both sides return -1; Rust keeps the position as glibc does. Exclude exactly those seeks on Windows and record the difference, with the missing warning log, in rust/README.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
zackees
added a commit
to nathan-v/obs-studio
that referenced
this pull request
Oct 10, 2026
With the Windows oracle building again (obs-rust#74), input_matches_oracle found that after a failed _fseeki64 to a negative absolute offset the MSVC CRT reports the read-ahead position from ftell. Both sides return -1; Rust keeps the position as glibc does. Exclude exactly those seeks on Windows and record the difference, with the missing warning log, in rust/README.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=4e983ccedb846807a02077cc05a59d146f09d896 secs=32 lanes=lint:reused@5d36ef607008,rust-test:reused@3074493bd18f,tier2-linux:run Ci-Attestation: {"at":1791595462,"gate":"rust/all/fmt","host":"linux-x86_64","key":"5d36ef60700855197b6a3487ba30d9a058cc8a7e1d0d434e02b684fbfaf1d065","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":null,"stamp":"f0f69c6e3f3d381eb23f2f9ec617a3f1","tree":"4e983ccedb846807a02077cc05a59d146f09d896","v":1,"via":"reused"} Ci-Attestation: {"at":1791595462,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"5d36ef60700855197b6a3487ba30d9a058cc8a7e1d0d434e02b684fbfaf1d065","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":null,"stamp":"546ceb7b0caedc252147844ea5bef54b","tree":"4e983ccedb846807a02077cc05a59d146f09d896","v":1,"via":"reused"} Ci-Attestation: {"at":1791595462,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"3074493bd18f2e4badafe79b8b74f8fdca0e7bac478903f7641664f61cd76e6d","lane":"rust-test","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":null,"stamp":"17be5dfcd2d56606c798982ecce0b6d2","tree":"4e983ccedb846807a02077cc05a59d146f09d896","v":1,"via":"reused"} Ci-Attestation: {"at":1791595514,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"c7554166c322b61047a86b4f8eaeb3bc369de37ce34216ff49280ac88e0468a4","lane":"tier2-linux","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":32,"stamp":"0657cc12db5997b0c802c686746354d8","tree":"4e983ccedb846807a02077cc05a59d146f09d896","v":1,"via":"run"}
zackees
added a commit
to nathan-v/obs-studio
that referenced
this pull request
Oct 10, 2026
With the Windows oracle building again (obs-rust#74), input_matches_oracle found that after a failed _fseeki64 (one landing before the start of the file) the MSVC CRT reports its read-ahead position from ftell. Both sides return -1; Rust keeps the position as glibc does. On Windows the input comparison checks that -1 and stops there. Record the difference, and the missing warning log on a failed safe save, in rust/README.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=c3d94367712f24d7d5c91b135022e741afe3bc2f secs=59 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791595842,"gate":"rust/all/fmt","host":"linux-x86_64","key":"24f3d05bd68bdb0e09f55baba4fa0abb38fe3f0cd8f5db49fce8f71210b6a322","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":18,"stamp":"8c9adc908548ea56b0e1e9bc5c66f762","tree":"c3d94367712f24d7d5c91b135022e741afe3bc2f","v":1,"via":"run"} Ci-Attestation: {"at":1791595842,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"24f3d05bd68bdb0e09f55baba4fa0abb38fe3f0cd8f5db49fce8f71210b6a322","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":18,"stamp":"493188cebc4077790077358770adff2b","tree":"c3d94367712f24d7d5c91b135022e741afe3bc2f","v":1,"via":"run"} Ci-Attestation: {"at":1791595842,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"3c7953b462dbd13e4dd3585f68be4a583eab871891edd7371e7a5a251d9b8e0c","lane":"rust-test","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":5,"stamp":"265e9a7692dea01b4ed9279d527288ea","tree":"c3d94367712f24d7d5c91b135022e741afe3bc2f","v":1,"via":"run"} Ci-Attestation: {"at":1791595842,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ceb1ea6ce1be68be3446d707dcd81e3d58181b65f2336d78a2106977a283d72b","lane":"tier2-linux","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":36,"stamp":"92449209e9433887a7089cd5cbc44436","tree":"c3d94367712f24d7d5c91b135022e741afe3bc2f","v":1,"via":"run"}
zackees
added a commit
to nathan-v/obs-studio
that referenced
this pull request
Oct 10, 2026
With the Windows oracle building again (obs-rust#74), input_matches_oracle found that after a failed _fseeki64 (one landing before the start of the file) the MSVC CRT reports its read-ahead position from ftell. Both sides return -1; Rust keeps the position as glibc does. On Windows the input comparison checks that -1 and stops there. Record the difference, and the missing warning log on a failed safe save, in rust/README.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=846068ceb4ce53623644a6d6f76113789b287805 secs=46 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791596062,"gate":"rust/all/fmt","host":"linux-x86_64","key":"1ff1ac7098255d5cf3e8021be7dd3a9a061baa18ce164fef4daf3d9e5470f421","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":17,"stamp":"b971b80c320a607f9ad64b222de23c33","tree":"846068ceb4ce53623644a6d6f76113789b287805","v":1,"via":"run"} Ci-Attestation: {"at":1791596062,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"1ff1ac7098255d5cf3e8021be7dd3a9a061baa18ce164fef4daf3d9e5470f421","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":17,"stamp":"4bfd1204384cb186fbf111d942cdd04d","tree":"846068ceb4ce53623644a6d6f76113789b287805","v":1,"via":"run"} Ci-Attestation: {"at":1791596062,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"3be0c8529254be8774b9a8579f61befe128fccc5c85114b5dda01084881fab9a","lane":"rust-test","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":6,"stamp":"0d195605179bed01194869868c96fba3","tree":"846068ceb4ce53623644a6d6f76113789b287805","v":1,"via":"run"} Ci-Attestation: {"at":1791596062,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"0c2410ef76c54391fa734354f270d7525fc6a06d038e932f585464ebc89229f6","lane":"tier2-linux","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":23,"stamp":"25e6b45eab11646af495c06d5ee5df9e","tree":"846068ceb4ce53623644a6d6f76113789b287805","v":1,"via":"run"}
zackees
added a commit
to nathan-v/obs-studio
that referenced
this pull request
Oct 10, 2026
With the Windows oracle building again (obs-rust#74), input_matches_oracle found that after a failed _fseeki64 (one landing before the start of the file) the MSVC CRT reports its read-ahead position from ftell. Both sides return -1; Rust keeps the position as glibc does. On Windows the input comparison checks that -1 and stops there. Record the difference, and the missing warning log on a failed safe save, in rust/README.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=846068ceb4ce53623644a6d6f76113789b287805 secs=46 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791596062,"gate":"rust/all/fmt","host":"linux-x86_64","key":"1ff1ac7098255d5cf3e8021be7dd3a9a061baa18ce164fef4daf3d9e5470f421","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":17,"stamp":"b971b80c320a607f9ad64b222de23c33","tree":"846068ceb4ce53623644a6d6f76113789b287805","v":1,"via":"run"} Ci-Attestation: {"at":1791596062,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"1ff1ac7098255d5cf3e8021be7dd3a9a061baa18ce164fef4daf3d9e5470f421","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":17,"stamp":"4bfd1204384cb186fbf111d942cdd04d","tree":"846068ceb4ce53623644a6d6f76113789b287805","v":1,"via":"run"} Ci-Attestation: {"at":1791596062,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"3be0c8529254be8774b9a8579f61befe128fccc5c85114b5dda01084881fab9a","lane":"rust-test","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":6,"stamp":"0d195605179bed01194869868c96fba3","tree":"846068ceb4ce53623644a6d6f76113789b287805","v":1,"via":"run"} Ci-Attestation: {"at":1791596062,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"0c2410ef76c54391fa734354f270d7525fc6a06d038e932f585464ebc89229f6","lane":"tier2-linux","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":23,"stamp":"25e6b45eab11646af495c06d5ee5df9e","tree":"846068ceb4ce53623644a6d6f76113789b287805","v":1,"via":"run"}
zackees
added a commit
to nathan-v/obs-studio
that referenced
this pull request
Oct 10, 2026
With the Windows oracle building again (obs-rust#74), input_matches_oracle found that after a failed _fseeki64 (one landing before the start of the file) the MSVC CRT reports its read-ahead position from ftell. Both sides return -1; Rust keeps the position as glibc does. On Windows the input comparison checks that -1 and stops there. Record the difference, and the missing warning log on a failed safe save, in rust/README.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=af6c1d467e1551e44394ac0ed933a49ee8329732 secs=32 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791596249,"gate":"rust/all/fmt","host":"linux-x86_64","key":"5e67410701c0f219a0353f5909b9e19624ab671790cfe92bd95264cef509c915","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":11,"stamp":"6701613336c9f29cbb91278474f4fcd4","tree":"af6c1d467e1551e44394ac0ed933a49ee8329732","v":1,"via":"run"} Ci-Attestation: {"at":1791596249,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"5e67410701c0f219a0353f5909b9e19624ab671790cfe92bd95264cef509c915","lane":"lint","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":11,"stamp":"2f3333d9e4d59c9c82dec892e444a51d","tree":"af6c1d467e1551e44394ac0ed933a49ee8329732","v":1,"via":"run"} Ci-Attestation: {"at":1791596249,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"8b92eab9448ac56fdcfad134d08ffba37ef650d57839c60e1910570f28bbd8d5","lane":"rust-test","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":4,"stamp":"0f1e4a0b1c725df9a339a74fad37f151","tree":"af6c1d467e1551e44394ac0ed933a49ee8329732","v":1,"via":"run"} Ci-Attestation: {"at":1791596249,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"8f2b1bafa720af13850ed75a3310309eeaaca37a317f94d3d3286b1217a3f817","lane":"tier2-linux","parents":["3c251ccbef791f1df303faef0fe0faa95c4aa0ef"],"secs":17,"stamp":"50cbc822a6b4e74feab4fd1ed6645af9","tree":"af6c1d467e1551e44394ac0ed933a49ee8329732","v":1,"via":"run"}
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.
Description
Two fixes that make the Rust tests build and pass on Windows again after #61.
rust/obs-c-oracle/build.rs: findpthread.hwith MSVC.oracle/base.cincludesutil/threading.h, which includes<pthread.h>unconditionally:Under MSVC the oracle now adds
deps/w32-pthreadsto its include path, the same headers libobs builds against.base.conly needs the declarations, so nothing new is linked. Non-MSVC builds are unchanged.rust/obs-util/tests/base_parity.rs: accept the MSVCdup2return value. The capture helper asserteddup2(fd, 1) == 1. POSIXdup2returns the new fd, but the MSVC CRT's_dup2returns 0. The assert fired while stderr was redirected, so the capture worker exited 101 with no message, anddefault_handler_output_matches_oracleanddefault_handler_truncates_like_cfailed. It now checks!= -1, the failure value on both.Motivation and Context
Since #61 merged,
obs-c-oraclefails to compile on Windows, so every PR's "Rust Tests (windows)" job fails, #73 included. The samepthread.herror is behind #68's Windows failure (see #68 (comment)).How Has This Been Tested?
Windows 11, MSVC 14.44, soldr 0.9.31:
soldr cargo test --workspacefails buildingobs-c-oracle(C1083). With only fix 1, the twobase_paritycapture tests fail. Running the worker by hand shows it exits 101 with no output.soldr cargo test --workspacepasses all 25 test binaries.python ci/local_gate.py --lane lintpasses.Types of changes
Checklist:
🤖 Generated with Claude Code