[Python-checkins] cpython (2.7): Clean up/refactor the batch scripts used for building on Windows.

zach.ware python-checkins at python.org
Wed Jun 10 08:17:57 CEST 2015


https://hg.python.org/cpython/rev/4890a55c62ab
changeset:   96571:4890a55c62ab
branch:      2.7
parent:      96564:ae1bc5b65e65
user:        Zachary Ware <zachary.ware at gmail.com>
date:        Tue Jun 09 15:21:39 2015 -0500
summary:
  Clean up/refactor the batch scripts used for building on Windows.

This is mostly a backport of issue #21907, but also includes a few
extras necessary to make the bulidbot scripts as thin as possible.

files:
  PCbuild/build.bat                  |  107 +++++++++++++++-
  PCbuild/env.bat                    |    3 +-
  PCbuild/get_externals.bat          |  103 ++++++++++++++++
  PCbuild/rt.bat                     |   16 +-
  Tools/buildbot/README.tcltk-AMD64  |   36 -----
  Tools/buildbot/build-amd64.bat     |    7 +-
  Tools/buildbot/build.bat           |   21 ++-
  Tools/buildbot/clean-amd64.bat     |   10 +-
  Tools/buildbot/clean.bat           |   26 ++-
  Tools/buildbot/external-amd64.bat  |   30 +----
  Tools/buildbot/external-common.bat |   65 ----------
  Tools/buildbot/external.bat        |   31 +----
  Tools/buildbot/test-amd64.bat      |    3 +-
  Tools/buildbot/test.bat            |   16 ++-
  14 files changed, 264 insertions(+), 210 deletions(-)


diff --git a/PCbuild/build.bat b/PCbuild/build.bat
--- a/PCbuild/build.bat
+++ b/PCbuild/build.bat
@@ -1,18 +1,107 @@
 @echo off
-rem A batch program to build or rebuild a particular configuration.
+rem A batch program to build or rebuild a particular configuration,
 rem just for convenience.
 
+rem Arguments:
+rem  -c  Set the configuration (default: Release)
+rem  -p  Set the platform (x64 or Win32, default: Win32)
+rem  -r  Target Rebuild instead of Build
+rem  -t  Set the target manually (Build, Rebuild, or Clean)
+rem  -d  Set the configuration to Debug
+rem  -e  Pull in external libraries using get_externals.bat
+rem  -k  Attempt to kill any running Pythons before building
+
 setlocal
 set platf=Win32
+set vs_platf=x86
 set conf=Release
-set build=
+set target=
+set dir=%~dp0
+set kill=
+set build_tkinter=
 
 :CheckOpts
-if "%1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts
-if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
-if "%1"=="-r" (set build=/rebuild) & shift & goto CheckOpts
-if "%1"=="-d" (set conf=Debug) & shift & goto CheckOpts
+if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts
+if '%1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts
+if '%1'=='-r' (set target=/rebuild) & shift & goto CheckOpts
+if '%1'=='-t' (
+    if '%2'=='Clean' (set target=/clean) & shift & shift & goto CheckOpts
+    if '%2'=='Rebuild' (set target=/rebuild) & shift & shift & goto CheckOpts
+    if '%2'=='Build' (set target=) & shift & shift & goto CheckOpts
+    echo.Unknown target: %2 & goto :eof
+)
+if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts
+if '%1'=='-e' call "%dir%get_externals.bat" & (set build_tkinter=true) & shift & goto CheckOpts
+if '%1'=='-k' (set kill=true) & shift & goto CheckOpts
 
-set cmd=vcbuild /useenv pcbuild.sln %build% "%conf%|%platf%"
-echo %cmd%
-%cmd%
+if '%conf%'=='Debug' (set dbg_ext=_d) else (set dbg_ext=)
+if '%platf%'=='x64' (
+    set vs_platf=x86_amd64
+    set builddir=%dir%amd64\
+) else (
+    set builddir=%dir%
+)
+rem Can't use builddir until we're in a new command...
+if '%platf%'=='x64' (
+    rem Needed for buliding OpenSSL
+    set HOST_PYTHON=%builddir%python%dbg_ext%.exe
+)
+
+rem Setup the environment
+call "%dir%env.bat" %vs_platf%
+
+if '%kill%'=='true' (
+    vcbuild "%dir%kill_python.vcproj" "%conf%|%platf%" && "%builddir%kill_python%dbg_ext%.exe"
+)
+
+set externals_dir=%dir%..\externals
+if '%build_tkinter%'=='true' (
+    if '%platf%'=='x64' (
+        set tcltkdir=%externals_dir%\tcltk64
+        set machine=AMD64
+    ) else (
+        set tcltkdir=%externals_dir%\tcltk
+        set machine=IX86
+    )
+    if '%conf%'=='Debug' (
+        set tcl_dbg_ext=g
+        set debug_flag=1
+    ) else (
+        set tcl_dbg_ext=
+        set debug_flag=0
+    )
+    set tcldir=%externals_dir%\tcl-8.5.15.0
+    set tkdir=%externals_dir%\tk-8.5.15.0
+    set tixdir=%externals_dir%\tix-8.4.3.5
+)
+if '%build_tkinter%'=='true' (
+    if not exist "%tcltkdir%\bin\tcl85%tcl_dbg_ext%.dll" (
+        @rem all and install need to be separate invocations, otherwise nmakehlp is not found on install
+        pushd "%tcldir%\win"
+        nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" clean all
+        nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" install
+        popd
+    )
+
+    if not exist "%tcltkdir%\bin\tk85%tcl_dbg_ext%.dll" (
+        pushd "%tkdir%\win"
+        nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" TCLDIR="%tcldir%" clean
+        nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" TCLDIR="%tcldir%" all
+        nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" TCLDIR="%tcldir%" install
+        popd
+    )
+
+    if not exist "%tcltkdir%\lib\tix8.4.3\tix84%tcl_dbg_ext%.dll" (
+        pushd "%tixdir%\win"
+        nmake -f python.mak DEBUG=%debug_flag% MACHINE=%machine% TCL_DIR="%tcldir%" TK_DIR="%tkdir%" INSTALL_DIR="%tcltkdir%" clean
+        nmake -f python.mak DEBUG=%debug_flag% MACHINE=%machine% TCL_DIR="%tcldir%" TK_DIR="%tkdir%" INSTALL_DIR="%tcltkdir%" all
+        nmake -f python.mak DEBUG=%debug_flag% MACHINE=%machine% TCL_DIR="%tcldir%" TK_DIR="%tkdir%" INSTALL_DIR="%tcltkdir%" install
+        popd
+    )
+)
+
+rem Call on VCBuild to do the work, echo the command.
+rem Passing %1-9 is not the preferred option, but argument parsing in
+rem batch is, shall we say, "lackluster"
+echo on
+vcbuild "%dir%pcbuild.sln" %target% "%conf%|%platf%" %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/PCbuild/env.bat b/PCbuild/env.bat
--- a/PCbuild/env.bat
+++ b/PCbuild/env.bat
@@ -1,5 +1,4 @@
 @echo off
-set VS9=%ProgramFiles%\Microsoft Visual Studio 9.0
 echo Build environments: x86, ia64, amd64, x86_amd64, x86_ia64
 echo.
-call "%VS9%\VC\vcvarsall.bat" %1
+call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" %*
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
new file mode 100644
--- /dev/null
+++ b/PCbuild/get_externals.bat
@@ -0,0 +1,103 @@
+ at echo off
+setlocal
+rem Simple script to fetch source for external libraries
+
+if not exist "%~dp0..\externals" mkdir "%~dp0..\externals"
+pushd "%~dp0..\externals"
+
+if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/
+
+rem Optionally clean up first.  Be warned that this can be very destructive!
+if not "%1"=="" (
+    for %%c in (-c --clean --clean-only) do (
+        if "%1"=="%%c" goto clean
+    )
+    goto usage
+)
+goto fetch
+
+:clean
+echo.Cleaning up external libraries.
+for /D %%d in (
+               bzip2-*
+               db-*
+               nasm-*
+               openssl-*
+               tcl-*
+               tcltk*
+               tk-*
+               tix-*
+               sqlite-*
+               xz-*
+               ) do (
+    echo.Removing %%d
+    rmdir /s /q %%d
+)
+if "%1"=="--clean-only" (
+    goto end
+)
+
+:fetch
+rem Fetch current versions
+
+svn --version > nul 2>&1
+if ERRORLEVEL 9009 (
+    echo.svn.exe must be on your PATH.
+    echo.Try TortoiseSVN (http://tortoisesvn.net/^) and be sure to check the
+    echo.command line tools option.
+    popd
+    exit /b 1
+)
+
+echo.Fetching external libraries...
+
+for %%e in (
+            bzip2-1.0.6
+            db-4.7.25.0
+            nasm-2.11.06
+            openssl-1.0.2a
+            tcl-8.5.15.0
+            tk-8.5.15.0
+            tix-8.4.3.5
+            sqlite-3.6.21
+            ) do (
+    if exist %%e (
+        echo.%%e already exists, skipping.
+    ) else (
+        echo.Fetching %%e...
+        svn export %SVNROOT%%%e
+    )
+)
+
+goto end
+
+:usage
+echo.invalid argument: %1
+echo.usage: %~n0 [[ -c ^| --clean ] ^| --clean-only ]
+echo.
+echo.Pull all sources necessary for compiling optional extension modules
+echo.that rely on external libraries.  Requires svn.exe to be on your PATH
+echo.and pulls sources from %SVNROOT%.
+echo.
+echo.Use the -c or --clean option to clean up all external library sources
+echo.before pulling in the current versions.
+echo.
+echo.Use the --clean-only option to do the same cleaning, without pulling in
+echo.anything new.
+echo.
+echo.Only the first argument is checked, all others are ignored.
+echo.
+echo.**WARNING**: the cleaning options unconditionally remove any directory
+echo.that is a child of
+echo.   %CD%
+echo.and matches wildcard patterns beginning with bzip2-, db-, nasm-, openssl-,
+echo.tcl-, tcltk, tk-, tix-, sqlite-, or xz-, and as such has the potential
+echo.to be very destructive if you are not aware of what it is doing.  Use with
+echo.caution!
+popd
+exit /b -1
+
+
+:end
+echo Finished.
+popd
diff --git a/PCbuild/rt.bat b/PCbuild/rt.bat
--- a/PCbuild/rt.bat
+++ b/PCbuild/rt.bat
@@ -9,7 +9,8 @@
 rem -x64 Run the 64-bit build of python (or python_d if -d was specified)
 rem      from the 'amd64' dir instead of the 32-bit build in this dir.
 rem All leading instances of these switches are shifted off, and
-rem whatever remains is passed to regrtest.py.  For example,
+rem whatever remains (up to 9 arguments) is passed to regrtest.py.
+rem For example,
 rem     rt -O -d -x test_thread
 rem runs
 rem     python_d -O ../lib/test/regrtest.py -x test_thread
@@ -26,7 +27,8 @@
 
 setlocal
 
-set prefix=.\
+set pcbuild=%~dp0
+set prefix=%pcbuild%
 set suffix=
 set qmode=
 set dashO=
@@ -36,15 +38,15 @@
 if "%1"=="-O" (set dashO=-O)     & shift & goto CheckOpts
 if "%1"=="-q" (set qmode=yes)    & shift & goto CheckOpts
 if "%1"=="-d" (set suffix=_d)    & shift & goto CheckOpts
-if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts
+if "%1"=="-x64" (set prefix=%prefix%amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts
 
-PATH %PATH%;%~dp0..\externals\%tcltk%\bin
-set exe=%prefix%\python%suffix%
-set cmd=%exe% %dashO% -Wd -3 -E -tt ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
+PATH %PATH%;%pcbuild%..\externals\%tcltk%\bin
+set exe="%prefix%\python%suffix%"
+set cmd=%exe% %dashO% -Wd -3 -E -tt "%pcbuild%\..\Lib\test\regrtest.py" %1 %2 %3 %4 %5 %6 %7 %8 %9
 if defined qmode goto Qmode
 
 echo Deleting .pyc/.pyo files ...
-%exe% rmpyc.py
+%exe% "%pcbuild%\rmpyc.py"
 
 echo on
 %cmd%
diff --git a/Tools/buildbot/README.tcltk-AMD64 b/Tools/buildbot/README.tcltk-AMD64
deleted file mode 100644
--- a/Tools/buildbot/README.tcltk-AMD64
+++ /dev/null
@@ -1,36 +0,0 @@
-Comments on building tcl/tk for AMD64 with the MS SDK compiler
-==============================================================
-
-I did have to build tcl/tk manually.
-
-First, I had to build the nmakehlp.exe helper utility manually by executing
-   cl nmakehlp.c /link bufferoverflowU.lib
-in both the tcl8.4.12\win and tk8.4.12\win directories.
-
-Second, the AMD64 compiler refuses to compile the file
-tcl8.4.12\generic\tclExecute.c because it insists on using intrinsics
-for the 'ceil' and 'floor' functions:
-
-  ..\generic\tclExecute.c(394) : error C2099: initializer is not a constant
-  ..\generic\tclExecute.c(398) : error C2099: initializer is not a constant
-
-I did comment out these lines; an alternative would have been to use
-the /Oi- compiler flag to disable the intrinsic functions.
-The commands then used were these:
-
-   svn export http://svn.python.org/projects/external/tcl8.4.12
-   cd tcl8.4.12\win
-   REM
-   echo patch the tcl8.4.12\generic\tclExecute.c file
-   pause 
-   REM
-   cl nmakehlp.c /link bufferoverflowU.lib
-   nmake -f makefile.vc MACHINE=AMD64
-   nmake -f makefile.vc INSTALLDIR=..\..\tcltk install
-   cd ..\..
-   svn export http://svn.python.org/projects/external/tk8.4.12
-   cd tk8.4.12\win
-   cl nmakehlp.c /link bufferoverflowU.lib
-   nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 MACHINE=AMD64
-   nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install
-   cd ..\..
diff --git a/Tools/buildbot/build-amd64.bat b/Tools/buildbot/build-amd64.bat
--- a/Tools/buildbot/build-amd64.bat
+++ b/Tools/buildbot/build-amd64.bat
@@ -1,7 +1,2 @@
 @rem Used by the buildbot "compile" step.
-set HOST_PYTHON="%CD%\PCbuild\amd64\python_d.exe"
-cmd /c Tools\buildbot\external-amd64.bat
-call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
-cmd /c Tools\buildbot\clean-amd64.bat
-vcbuild /useenv PCbuild\kill_python.vcproj "Debug|x64" && PCbuild\amd64\kill_python_d.exe
-vcbuild PCbuild\pcbuild.sln "Debug|x64"
+call "%~dp0build.bat" -p x64 %*
diff --git a/Tools/buildbot/build.bat b/Tools/buildbot/build.bat
--- a/Tools/buildbot/build.bat
+++ b/Tools/buildbot/build.bat
@@ -1,7 +1,18 @@
 @rem Used by the buildbot "compile" step.
-cmd /c Tools\buildbot\external.bat
-call "%VS90COMNTOOLS%vsvars32.bat"
-cmd /c Tools\buildbot\clean.bat
-vcbuild /useenv PCbuild\kill_python.vcproj "Debug|Win32" && PCbuild\kill_python_d.exe
-vcbuild /useenv PCbuild\pcbuild.sln "Debug|Win32"
+ at setlocal
 
+ at rem Clean up
+call "%~dp0clean.bat" %*
+
+ at rem If you need the buildbots to start fresh (such as when upgrading to
+ at rem a new version of an external library, especially Tcl/Tk):
+ at rem 1) uncomment the following line:
+
+ at rem    call "%~dp0..\..\PCbuild\get_externals.bat" --clean-only
+
+ at rem 2) commit and push
+ at rem 3) wait for all Windows bots to start a build with that changeset
+ at rem 4) re-comment, commit and push again
+
+ at rem Do the build
+call "%~dp0..\..\PCbuild\build.bat" -e -d -k %*
diff --git a/Tools/buildbot/clean-amd64.bat b/Tools/buildbot/clean-amd64.bat
--- a/Tools/buildbot/clean-amd64.bat
+++ b/Tools/buildbot/clean-amd64.bat
@@ -1,10 +1,2 @@
 @rem Used by the buildbot "clean" step.
-call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
- at echo Deleting .pyc/.pyo files ...
-del /s Lib\*.pyc Lib\*.pyo
- at echo Deleting test leftovers ...
-rmdir /s /q build
-cd PCbuild
-vcbuild /clean pcbuild.sln "Release|x64"
-vcbuild /clean pcbuild.sln "Debug|x64"
-cd ..
+call "%~dp0clean.bat" -p x64 %*
diff --git a/Tools/buildbot/clean.bat b/Tools/buildbot/clean.bat
--- a/Tools/buildbot/clean.bat
+++ b/Tools/buildbot/clean.bat
@@ -1,10 +1,16 @@
- at rem Used by the buildbot "clean" step.
-call "%VS90COMNTOOLS%vsvars32.bat"
- at echo Deleting .pyc/.pyo files ...
-del /s Lib\*.pyc Lib\*.pyo
- at echo Deleting test leftovers ...
-rmdir /s /q build
-cd PCbuild
-vcbuild /clean pcbuild.sln "Release|Win32"
-vcbuild /clean pcbuild.sln "Debug|Win32"
-cd ..
+ at echo off
+rem Used by the buildbot "clean" step.
+
+setlocal
+set root=%~dp0..\..
+set pcbuild=%root%\PCbuild
+
+echo Deleting build
+call "%pcbuild%\build.bat" -t Clean -k %*
+call "%pcbuild%\build.bat" -t Clean -k -d %*
+
+echo Deleting .pyc/.pyo files ...
+del /s "%root%\Lib\*.pyc" "%root%\Lib\*.pyo"
+
+echo Deleting test leftovers ...
+rmdir /s /q "%root%\build"
diff --git a/Tools/buildbot/external-amd64.bat b/Tools/buildbot/external-amd64.bat
--- a/Tools/buildbot/external-amd64.bat
+++ b/Tools/buildbot/external-amd64.bat
@@ -1,28 +1,2 @@
- at rem Fetches (and builds if necessary) external dependencies
-
- at rem Assume we start inside the Python source directory
-call "Tools\buildbot\external-common.bat"
-call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
-
-if not exist tcltk64\bin\tcl85g.dll (
-    cd tcl-8.5.15.0\win
-    nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all
-    nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install
-    cd ..\..
-)
-
-if not exist tcltk64\bin\tk85g.dll (
-    cd tk-8.5.15.0\win
-    nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.15.0 clean
-    nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.15.0 all
-    nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.15.0 install
-    cd ..\..
-)
-
-if not exist tcltk64\lib\tix8.4.3\tix84g.dll (
-    cd tix-8.4.3.5\win
-    nmake -f python.mak DEBUG=1 MACHINE=AMD64 TCL_DIR=..\..\tcl-8.5.15.0 TK_DIR=..\..\tk-8.5.15.0 INSTALL_DIR=..\..\tcltk64 clean
-    nmake -f python.mak DEBUG=1 MACHINE=AMD64 TCL_DIR=..\..\tcl-8.5.15.0 TK_DIR=..\..\tk-8.5.15.0 INSTALL_DIR=..\..\tcltk64 all
-    nmake -f python.mak DEBUG=1 MACHINE=AMD64 TCL_DIR=..\..\tcl-8.5.15.0 TK_DIR=..\..\tk-8.5.15.0 INSTALL_DIR=..\..\tcltk64 install
-    cd ..\..
-)
+ at echo Please use PCbuild\get_externals.bat instead.
+@"%~dp0..\..\PCbuild\get_externals.bat" %*
diff --git a/Tools/buildbot/external-common.bat b/Tools/buildbot/external-common.bat
deleted file mode 100644
--- a/Tools/buildbot/external-common.bat
+++ /dev/null
@@ -1,65 +0,0 @@
- at rem Common file shared between external.bat and external-amd64.bat.  Responsible for
- at rem fetching external components into the root\externals directory.
-
-if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/
-
-if not exist externals mkdir externals
-cd externals
- at rem XXX: If you need to force the buildbots to start from a fresh environment, uncomment
- at rem the following, check it in, then check it out, comment it out, then check it back in.
- at rem if exist bzip2-1.0.6 rd /s/q bzip2-1.0.6
- at rem if exist tcltk rd /s/q tcltk
- at rem if exist tcltk64 rd /s/q tcltk64
- at rem if exist tcl8.4.12 rd /s/q tcl8.4.12
- at rem if exist tcl8.4.16 rd /s/q tcl8.4.16
- at rem if exist tcl-8.4.18.1 rd /s/q tcl-8.4.18.1
- at rem if exist tcl-8.5.2.1 rd /s/q tcl-8.5.2.1
- at rem if exist tcl-8.5.15.0 rd /s/q tcl-8.5.15.0
- at rem if exist tk8.4.12 rd /s/q tk8.4.12
- at rem if exist tk8.4.16 rd /s/q tk8.4.16
- at rem if exist tk-8.4.18.1 rd /s/q tk-8.4.18.1
- at rem if exist tk-8.5.2.0 rd /s/q tk-8.5.2.0
- at rem if exist tk-8.5.15.0 rd /s/q tk-8.5.15.0
- at rem if exist tix-8.4.3.5 rd /s/q tix-8.4.3.5
- at rem if exist db-4.4.20 rd /s/q db-4.4.20
- at rem if exist db-4.7.25.0 rd /s/q db-4.7.25.0
- at rem if exist openssl-0.9.8y rd /s/q openssl-0.9.8y
- at rem if exist openssl-1.0.1g rd /s/q openssl-1.0.1g
- at rem if exist openssl-1.0.1h rd /s/q openssl-1.0.1h
- at rem if exist openssl-1.0.1i rd /s/q openssl-1.0.1i
- at rem if exist openssl-1.0.1j rd /s/q openssl-1.0.1j
- at rem if exist openssl-1.0.1l rd /s/q openssl-1.0.1l
- at rem if exist openssl-1.0.2a rd /s/q openssl-1.0.2a
- at rem if exist sqlite-3.6.21 rd /s/q sqlite-3.6.21
-
- at rem bzip
-if not exist bzip2-1.0.6 (
-   rd /s/q bzip2-1.0.5
-  svn export %SVNROOT%bzip2-1.0.6
-)
-
- at rem Berkeley DB
-if exist db-4.4.20 rd /s/q db-4.4.20
-if not exist db-4.7.25.0 svn export %SVNROOT%db-4.7.25.0
-
- at rem NASM, for OpenSSL build
- at rem if exist nasm-2.11.06 rd /s/q nasm-2.11.06
-if not exist nasm-2.11.06 svn export %SVNROOT%nasm-2.11.06
-
- at rem OpenSSL
-if exist openssl-1.0.1l rd /s/q openssl-1.0.1l
-if not exist openssl-1.0.2a svn export %SVNROOT%openssl-1.0.2a
-
- at rem tcl/tk
-if not exist tcl-8.5.15.0 (
-   rd /s/q tcltk tcltk64 tcl-8.5.2.1 tk-8.5.2.0
-   svn export %SVNROOT%tcl-8.5.15.0
-)
-if not exist tk-8.5.15.0 svn export %SVNROOT%tk-8.5.15.0
-if not exist tix-8.4.3.5 svn export %SVNROOT%tix-8.4.3.5
-
- at rem sqlite3
-if not exist sqlite-3.6.21 (
-  rd /s/q sqlite-source-3.3.4
-  svn export %SVNROOT%sqlite-3.6.21
-)
diff --git a/Tools/buildbot/external.bat b/Tools/buildbot/external.bat
--- a/Tools/buildbot/external.bat
+++ b/Tools/buildbot/external.bat
@@ -1,29 +1,2 @@
- at rem Fetches (and builds if necessary) external dependencies
-
- at rem Assume we start inside the Python source directory
-call "Tools\buildbot\external-common.bat"
-call "%VS90COMNTOOLS%\vsvars32.bat"
-
-if not exist tcltk\bin\tcl85g.dll (
-    @rem all and install need to be separate invocations, otherwise nmakehlp is not found on install
-    cd tcl-8.5.15.0\win
-    nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk clean all
-    nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk install
-    cd ..\..
-)
-
-if not exist tcltk\bin\tk85g.dll (
-    cd tk-8.5.15.0\win
-    nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.15.0 clean
-    nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.15.0 all
-    nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.15.0 install
-    cd ..\..
-)
-
-if not exist tcltk\lib\tix8.4.3\tix84g.dll (
-    cd tix-8.4.3.5\win
-    nmake -f python.mak DEBUG=1 MACHINE=IX86 TCL_DIR=..\..\tcl-8.5.15.0 TK_DIR=..\..\tk-8.5.15.0 INSTALL_DIR=..\..\tcltk clean
-    nmake -f python.mak DEBUG=1 MACHINE=IX86 TCL_DIR=..\..\tcl-8.5.15.0 TK_DIR=..\..\tk-8.5.15.0 INSTALL_DIR=..\..\tcltk all
-    nmake -f python.mak DEBUG=1 MACHINE=IX86 TCL_DIR=..\..\tcl-8.5.15.0 TK_DIR=..\..\tk-8.5.15.0 INSTALL_DIR=..\..\tcltk install
-    cd ..\..
-)
+ at echo Please use PCbuild\get_externals.bat instead.
+@"%~dp0..\..\PCbuild\get_externals.bat" %*
diff --git a/Tools/buildbot/test-amd64.bat b/Tools/buildbot/test-amd64.bat
--- a/Tools/buildbot/test-amd64.bat
+++ b/Tools/buildbot/test-amd64.bat
@@ -1,3 +1,2 @@
 @rem Used by the buildbot "test" step.
-cd PCbuild
-call rt.bat -d -q -x64 -uall -rwW %1 %2 %3 %4 %5 %6 %7 %8 %9
+call "%~dp0test.bat" -x64 %*
diff --git a/Tools/buildbot/test.bat b/Tools/buildbot/test.bat
--- a/Tools/buildbot/test.bat
+++ b/Tools/buildbot/test.bat
@@ -1,3 +1,15 @@
 @rem Used by the buildbot "test" step.
-cd PCbuild
-call rt.bat -d -q -uall -rwW %1 %2 %3 %4 %5 %6 %7 %8 %9
+ at setlocal
+
+ at set here=%~dp0
+ at set rt_opts=-q -d
+
+:CheckOpts
+ at if '%1'=='-x64' (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
+ at if '%1'=='-d' (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
+ at if '%1'=='-O' (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
+ at if '%1'=='-q' (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
+ at if '%1'=='+d' (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts
+ at if '%1'=='+q' (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts
+
+call "%here%..\..\PCbuild\rt.bat" %rt_opts% -uall -rwW %1 %2 %3 %4 %5 %6 %7 %8 %9

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list