From dd2b8915a0aef64c54832de5bfbf918b3d4004d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Tue, 8 Aug 2023 05:42:45 +0100 Subject: [PATCH 1/2] GH-107585: fix the stable API .lib file name in debug builds on MSVC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- PC/pyconfig.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/PC/pyconfig.h b/PC/pyconfig.h index ac20129cd30fcc..b0a38b5763b965 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -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" +# else +# define PINNED_VER "313" +# 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 */ From 86ce29f2c326342afc85683bd78df8b7eef2d341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Tue, 8 Aug 2023 05:49:00 +0100 Subject: [PATCH 2/2] add news entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- .../next/Build/2023-08-08-05-48-33.gh-issue-107585.GbieTV.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2023-08-08-05-48-33.gh-issue-107585.GbieTV.rst diff --git a/Misc/NEWS.d/next/Build/2023-08-08-05-48-33.gh-issue-107585.GbieTV.rst b/Misc/NEWS.d/next/Build/2023-08-08-05-48-33.gh-issue-107585.GbieTV.rst new file mode 100644 index 00000000000000..49d826f7954122 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2023-08-08-05-48-33.gh-issue-107585.GbieTV.rst @@ -0,0 +1,2 @@ +Fix the libpython ``.lib`` name when targetting the stable ABI in debug +builds on MSVC.