|
| 1 | +# Windows Build Fix Summary |
| 2 | + |
| 3 | +## Problem |
| 4 | +GitHub Actions Windows builds were failing with linker errors during Python extension compilation. |
| 5 | + |
| 6 | +## Investigation Process |
| 7 | + |
| 8 | +### Initial Error Analysis |
| 9 | +Examined workflow run logs showing 7 unresolved SLEEF DFT symbols: |
| 10 | +- `__imp_Sleef_malloc` |
| 11 | +- `__imp_Sleef_free` |
| 12 | +- `__imp_SleefDFT_double_init1d` |
| 13 | +- `__imp_SleefDFT_double_execute` |
| 14 | +- `__imp_SleefDFT_float_init1d` |
| 15 | +- `__imp_SleefDFT_float_execute` |
| 16 | +- `__imp_SleefDFT_dispose` |
| 17 | + |
| 18 | +### Root Cause Identification |
| 19 | +The `__imp_` prefix indicated Windows linker was expecting DLL import symbols, not static library symbols. This revealed: |
| 20 | + |
| 21 | +1. **vcpkg's rubberband** on Windows is built expecting SLEEF as a DLL |
| 22 | +2. **Our static triplet** (`x64-windows-static-msvc-release.cmake`) tries to link everything statically |
| 23 | +3. **Fundamental incompatibility**: rubberband.lib references SLEEF with DLL import symbols even when SLEEF static libraries are present |
| 24 | + |
| 25 | +This is a **vcpkg packaging limitation**, not a build system configuration issue. |
| 26 | + |
| 27 | +## Solution Implemented |
| 28 | + |
| 29 | +### Commit 1: f234ec3 - Platform-specific library dependencies |
| 30 | +Added Windows system libraries required by FFmpeg when statically linking: |
| 31 | +- `ws2_32`: Winsock2 networking |
| 32 | +- `secur32`: Security Support Provider (SSPI/TLS) |
| 33 | +- `bcrypt`: Cryptography API |
| 34 | +- `mfuuid`, `strmiids`: Media Foundation GUIDs |
| 35 | +- `ole32`: Component Object Model |
| 36 | + |
| 37 | +Also added: |
| 38 | +- Linux: `pthread` and `libstdc++` for FFmpeg and rubberband C++ code |
| 39 | +- SLEEF DFT library detection (conditional on rubberband being found) |
| 40 | + |
| 41 | +### Commit 2: 78c2f7a - Remove rubberband from Windows |
| 42 | +After determining rubberband cannot be statically linked on Windows: |
| 43 | +- Changed vcpkg.json platform filters from `"!linux"` to `"osx"` |
| 44 | +- Affects: rubberband and sleef packages |
| 45 | +- Created documentation: WINDOWS_RUBBERBAND_REMOVAL.md |
| 46 | + |
| 47 | +## Impact |
| 48 | + |
| 49 | +### Functionality Changes |
| 50 | +- ✅ Windows builds will succeed |
| 51 | +- ❌ Windows loses rubberband time-stretch and pitch-shift effects |
| 52 | +- ✅ Core aubio functionality unchanged (onset, pitch detection, tempo, MFCC, etc.) |
| 53 | +- ✅ macOS retains full rubberband support |
| 54 | +- ✅ Linux unaffected (already didn't have rubberband) |
| 55 | + |
| 56 | +### Platform Matrix |
| 57 | +| Platform | Rubberband | Time-stretch | Pitch-shift | |
| 58 | +|----------|-----------|--------------|-------------| |
| 59 | +| Windows | ❌ | Dummy impl | Dummy impl | |
| 60 | +| macOS | ✅ | Full support | Full support| |
| 61 | +| Linux | ❌ | Dummy impl | Dummy impl | |
| 62 | + |
| 63 | +## Technical Details |
| 64 | + |
| 65 | +### Why Not Fix vcpkg? |
| 66 | +Fixing this properly would require: |
| 67 | +1. Modifying vcpkg's rubberband port |
| 68 | +2. Ensuring SLEEF builds without DLL import expectations |
| 69 | +3. Testing across multiple Windows configurations |
| 70 | +4. Contributing changes upstream |
| 71 | +5. Waiting for vcpkg release cycle |
| 72 | + |
| 73 | +This is outside the scope of immediate CI fixes. |
| 74 | + |
| 75 | +### Why Not Use Dynamic Linking? |
| 76 | +- Defeats purpose of portable Python wheels |
| 77 | +- Requires bundling DLLs |
| 78 | +- Increases package size and complexity |
| 79 | +- Makes distribution error-prone |
| 80 | + |
| 81 | +### Why Not Use MinGW? |
| 82 | +- MSVC is the standard Windows toolchain |
| 83 | +- Better compatibility with vcpkg packages (especially FFmpeg) |
| 84 | +- Would require significant build system rework |
| 85 | + |
| 86 | +## Files Modified |
| 87 | + |
| 88 | +1. **vcpkg.json**: Platform filters for rubberband and sleef |
| 89 | +2. **python/meson.build**: Windows system library dependencies |
| 90 | +3. **meson.build**: SLEEF DFT library detection |
| 91 | +4. **WINDOWS_RUBBERBAND_REMOVAL.md**: Detailed rationale documentation |
| 92 | + |
| 93 | +## Verification |
| 94 | + |
| 95 | +Expected build behavior: |
| 96 | +1. vcpkg skips rubberband/sleef installation on Windows |
| 97 | +2. Meson detects rubberband as "not found" |
| 98 | +3. `HAVE_RUBBERBAND` not defined in config.h |
| 99 | +4. Dummy timestretch/pitchshift implementations compile |
| 100 | +5. Python extension links successfully with FFmpeg system libraries |
| 101 | +6. Wheels build and package correctly |
| 102 | + |
| 103 | +## Future Work |
| 104 | + |
| 105 | +If rubberband on Windows becomes critical: |
| 106 | +- Investigate vcpkg rubberband port modifications |
| 107 | +- Consider contributing fix to vcpkg upstream |
| 108 | +- Or implement alternative pure-Python time-stretching solution |
0 commit comments