Skip to content

Commit bec702d

Browse files
authored
Merge pull request #52 from ActiveState/BE-4087-vcruntime
Add VCRuntime
2 parents 53a880a + 52ce3d5 commit bec702d

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

Misc/NEWS.d/2.7.18.9.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
.. bpo: none
2+
.. date: 2024-06-26
3+
.. nonce:
4+
.. release date: 2024-06-26
5+
.. section: Core and Builtins
6+
7+
Include vcruntime140.dll in Python 2.7
8+
9+
vcruntime140.dll is now included as it is a necessary runtime dependency of Python.
10+
Similar to bpo: 39930
11+
12+
.. bpo: none
13+
.. date: 2024-06-26
14+
.. nonce:
15+
.. release date: 2024-06-26
16+
.. section: Core and Builtins
17+
18+
WSA Errors are handled on Windows
19+
20+
We are now handling WSAE* errors on windows. These Errors were not being handled properly since updating to newer versions of MSVC.
21+
122
.. bpo: 32056
223
.. date: 2018-03-18
324
.. nonce:

PCbuild/pyproject.props

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,24 @@ foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses
157157
<Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
158158
<Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" />
159159
</Target>
160+
161+
<Target Name="FindVCRuntime" Returns="VCRuntimeDLL">
162+
<PropertyGroup Condition="$(PlatformToolset) != 'v140'">
163+
<VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir>
164+
<VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir>
165+
<VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir>
166+
</PropertyGroup>
167+
<PropertyGroup Condition="$(PlatformToolset) == 'v140'">
168+
<VCRedistDir>$(VCInstallDir)\redist\</VCRedistDir>
169+
<VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir>
170+
<VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir>
171+
</PropertyGroup>
172+
173+
<ItemGroup Condition="$(VCInstallDir) != ''">
174+
<VCRuntimeDLL Include="$(VCRedistDir)\Microsoft.VC*.CRT\vcruntime*.dll" />
175+
</ItemGroup>
176+
177+
<Error Text="vcruntime14*.dll not found under $(VCInstallDir)" Condition="@(VCRuntimeDLL) == ''" />
178+
<Message Text="VCRuntimeDLL: @(VCRuntimeDLL)" Importance="high" />
179+
</Target>
160180
</Project>

PCbuild/pythoncore.vcxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,4 +406,12 @@
406406
<Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v90'">
407407
<Warning Text="Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." />
408408
</Target>
409+
<Target Name="_CopyVCRuntime" AfterTargets="Build" Inputs="@(VCRuntimeDLL)" Outputs="$(OutDir)%(Filename)%(Extension)" DependsOnTargets="FindVCRuntime">
410+
<!-- bpo-38597: When we switch to another VCRuntime DLL, include vcruntime140.dll as well -->
411+
<Warning Text="A copy of vcruntime140.dll is also required" Condition="!$(VCToolsRedistVersion.StartsWith(`14.`))" />
412+
<Copy SourceFiles="%(VCRuntimeDLL.FullPath)" DestinationFolder="$(OutDir)" />
413+
</Target>
414+
<Target Name="_CleanVCRuntime" AfterTargets="Clean">
415+
<Delete Files="@(VCRuntimeDLL->'$(OutDir)%(Filename)%(Extension)')" />
416+
</Target>
409417
</Project>

0 commit comments

Comments
 (0)