From e97ba4c690613d734843db218aeedce2f0e5937f Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Mon, 28 May 2018 12:32:05 -0700 Subject: [PATCH] bpo-33614: Ensures module definition files for the stable ABI on Windows are correctly regenerated. (GH-7165) --- .../2018-05-28-11-40-22.bpo-33614.28e0sE.rst | 2 ++ PCbuild/find_msbuild.bat | 10 +++++++++- PCbuild/python3dll.vcxproj | 20 +++++++++++++++---- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2018-05-28-11-40-22.bpo-33614.28e0sE.rst diff --git a/Misc/NEWS.d/next/Build/2018-05-28-11-40-22.bpo-33614.28e0sE.rst b/Misc/NEWS.d/next/Build/2018-05-28-11-40-22.bpo-33614.28e0sE.rst new file mode 100644 index 00000000000..9091c282ad0 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-05-28-11-40-22.bpo-33614.28e0sE.rst @@ -0,0 +1,2 @@ +Ensures module definition files for the stable ABI on Windows are correctly +regenerated. diff --git a/PCbuild/find_msbuild.bat b/PCbuild/find_msbuild.bat index 1877906e00a..24f5e2fb5d4 100644 --- a/PCbuild/find_msbuild.bat +++ b/PCbuild/find_msbuild.bat @@ -47,5 +47,13 @@ @exit /b 1 :found -@echo Using %MSBUILD% (found in the %_Py_MSBuild_Source%) +@pushd %MSBUILD% >nul 2>nul +@if not ERRORLEVEL 1 @( + @if exist msbuild.exe @(set MSBUILD="%CD%\msbuild.exe") else @(set MSBUILD=) + @popd +) + +@if defined MSBUILD @echo Using %MSBUILD% (found in the %_Py_MSBuild_Source%) +@if not defined MSBUILD @echo Failed to find MSBuild @set _Py_MSBuild_Source= +@if not defined MSBUILD @exit /b 1 diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj index c66c8ef141a..0ef7780248f 100644 --- a/PCbuild/python3dll.vcxproj +++ b/PCbuild/python3dll.vcxproj @@ -89,14 +89,18 @@ - + <_DefLines Remove="@(_DefLines)" /> <_Lines Remove="@(_Lines)" /> + <_OriginalLines Remove="@(_OriginalLines)" /> + + + <_Pattern1>(=python$(MajorVersionNumber)$(MinorVersionNumber))\. <_Sub1>$1_d. @@ -109,17 +113,23 @@ - + + - + <_DefLines Remove="@(_DefLines)" /> <_Lines Remove="@(_Lines)" /> + <_OriginalLines Remove="@(_OriginalLines)" /> + + + <_Pattern>^[\w.]+=.+?\.([^ ]+).*$ <_Sub>$1 @@ -132,6 +142,8 @@ <_Lines Include="@(_Symbols->'%(Symbol)')" /> - + + \ No newline at end of file