Skip to content

GH-107585: fix the stable API .lib file name in debug builds on MSVC #107761

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: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix the libpython ``.lib`` name when targetting the stable ABI in debug
builds on MSVC.
14 changes: 10 additions & 4 deletions PC/pyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,19 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* So MSVC users need not specify the .lib
file in their Makefile (other compilers are
generally taken care of by distutils.) */
# if defined(Py_LIMITED_API)
# define PINNED_VER "3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_Py_ prefixes on the variables, please.

# else
# define PINNED_VER "313"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure exactly how the release manager finds these variables to update them, but we might need to update some of their docs/tools for this change.

# endif /* Py_LIMITED_API */
# if defined(_DEBUG)
# pragma comment(lib,"python313_d.lib")
# elif defined(Py_LIMITED_API)
# pragma comment(lib,"python3.lib")
# define DEBUG_SUFFIX "_d"
# else
# pragma comment(lib,"python313.lib")
# define DEBUG_SUFFIX ""
# endif /* _DEBUG */
# pragma comment(lib, "python" PINNED_VER DEBUG_SUFFIX ".lib")
# undef PINNED_VER
# undef DEBUG_SUFFIX
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
Expand Down