]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39930: Ensure vcruntime140.dll is included in all Windows packages (GH-18918)
authorSteve Dower <steve.dower@python.org>
Wed, 11 Mar 2020 13:11:03 +0000 (13:11 +0000)
committerGitHub <noreply@github.com>
Wed, 11 Mar 2020 13:11:03 +0000 (13:11 +0000)
Also adds GitHub CI test for Windows installer changes

.github/workflows/build_msi.yml [new file with mode: 0644]
Misc/NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rst [new file with mode: 0644]
PCbuild/pyproject.props
PCbuild/pythoncore.vcxproj
Tools/msi/exe/exe.wixproj
Tools/msi/exe/exe_files.wxs

diff --git a/.github/workflows/build_msi.yml b/.github/workflows/build_msi.yml
new file mode 100644 (file)
index 0000000..e9ecf54
--- /dev/null
@@ -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 (file)
index 0000000..c301189
--- /dev/null
@@ -0,0 +1,2 @@
+Ensures the required :file:`vcruntime140.dll` is included in install
+packages.
index 2019ca859c2754f35eafdcab1af8da7b2bd49137..f1eac3641cc60bb436fedd4be59730ceccce9b69 100644 (file)
@@ -193,4 +193,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>
-</Project>
\ No newline at end of file
+
+
+  <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>
index a66dac066e289f92cf38ecbbe068946c292006ac..bc398435bc2a3c2863af1505a25d01237b64e50e 100644 (file)
     <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)" />
index 071501ce6e6f5702c4d9fe92ea7baddd477de448..3ac307b37df02a8bde2a979dc6d74d5fbef74d59 100644 (file)
@@ -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" />
index 394b4de473547f09f41f827570490a209ec47a8a..581b8d13235250ec220a2cf4605d8f58e13232a8 100644 (file)
                 </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>