Skip to content

Commit

Permalink
Merge pull request #52 from ActiveState/BE-4087-vcruntime
Browse files Browse the repository at this point in the history
Add VCRuntime
  • Loading branch information
icanhasmath authored Jun 27, 2024
2 parents 53a880a + 52ce3d5 commit bec702d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Misc/NEWS.d/2.7.18.9.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
.. bpo: none
.. date: 2024-06-26
.. nonce:
.. release date: 2024-06-26
.. section: Core and Builtins
Include vcruntime140.dll in Python 2.7

vcruntime140.dll is now included as it is a necessary runtime dependency of Python.
Similar to bpo: 39930

.. bpo: none
.. date: 2024-06-26
.. nonce:
.. release date: 2024-06-26
.. section: Core and Builtins
WSA Errors are handled on Windows

We are now handling WSAE* errors on windows. These Errors were not being handled properly since updating to newer versions of MSVC.

.. bpo: 32056
.. date: 2018-03-18
.. nonce:
Expand Down
20 changes: 20 additions & 0 deletions PCbuild/pyproject.props
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,24 @@ foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses
<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>
8 changes: 8 additions & 0 deletions PCbuild/pythoncore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,12 @@
<Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v90'">
<Warning Text="Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." />
</Target>
<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)" />
</Target>
<Target Name="_CleanVCRuntime" AfterTargets="Clean">
<Delete Files="@(VCRuntimeDLL->'$(OutDir)%(Filename)%(Extension)')" />
</Target>
</Project>

0 comments on commit bec702d

Please sign in to comment.