Skip to content

fix(dependencies:python): Use python{vernum}_d.lib in MSVC debug builds #14445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zicowarn
Copy link

@zicowarn zicowarn commented Apr 3, 2025

Fixes incorrect linking to Python release libraries (python313.lib) when building debug targets with MSVC on Windows. This ensures compatibility with debug Python interpreters (e.g. python_d.exe) and resolves runtime crashes.

Details:

  • Modified get_windows_link_args in dependencies/python.py to select debug libraries based on build type and Python library suffix (_d.dll).
  • Added debug logging to validate library selection.

Fixes: #14429

Fixes incorrect linking to Python release libraries (python313.lib) when building
debug targets with MSVC on Windows. This ensures compatibility with debug Python
interpreters (e.g. python_d.exe) and resolves runtime crashes.

Details:
- Modified `get_windows_link_args` in `dependencies/python.py` to select debug
  libraries based on build type and Python library suffix (_d.dll).
- Added debug logging to validate library selection.

Fixes: mesonbuild#14429
@zicowarn zicowarn requested a review from jpakkane as a code owner April 3, 2025 02:16
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.

Incorrect Python Library Linking in Debug Builds on Windows (MSVC): Should Use python{vernum}_d.lib
1 participant