diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-03-11 11:38:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 11:38:18 (GMT) |
commit | d01c5507e5f9bd5072d94f007d29b37f41c6e6b5 (patch) | |
tree | 99a292983f1e3e954bc20209278de0d8cf7b968c | |
parent | 6ce36ed4a7b731d186e03c88c8c9c057b1cd0e18 (diff) | |
download | cpython-d01c5507e5f9bd5072d94f007d29b37f41c6e6b5.zip cpython-d01c5507e5f9bd5072d94f007d29b37f41c6e6b5.tar.gz cpython-d01c5507e5f9bd5072d94f007d29b37f41c6e6b5.tar.bz2 |
bpo-39930: Ensure vcruntime140.dll is included in all Windows packages (GH-18918)
Also adds GitHub CI test for Windows installer changes
(cherry picked from commit 2dd41740c97bd77695ddcc590caa7f53e76dc35a)
Co-authored-by: Steve Dower <steve.dower@python.org>
-rw-r--r-- | .github/workflows/build_msi.yml | 34 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rst | 2 | ||||
-rw-r--r-- | PCbuild/pyproject.props | 21 | ||||
-rw-r--r-- | PCbuild/pythoncore.vcxproj | 10 | ||||
-rw-r--r-- | Tools/msi/exe/exe.wixproj | 3 | ||||
-rw-r--r-- | Tools/msi/exe/exe_files.wxs | 7 |
6 files changed, 67 insertions, 10 deletions
diff --git a/.github/workflows/build_msi.yml b/.github/workflows/build_msi.yml new file mode 100644 index 0000000..e9ecf54 --- /dev/null +++ b/.github/workflows/build_msi.yml @@ -0,0 +1,34 @@ +name: TestsMSI + +on: + push: + branches: + - master + - 3.8 + - 3.7 + paths: + - 'Tools/msi/**' + pull_request: + branches: + - master + - 3.8 + - 3.7 + paths: + - 'Tools/msi/**' + +jobs: + build_win32: + name: 'Windows (x86) Installer' + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - name: Build CPython installer + run: .\Tools\msi\build.bat -x86 + + build_win_amd64: + name: 'Windows (x64) Installer' + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - name: Build CPython installer + run: .\Tools\msi\build.bat -x64 diff --git a/Misc/NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rst b/Misc/NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rst new file mode 100644 index 0000000..c301189 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rst @@ -0,0 +1,2 @@ +Ensures the required :file:`vcruntime140.dll` is included in install +packages. diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 7c0f50b..8022133 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -200,4 +200,25 @@ public override bool Execute() { <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" /> <Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" /> </Target> + + + <Target Name="FindVCRuntime" Returns="VCRuntimeDLL"> + <PropertyGroup Condition="$(PlatformToolset) != 'v140'"> + <VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir> + <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir> + <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir> + </PropertyGroup> + <PropertyGroup Condition="$(PlatformToolset) == 'v140'"> + <VCRedistDir>$(VCInstallDir)\redist\</VCRedistDir> + <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir> + <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir> + </PropertyGroup> + + <ItemGroup Condition="$(VCInstallDir) != ''"> + <VCRuntimeDLL Include="$(VCRedistDir)\Microsoft.VC*.CRT\vcruntime*.dll" /> + </ItemGroup> + + <Error Text="vcruntime14*.dll not found under $(VCInstallDir)" Condition="@(VCRuntimeDLL) == ''" /> + <Message Text="VCRuntimeDLL: @(VCRuntimeDLL)" Importance="high" /> + </Target> </Project> diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index bd16c1e..0666b90 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -519,15 +519,7 @@ <Warning Text="Not including zlib is not a supported configuration." /> </Target> - <PropertyGroup> - <VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir> - <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir> - <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir> - </PropertyGroup> - <ItemGroup Condition="$(VCInstallDir) != ''"> - <VCRuntimeDLL Include="$(VCRedistDir)\**\vcruntime*.dll" /> - </ItemGroup> - <Target Name="_CopyVCRuntime" AfterTargets="Build" Inputs="@(VCRuntimeDLL)" Outputs="$(OutDir)%(Filename)%(Extension)"> + <Target Name="_CopyVCRuntime" AfterTargets="Build" Inputs="@(VCRuntimeDLL)" Outputs="$(OutDir)%(Filename)%(Extension)" DependsOnTargets="FindVCRuntime"> <!-- bpo-38597: When we switch to another VCRuntime DLL, include vcruntime140.dll as well --> <Warning Text="A copy of vcruntime140.dll is also required" Condition="!$(VCToolsRedistVersion.StartsWith(`14.`))" /> <Copy SourceFiles="%(VCRuntimeDLL.FullPath)" DestinationFolder="$(OutDir)" /> diff --git a/Tools/msi/exe/exe.wixproj b/Tools/msi/exe/exe.wixproj index 326766b..be44f44 100644 --- a/Tools/msi/exe/exe.wixproj +++ b/Tools/msi/exe/exe.wixproj @@ -11,6 +11,9 @@ <SuppressICEs>ICE43</SuppressICEs> </PropertyGroup> <Import Project="..\msi.props" /> + <PropertyGroup Condition="exists('$(BuildPath)vcruntime140_1.dll')"> + <DefineConstants>$(DefineConstants);Include_Vcruntime140_1_dll=1</DefineConstants> + </PropertyGroup> <ItemGroup> <Compile Include="exe.wxs" /> <Compile Include="exe_files.wxs" /> diff --git a/Tools/msi/exe/exe_files.wxs b/Tools/msi/exe/exe_files.wxs index 483d06c..15bf6a0 100644 --- a/Tools/msi/exe/exe_files.wxs +++ b/Tools/msi/exe/exe_files.wxs @@ -30,8 +30,13 @@ </RegistryKey> </Component> <Component Id="vcruntime140.dll" Directory="InstallDirectory" Guid="*"> - <File Name="vcruntime140.dll" Source="!(bindpath.redist)vcruntime140.dll" KeyPath="yes" /> + <File Name="vcruntime140.dll" Source="vcruntime140.dll" KeyPath="yes" /> </Component> +<?ifdef Include_Vcruntime140_1_dll ?> + <Component Id="vcruntime140_1.dll" Directory="InstallDirectory" Guid="*"> + <File Name="vcruntime140_1.dll" Source="vcruntime140_1.dll" KeyPath="yes" /> + </Component> +<?endif ?> </ComponentGroup> </Fragment> |