Skip to content

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

Open
zicowarn wants to merge 2 commits into
mesonbuild:masterfrom
zicowarn:fix14429
Open

fix(dependencies:python): Use python{vernum}_d.lib in MSVC debug builds#14445
zicowarn wants to merge 2 commits into
mesonbuild:masterfrom
zicowarn:fix14429

Conversation

@zicowarn

@zicowarn zicowarn commented Apr 3, 2025

Copy link
Copy Markdown

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
@dabrain34

Copy link
Copy Markdown
Contributor

maybe you can squash the commit Fix a writing mistake with the previous one.

Do you think you could create a unit test to validate this fix ?

@bonzini bonzini added this to the 1.11.3 milestone Jul 26, 2026
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

3 participants