Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 785273c

Browse files
committed
Merge forward extras beyond #21907 backport.
2 parents 9380acb + 6250df8 commit 785273c

6 files changed

Lines changed: 28 additions & 28 deletions

File tree

PCbuild/build.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ rem -r Target Rebuild instead of Build
99
rem -t Set the target manually (Build, Rebuild, Clean, or CleanAll)
1010
rem -d Set the configuration to Debug
1111
rem -e Pull in external libraries using get_externals.bat
12+
rem -m Enable parallel build (enabled by default)
1213
rem -M Disable parallel build
1314
rem -v Increased output messages
15+
rem -k Attempt to kill any running Pythons before building (usually unnecessary)
1416

1517
setlocal
1618
set platf=Win32
@@ -20,6 +22,7 @@ set target=Build
2022
set dir=%~dp0
2123
set parallel=/m
2224
set verbose=/nologo /v:m
25+
set kill=
2326

2427
:CheckOpts
2528
if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts
@@ -28,14 +31,20 @@ if '%1'=='-r' (set target=Rebuild) & shift & goto CheckOpts
2831
if '%1'=='-t' (set target=%2) & shift & shift & goto CheckOpts
2932
if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts
3033
if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts
34+
if '%1'=='-m' (set parallel=/m) & shift & goto CheckOpts
3135
if '%1'=='-M' (set parallel=) & shift & goto CheckOpts
3236
if '%1'=='-v' (set verbose=/v:n) & shift & goto CheckOpts
37+
if '%1'=='-k' (set kill=true) & shift & goto CheckOpts
3338

3439
if '%platf%'=='x64' (set vs_platf=x86_amd64)
3540

3641
rem Setup the environment
3742
call "%dir%env.bat" %vs_platf% >nul
3843

44+
if '%kill%'=='true' (
45+
msbuild /v:m /nologo /target:KillPython "%pcbuild%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true
46+
)
47+
3948
rem Call on MSBuild to do the work, echo the command.
4049
rem Passing %1-9 is not the preferred option, but argument parsing in
4150
rem batch is, shall we say, "lackluster"

Tools/buildbot/build.bat

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
@rem Used by the buildbot "compile" step.
22

33
@rem Clean up
4-
set PLAT=
5-
if '%1' EQU '-p' if '%2' EQU 'x64' (set PLAT=-amd64)
6-
7-
call "%~dp0clean%PLAT%.bat"
4+
call "%~dp0clean.bat" %*
85

96
@rem If you need the buildbots to start fresh (such as when upgrading to
107
@rem a new version of an external library, especially Tcl/Tk):
@@ -17,4 +14,4 @@ call "%~dp0clean%PLAT%.bat"
1714
@rem 4) re-comment, commit and push again
1815

1916
@rem Do the build
20-
call "%~dp0..\..\PCbuild\build.bat" -e -d -v %*
17+
call "%~dp0..\..\PCbuild\build.bat" -e -d -k -v %*

Tools/buildbot/clean-amd64.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@rem Used by the buildbot "clean" step.
2-
@call "%~dp0clean.bat" x64
2+
call "%~dp0clean.bat" -p x64 %*

Tools/buildbot/clean.bat

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,12 @@ setlocal
55
set root=%~dp0..\..
66
set pcbuild=%root%\PCbuild
77

8-
if "%1" == "x64" (
9-
set vcvars_target=x86_amd64
10-
set platform=x64
11-
) else (
12-
set vcvars_target=x86
13-
set platform=Win32
14-
)
15-
16-
call "%pcbuild%\env.bat" %vcvars_target%
17-
18-
echo.Attempting to kill Pythons...
19-
msbuild /v:m /nologo /target:KillPython "%pcbuild%\pythoncore.vcxproj" /p:Configuration=Release /p:Platform=%platform% /p:KillPython=true
8+
echo Deleting build
9+
call "%pcbuild%\build.bat" -t Clean -k %*
10+
call "%pcbuild%\build.bat" -t Clean -k -d %*
2011

2112
echo Deleting .pyc/.pyo files ...
2213
del /s "%root%\Lib\*.pyc" "%root%\Lib\*.pyo"
2314

2415
echo Deleting test leftovers ...
2516
rmdir /s /q "%root%\build"
26-
27-
echo Deleting build
28-
msbuild /v:m /nologo /target:clean "%pcbuild%\pcbuild.proj" /p:Configuration=Release /p:Platform=%platform%
29-
msbuild /v:m /nologo /target:clean "%pcbuild%\pcbuild.proj" /p:Configuration=Debug /p:Platform=%platform%

Tools/buildbot/test-amd64.bat

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
@rem Used by the buildbot "test" step.
2-
3-
setlocal
4-
5-
call "%~dp0..\..\PCbuild\rt.bat" -d -q -x64 -uall -rwW -n --timeout=3600 %*
2+
call "%~dp0test.bat" -x64 %*

Tools/buildbot/test.bat

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
@rem Used by the buildbot "test" step.
2+
@setlocal
23

3-
setlocal
4+
@set here=%~dp0
5+
@set rt_opts=-q -d
46

5-
call "%~dp0..\..\PCbuild\rt.bat" -d -q -uall -rwW -n --timeout=3600 %*
7+
:CheckOpts
8+
@if '%1'=='-x64' (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
9+
@if '%1'=='-d' (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
10+
@if '%1'=='-O' (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
11+
@if '%1'=='-q' (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
12+
@if '%1'=='+d' (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts
13+
@if '%1'=='+q' (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts
14+
15+
call "%here%..\..\PCbuild\rt.bat" %rt_opts% -uall -rwW -n --timeout=3600 %1 %2 %3 %4 %5 %6 %7 %8 %9

0 commit comments

Comments
 (0)