Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5fcd5e6

Browse files
authored
bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) (#3311)
1 parentbcaac81 commit5fcd5e6

File tree

10 files changed

+86
-13
lines changed

10 files changed

+86
-13
lines changed

‎.github/appveyor.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ test_script:
1414
-cmd:PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 --fail-env-changed -j0
1515
environment:
1616
HOST_PYTHON:C:\Python36\python.exe
17+
image:
18+
-Visual Studio 2017
1719

1820
# Only trigger AppVeyor if actual code or its configuration changes
1921
only_commits:

‎Doc/make.bat‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,19 @@ if not defined SPHINXBUILD if defined PYTHON (
1616
setSPHINXBUILD=%PYTHON% -c"import sphinx, sys; sys.argv[0] = 'sphinx-build'; sphinx.main()"
1717
)
1818

19+
ifnotdefined BLURBifdefined PYTHON (
20+
%PYTHON% -c"import blurb">nul2>nul
21+
iferrorlevel1 (
22+
echo Installing blurb with%PYTHON%
23+
%PYTHON% -m pip install blurb
24+
iferrorlevel1exit /B
25+
)
26+
setBLURB=%PYTHON% -m blurb
27+
)
28+
1929
ifnotdefined PYTHONsetPYTHON=py
2030
ifnotdefined SPHINXBUILDsetSPHINXBUILD=sphinx-build
31+
ifnotdefined BLURBsetBLURB=blurb
2132

2233
if"%1"NEQ"htmlhelp"goto :skiphhcsearch
2334
ifexist"%HTMLHELP%"goto :skiphhcsearch
@@ -96,6 +107,19 @@ echo.be passed by setting the SPHINXOPTS environment variable.
96107
goto end
97108

98109
:build
110+
ifexist ..\Misc\NEWS (
111+
echo.Copying Misc\NEWS to build\NEWS
112+
copy ..\Misc\NEWS build\NEWS>nul
113+
)elseifexist ..\Misc\NEWS.D (
114+
ifdefined BLURB (
115+
echo.Merging Misc/NEWS with%BLURB%
116+
%BLURB% merge -f build\NEWS
117+
)else (
118+
echo.No Misc/NEWS file and Blurb is not available.
119+
exit /B1
120+
)
121+
)
122+
99123
ifNOT"%PAPER%"=="" (
100124
setSPHINXOPTS=-D latex_elements.papersize=%PAPER%%SPHINXOPTS%
101125
)

‎Lib/distutils/command/bdist_wininst.py‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,26 +318,30 @@ def get_exe_bytes(self):
318318
# string compares seem wrong, but are what sysconfig.py itself uses
319319
ifself.target_versionandself.target_version<cur_version:
320320
ifself.target_version<"2.4":
321-
bv=6.0
321+
bv='6.0'
322322
elifself.target_version=="2.4":
323-
bv=7.1
323+
bv='7.1'
324324
elifself.target_version=="2.5":
325-
bv=8.0
325+
bv='8.0'
326326
elifself.target_version<="3.2":
327-
bv=9.0
327+
bv='9.0'
328328
elifself.target_version<="3.4":
329-
bv=10.0
329+
bv='10.0'
330330
else:
331-
bv=14.0
331+
bv='14.0'
332332
else:
333333
# for current version - use authoritative check.
334334
try:
335335
frommsvcrtimportCRT_ASSEMBLY_VERSION
336336
exceptImportError:
337337
# cross-building, so assume the latest version
338-
bv=14.0
338+
bv='14.0'
339339
else:
340-
bv=float('.'.join(CRT_ASSEMBLY_VERSION.split('.',2)[:2]))
340+
bv='.'.join(CRT_ASSEMBLY_VERSION.split('.',2)[:2])
341+
ifbv=='14.11':
342+
# v141 and v140 are binary compatible,
343+
# so keep using the 14.0 stub.
344+
bv='14.0'
341345

342346

343347
# wininst-x.y.exe is in the same directory as this file
@@ -353,7 +357,7 @@ def get_exe_bytes(self):
353357
else:
354358
sfix=''
355359

356-
filename=os.path.join(directory,"wininst-%.1f%s.exe"% (bv,sfix))
360+
filename=os.path.join(directory,"wininst-%s%s.exe"% (bv,sfix))
357361
f=open(filename,"rb")
358362
try:
359363
returnf.read()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Change to building with MSVC v141 (included with Visual Studio 2017)

‎PCbuild/pyproject.props‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,24 @@ foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses
147147
Targets="CleanAll" />
148148
</Target>
149149

150+
<TargetName="CopyPGCFiles"BeforeTargets="PrepareForBuild"Condition="$(Configuration) == 'PGUpdate'">
151+
<ItemGroup>
152+
<_PGCFilesInclude="$(OutDir)instrumented\$(TargetName)!*.pgc" />
153+
<_PGDFileInclude="$(OutDir)instrumented\$(TargetName).pgd" />
154+
<_CopyFilesInclude="@(_PGCFiles);@(_PGDFile)"Condition="Exists(%(FullPath))" />
155+
</ItemGroup>
156+
<DeleteFiles="@(_CopyFiles->'$(OutDir)%(Filename)%(Extension)')" />
157+
<ErrorText="PGO run did not succeed (no $(TargetName)!*.pgc files) and there is no data to merge"
158+
Condition="$(RequirePGCFiles) == 'true' and @(_PGCFiles) == ''" />
159+
<CopySourceFiles="@(_CopyFiles)"
160+
DestinationFolder="$(OutDir)"
161+
UseHardLinksIfPossible="true"
162+
OverwriteReadOnlyFiles="true" />
163+
</Target>
164+
150165
<PropertyGroup>
151-
<SdkBinPathCondition="'$(SdkBinPath)' == '' or !Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot10)\bin\x86</SdkBinPath>
166+
<SdkBinPathCondition="'$(SdkBinPath)' == '' or !Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot10)\bin\$(DefaultWindowsSDKVersion)\x86</SdkBinPath>
167+
<SdkBinPathCondition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot10)\bin\x86</SdkBinPath>
152168
<SdkBinPathCondition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot81)\bin\x86</SdkBinPath>
153169
<SdkBinPathCondition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86</SdkBinPath>
154170
<SdkBinPathCondition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\</SdkBinPath>

‎PCbuild/python.props‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
We set BasePlatformToolset for ICC's benefit, it's otherwise ignored.
1212
-->
13+
<BasePlatformToolsetCondition="'$(BasePlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == '15.0')">v141</BasePlatformToolset>
1314
<BasePlatformToolsetCondition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140</BasePlatformToolset>
1415
<BasePlatformToolsetCondition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120</BasePlatformToolset>
1516
<BasePlatformToolsetCondition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath11)' != ''">v110</BasePlatformToolset>
@@ -39,6 +40,7 @@
3940
<BuildPathCondition="'$(ArchName)' == 'amd64'">$(BuildPath64)</BuildPath>
4041
<BuildPathCondition="'$(BuildPath)' == ''">$(PySourcePath)PCBuild\$(ArchName)\</BuildPath>
4142
<BuildPathCondition="!HasTrailingSlash($(BuildPath))">$(BuildPath)\</BuildPath>
43+
<BuildPathCondition="$(Configuration) == 'PGInstrument'">$(BuildPath)instrumented\</BuildPath>
4244

4345
<!-- Directories of external projects. tcltk is handled in tcltk.props-->
4446
<ExternalsDir>$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals\`))</ExternalsDir>

‎PCbuild/python.vcxproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ set PYTHONPATH=$(PySourcePath)Lib
9696
<PropertyGroup>
9797
<_PGOPathCondition="$(Configuration) == 'PGInstrument' and $(Platform) == 'Win32'">@set PATH=%PATH%%3B$(VCInstallDir)bin</_PGOPath>
9898
<_PGOPathCondition="$(Configuration) == 'PGInstrument' and $(Platform) == 'x64'">@set PATH=%PATH%%3B$(VCInstallDir)bin\amd64</_PGOPath>
99+
<_PGOPathCondition="$(Configuration) == 'PGInstrument' and $(VC_PGO_RunTime_Dir) != ''">@set PATH=%PATH%%3B$(VC_PGO_RunTime_Dir)</_PGOPath>
99100
<_Content>@rem This script invokes the most recently built Python with all arguments
100101
@rem passed through to the interpreter. This file is generated by the
101102
@rem build process and any changes *will* be thrown away by the next

‎PCbuild/pythoncore.vcxproj‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
</ImportGroup>
5050
<PropertyGroup>
5151
<KillPython>true</KillPython>
52+
<RequirePGCFiles>true</RequirePGCFiles>
5253
</PropertyGroup>
5354
<ImportGroupLabel="PropertySheets">
5455
<ImportProject="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"Label="LocalAppDataPlatform" />
@@ -429,7 +430,7 @@
429430
</ClCompile>
430431
</ItemGroup>
431432
</Target>
432-
<TargetName="_WarnAboutToolset"BeforeTargets="PrepareForBuild"Condition="$(PlatformToolset) != 'v140'">
433+
<TargetName="_WarnAboutToolset"BeforeTargets="PrepareForBuild"Condition="$(PlatformToolset) != 'v140' and $(PlatformToolset) != 'v141'">
433434
<WarningText="Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." />
434435
</Target>
435436
</Project>

‎Tools/msi/exe/exe.wixproj‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,28 @@
3939
Overwrite="true"
4040
Lines="@(_LicenseFiles->'%(Content)')" />
4141
</Target>
42-
42+
43+
<TargetName="_CopyMiscNews"AfterTargets="PrepareForBuild"Condition="Exists('$(PySourcePath)Misc\NEWS')">
44+
<CopySourceFiles="$(PySourcePath)Misc\NEWS"DestinationFiles="$(BuildPath)NEWS.txt" />
45+
</Target>
46+
47+
<TargetName="_MergeMiscNewsWithBlurb"AfterTargets="PrepareForBuild"Condition="$(Blurb) != '' and !Exists('$(PySourcePath)Misc\NEWS')">
48+
<ExecCommand="$(Blurb) merge -f&quot;$(BuildPath)NEWS.txt&quot;"WorkingDirectory="$(PCBuild)" />
49+
</Target>
50+
51+
<TargetName="_MergeMiscNewsWithPython"AfterTargets="PrepareForBuild"Condition="$(Blurb) == '' and !Exists('$(PySourcePath)Misc\NEWS')">
52+
<ItemGroup>
53+
<HostPythonInclude="$(ExternalsDir)python*\tools\python.exe" />
54+
<HostPythonInclude="@(HostPython)"Condition="Exists(%(FullPath))" />
55+
<HostPythonInclude="py"Condition="@(HostPython) == ''" />
56+
</ItemGroup>
57+
<PropertyGroup>
58+
<HostPython>@(HostPython)</HostPython>
59+
<HostPythonCondition="$(HostPython.Contains(';'))">$(HostPython.Remove($(HostPython.IndexOf(';'))))</HostPython>
60+
</PropertyGroup>
61+
<ExecCommand="&quot;$(HostPython)&quot; -m pip install -U blurb"WorkingDirectory="$(PCBuild)" />
62+
<ExecCommand="&quot;$(HostPython)&quot; -m blurb merge -f&quot;$(BuildPath)NEWS.txt&quot;"WorkingDirectory="$(PCBuild)" />
63+
</Target>
64+
4365
<ImportProject="..\msi.targets" />
4466
</Project>

‎Tools/msi/exe/exe_files.wxs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<FileName="LICENSE.txt"Source="LICENSE"KeyPath="yes" />
77
</Component>
88
<ComponentId="NEWS.txt"Directory="InstallDirectory"Guid="*">
9-
<FileName="NEWS.txt"Source="!(bindpath.src)Misc\NEWS"KeyPath="yes" />
9+
<FileName="NEWS.txt"KeyPath="yes" />
1010
</Component>
1111
</ComponentGroup>
1212
</Fragment>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp