mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-18 12:03:00 +00:00
[PR #1704] [MERGED] [FIX] cargo tests failing on windows #2419
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/1704
Author: @hrideshmg
Created: 6/26/2025
Status: ✅ Merged
Merged: 6/29/2025
Merged by: @prateekmedia
Base:
master← Head:windows_cargo_fix📝 Commits (1)
c7eea7efix: cargo tests failing on windows📊 Changes
5 files changed (+85 additions, -76 deletions)
View changed files
📝
src/rust/lib_ccxr/src/time/timing.rs(+19 -10)📝
src/rust/lib_ccxr/src/time/units.rs(+6 -16)📝
src/rust/src/lib.rs(+57 -39)📝
src/rust/src/libccxr_exports/time.rs(+2 -1)📝
src/rust/src/parser.rs(+1 -10)📄 Description
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Cargo tests have been failing on Windows on the master branch for a while now. The primary reason seems to be differences in linking behaviour between the GNU and MSVC ABIs, see here for more info.
The main issue was that when running unit tests, the linker that MSVC uses couldn't resolve several external C symbols, primarily these. This makes sense as when running unit tests, the C side of the codebase never comes into play. To address this, I added a
cfg_ifblock that provides mock implementations during test runs so that the tests can run without requiring linkage to C symbols.I also noticed that there was an extern declaration in
lib_ccxrforMPEG_CLOCK_FREQUENCY, after consulting with @steel-bucket I realized that this is was an oversight as thelib_ccxrcrate is meant to be a clean idiomatic rust layer. To fix this, I added a new field to GLOBAL_TIMING_INFO and ensured the MPEG clock frequency is passed explicitly through FFI.With these changes, all unit tests now run successfully on Windows. This should help with fixing any windows specific bugs in upcoming PRs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.