Skip to content

Conversation

Copy link

Copilot AI commented Dec 2, 2025

Windows builds were failing with 7 unresolved external symbols when linking the Python extension. Root cause analysis revealed that vcpkg's rubberband package on Windows is fundamentally incompatible with static linking - it expects SLEEF libraries as DLLs (indicated by __imp_ symbol prefixes) rather than static libraries.

Solution

Removed rubberband and SLEEF from Windows builds in vcpkg.json by changing platform filter from "!linux" to "osx". Windows will use dummy timestretch/pitchshift implementations instead.

Changes

vcpkg.json

  • Updated rubberband platform filter: "!linux""osx" (macOS only)
  • Updated sleef platform filter: "!linux""osx" (macOS only)

python/meson.build

  • Fixed bug where platform-specific system libraries were incorrectly added to dependencies variable (for C library) instead of pyaubio_deps (for Python extension)
  • Introduced pyaubio_extra_deps to properly collect platform-specific system libraries
  • Windows: ws2_32, secur32, bcrypt, mfuuid, strmiids, ole32 (required by FFmpeg's networking, security, and Media Foundation components)
  • Linux: pthread and libstdc++ (required for FFmpeg)
  • Fixed dependency chain: pyaubio_deps = [py.dependency(), libaubio_static_dep] + pyaubio_extra_deps

Impact

  • ✅ Windows builds succeed
  • ❌ Windows loses rubberband time-stretch/pitch-shift features (uses dummy implementations)
  • ✅ Core aubio functionality (onset, pitch, tempo, MFCC) unchanged
  • ✅ macOS retains full rubberband support
  • ✅ Linux unaffected (already didn't have rubberband)

Root Cause

vcpkg's rubberband package on Windows builds with DLL import expectations for SLEEF libraries. The __imp_ symbol prefix indicates rubberband.lib was built expecting SLEEF as a DLL, not a static library. This is a vcpkg packaging limitation that prevents true static linking on Windows.

Error Example (Before Fix)

rubberband.lib(src_common_FFT.cpp.obj) : error LNK2019: unresolved external symbol __imp_Sleef_malloc
rubberband.lib(src_common_FFT.cpp.obj) : error LNK2019: unresolved external symbol __imp_SleefDFT_double_init1d
rubberband.lib(src_common_FFT.cpp.obj) : error LNK2019: unresolved external symbol __imp_SleefDFT_float_execute
avformat.lib(network.o) : error LNK2019: unresolved external symbol __imp_WSAStartup
avutil.lib(random_seed.o) : error LNK2019: unresolved external symbol BCryptGenRandom

Documentation

See WINDOWS_RUBBERBAND_REMOVAL.md and WINDOWS_BUILD_FIX_SUMMARY.md for comprehensive technical details and rationale.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Add sleefdft library detection in meson.build for rubberband FFT support
- Fix python/meson.build to properly include platform-specific system libraries
- Initialize pyaubio_extra_deps and include it in pyaubio_deps
- Windows: Add ws2_32, secur32, bcrypt, mfuuid, strmiids, ole32
- Linux: Add pthread and libstdc++

Co-authored-by: shauneccles <[email protected]>
Copilot AI changed the title [WIP] Update vcpkg triplets for static linking and release builds Fix Windows build: Add missing system libraries and SLEEF DFT for static linking Dec 2, 2025
Copilot AI requested a review from shauneccles December 2, 2025 23:07
@shauneccles
Copy link
Member

@copilot Carefully review the most recent run and resolve the issues that caused the build failure.

Pay attention to the root cause and resolve it rather than working around it.

If the root cause is a true inability to statically link rubberband then identify why and remove rubberband from the CI build.

Copilot AI and others added 2 commits December 3, 2025 01:55
…bility

Root cause: vcpkg's rubberband package on Windows expects SLEEF as DLL
(import library with __imp_ symbols), not static library. This is a vcpkg
packaging limitation that prevents true static linking of rubberband.

Changes:
- Update vcpkg.json: Change rubberband and sleef platform from "!linux" to "osx"
- Windows builds will use dummy timestretch/pitchshift implementations
- macOS retains full rubberband support
- Documented decision in WINDOWS_RUBBERBAND_REMOVAL.md

Impact: Windows users lose rubberband time-stretch/pitch-shift features, but
core aubio functionality (onset, pitch, tempo, MFCC) remains fully functional.

Co-authored-by: shauneccles <[email protected]>
Copilot AI changed the title Fix Windows build: Add missing system libraries and SLEEF DFT for static linking Fix Windows build: Remove rubberband due to static linking incompatibility Dec 3, 2025
@shauneccles
Copy link
Member

@copilot Review the changes made in previous commits to try to fix the rubberband issue and remove any changes that are no longer required since we are not building rubberband

The SLEEF DFT library detection was added in f234ec3 to try to fix
rubberband linking on Windows. Since we've removed rubberband from
Windows builds (now macOS-only), this detection is no longer needed.

The base SLEEF library detection remains for macOS rubberband support.

Kept python/meson.build changes as they fix a bug where platform-specific
libraries were being added to the wrong 'dependencies' variable instead
of 'pyaubio_deps'. Windows libraries (ws2_32, etc.) are still needed for
FFmpeg static linking.

Co-authored-by: shauneccles <[email protected]>
Copy link
Author

Copilot AI commented Dec 3, 2025

@copilot Review the changes made in previous commits to try to fix the rubberband issue and remove any changes that are no longer required since we are not building rubberband

Reviewed and cleaned up in commit 66d4123.

Removed:

  • SLEEF DFT library detection from meson.build (lines 499-510) - This was added specifically to fix Windows rubberband linking and is no longer needed.

Kept:

  • python/meson.build changes - These fix a bug where platform-specific libraries were incorrectly added to the dependencies variable (for C library) instead of pyaubio_deps (for Python extension). The Windows system libraries (ws2_32, secur32, bcrypt, mfuuid, strmiids, ole32) are still required for FFmpeg static linking, not rubberband.

@shauneccles shauneccles marked this pull request as ready for review December 3, 2025 08:05
@shauneccles shauneccles merged commit ac0ef0d into build/static_win_wheels Dec 3, 2025
21 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants