summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2014-07-07 18:39:59 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2014-07-07 18:39:59 (GMT)
commite12fa657447c91356b3c52dac9b1e4da937bd26c (patch)
tree3013b95e11de6fb2e2769e791a1810ebdef9ee1c /Tools
parentb132069ea45329c30a7caa067f6f5ed0285c8c88 (diff)
downloadcpython-e12fa657447c91356b3c52dac9b1e4da937bd26c.zip
cpython-e12fa657447c91356b3c52dac9b1e4da937bd26c.tar.gz
cpython-e12fa657447c91356b3c52dac9b1e4da937bd26c.tar.bz2
Issue #21907: Improved the batch scripts provided for building Python.
The user-facing scripts in PCbuild have been updated to be easier to use and the buildbot scripts in Tools\buildbot have been updated to use the user-facing scripts in PCbuild wherever possible.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/buildbot/build-amd64.bat6
-rw-r--r--Tools/buildbot/build.bat18
-rw-r--r--Tools/buildbot/buildmsi.bat15
-rw-r--r--Tools/buildbot/clean-amd64.bat10
-rw-r--r--Tools/buildbot/clean.bat30
-rw-r--r--Tools/buildbot/external-amd64.bat8
-rw-r--r--Tools/buildbot/external-common.bat47
-rw-r--r--Tools/buildbot/external.bat7
-rw-r--r--Tools/buildbot/test-amd64.bat6
-rw-r--r--Tools/buildbot/test.bat6
-rw-r--r--Tools/scripts/run_tests.py6
11 files changed, 60 insertions, 99 deletions
diff --git a/Tools/buildbot/build-amd64.bat b/Tools/buildbot/build-amd64.bat
index 493e74d..115e111 100644
--- a/Tools/buildbot/build-amd64.bat
+++ b/Tools/buildbot/build-amd64.bat
@@ -1,6 +1,2 @@
@rem Used by the buildbot "compile" step.
-cmd /c Tools\buildbot\external-amd64.bat
-call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
-cmd /c Tools\buildbot\clean-amd64.bat
-
-msbuild PCbuild\pcbuild.sln /p:Configuration=Debug /p:Platform=x64
+call "%~dp0build.bat" -p x64 %*
diff --git a/Tools/buildbot/build.bat b/Tools/buildbot/build.bat
index be79b10..d37ec7b 100644
--- a/Tools/buildbot/build.bat
+++ b/Tools/buildbot/build.bat
@@ -1,7 +1,17 @@
@rem Used by the buildbot "compile" step.
-cmd /c Tools\buildbot\external.bat
-call "%VS100COMNTOOLS%vsvars32.bat"
-cmd /c Tools\buildbot\clean.bat
-msbuild PCbuild\pcbuild.sln /p:Configuration=Debug /p:Platform=Win32
+@rem Clean up
+call "%~dp0clean.bat"
+@rem If you need the buildbots to start fresh (such as when upgrading to
+@rem a new version of an external library, especially Tcl/Tk):
+@rem 1) uncomment the following line:
+
+@rem call "%~dp0..\..\PCbuild\get_externals.bat" --clean-only
+
+@rem 2) commit and push
+@rem 3) wait for all Windows bots to start a build with that changeset
+@rem 4) re-comment, commit and push again
+
+@rem Do the build
+call "%~dp0..\..\PCbuild\build.bat" -e -d %*
diff --git a/Tools/buildbot/buildmsi.bat b/Tools/buildbot/buildmsi.bat
index ae93e67..f414c22 100644
--- a/Tools/buildbot/buildmsi.bat
+++ b/Tools/buildbot/buildmsi.bat
@@ -1,21 +1,20 @@
@rem Used by the buildbot "buildmsi" step.
+setlocal
-cmd /c Tools\buildbot\external.bat
+set cwd=%CD%
@rem build release versions of things
-call "%VS100COMNTOOLS%vsvars32.bat"
-
-@rem build Python
-msbuild /p:useenv=true PCbuild\pcbuild.sln /p:Configuration=Release /p:Platform=Win32
+call "%~dp0build.bat" -c Release
@rem build the documentation
-bash.exe -c 'cd Doc;make PYTHON=python2.5 update htmlhelp'
-"%ProgramFiles%\HTML Help Workshop\hhc.exe" Doc\build\htmlhelp\python26a3.hhp
+call "%~dp0..\..\Doc\make.bat" htmlhelp
@rem build the MSI file
-cd PC
+call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" x86
+cd "%~dp0..\..\PC"
nmake /f icons.mak
cd ..\Tools\msi
del *.msi
nmake /f msisupport.mak
%HOST_PYTHON% msi.py
+cd "%cwd%"
diff --git a/Tools/buildbot/clean-amd64.bat b/Tools/buildbot/clean-amd64.bat
index 24660af..4fcd6d4 100644
--- a/Tools/buildbot/clean-amd64.bat
+++ b/Tools/buildbot/clean-amd64.bat
@@ -1,10 +1,2 @@
@rem Used by the buildbot "clean" step.
-call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
-@echo Deleting .pyc/.pyo files ...
-del /s Lib\*.pyc Lib\*.pyo
-@echo Deleting test leftovers ...
-rmdir /s /q build
-cd PCbuild
-msbuild /target:clean pcbuild.sln /p:Configuration=Release /p:PlatformTarget=x64
-msbuild /target:clean pcbuild.sln /p:Configuration=Debug /p:PlatformTarget=x64
-cd ..
+call "%~dp0clean.bat"
diff --git a/Tools/buildbot/clean.bat b/Tools/buildbot/clean.bat
index 218facc..1684e8c 100644
--- a/Tools/buildbot/clean.bat
+++ b/Tools/buildbot/clean.bat
@@ -1,8 +1,22 @@
-@rem Used by the buildbot "clean" step.
-call "%VS100COMNTOOLS%vsvars32.bat"
-@echo Deleting test leftovers ...
-rmdir /s /q build
-cd PCbuild
-msbuild /target:clean pcbuild.sln /p:Configuration=Release /p:PlatformTarget=x86
-msbuild /target:clean pcbuild.sln /p:Configuration=Debug /p:PlatformTarget=x86
-cd ..
+@echo off
+rem Used by the buildbot "clean" step.
+
+setlocal
+set root=%~dp0..\..
+set pcbuild=%root%\PCbuild
+
+echo.Attempting to kill Pythons...
+for %%k in (kill_python.exe
+ kill_python_d.exe
+ amd64\kill_python.exe
+ amd64\kill_python_d.exe
+ ) do (
+ if exist "%pcbuild%\%%k" (
+ echo.Calling %pcbuild%\%%k...
+ "%pcbuild%\%%k"
+ )
+)
+
+echo Purging all non-tracked files with `hg purge`
+echo on
+hg -R "%root%" --config extensions.purge= purge --all -X "%root%\Lib\test\data"
diff --git a/Tools/buildbot/external-amd64.bat b/Tools/buildbot/external-amd64.bat
index f859770..7a570d9 100644
--- a/Tools/buildbot/external-amd64.bat
+++ b/Tools/buildbot/external-amd64.bat
@@ -1,6 +1,2 @@
-@rem Fetches (and builds if necessary) external dependencies
-
-@rem Assume we start inside the Python source directory
-call "Tools\buildbot\external-common.bat"
-
-
+@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
index a58959e..0000000
--- a/Tools/buildbot/external-common.bat
+++ /dev/null
@@ -1,47 +0,0 @@
-@rem Common file shared between external.bat and external-amd64.bat. Responsible for
-@rem fetching external components into the root\.. buildbot directories.
-
-cd ..
-@rem XXX: If you need to force the buildbots to start from a fresh environment, uncomment
-@rem the following, check it in, then check it out, comment it out, then check it back in.
-@rem if exist bzip2-1.0.6 rd /s/q bzip2-1.0.6
-@rem if exist tcltk rd /s/q tcltk
-@rem if exist tcltk64 rd /s/q tcltk64
-@rem if exist tcl-8.6.1.0 rd /s/q tcl-8.6.1.0
-@rem if exist tk-8.6.1.0 rd /s/q tk-8.6.1.0
-@rem if exist tix-8.4.3.4 rd /s/q tix-8.4.3.4
-@rem if exist db-4.4.20 rd /s/q db-4.4.20
-@rem if exist openssl-1.0.1h rd /s/q openssl-1.0.1h
-@rem if exist sqlite-3.7.12 rd /s/q sqlite-3.7.12
-
-@rem bzip
-if not exist bzip2-1.0.6 (
- rd /s/q bzip2-1.0.5
- svn export http://svn.python.org/projects/external/bzip2-1.0.6
-)
-
-@rem OpenSSL
-if not exist openssl-1.0.1h (
- rd /s/q openssl-1.0.1g
- svn export http://svn.python.org/projects/external/openssl-1.0.1h
-)
-
-@rem tcl/tk/tix
-if not exist tcl-8.6.1.0 (
- rd /s/q tcltk tcltk64 tcl-8.5.11.0 tk-8.5.11.0 tix-8.4.3.3
- svn export http://svn.python.org/projects/external/tcl-8.6.1.0
-)
-if not exist tk-8.6.1.0 svn export http://svn.python.org/projects/external/tk-8.6.1.0
-if not exist tix-8.4.3.4 svn export http://svn.python.org/projects/external/tix-8.4.3.4
-
-@rem sqlite3
-if not exist sqlite-3.8.3.1 (
- rd /s/q sqlite-source-3.8.1
- svn export http://svn.python.org/projects/external/sqlite-3.8.3.1
-)
-
-@rem lzma
-if not exist xz-5.0.5 (
- rd /s/q xz-5.0.3
- svn export http://svn.python.org/projects/external/xz-5.0.5
-)
diff --git a/Tools/buildbot/external.bat b/Tools/buildbot/external.bat
index 22dfdc5..7a570d9 100644
--- a/Tools/buildbot/external.bat
+++ b/Tools/buildbot/external.bat
@@ -1,5 +1,2 @@
-@rem Fetches (and builds if necessary) external dependencies
-
-@rem Assume we start inside the Python source directory
-call "Tools\buildbot\external-common.bat"
-
+@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
index 11bfcbb..b693277 100644
--- a/Tools/buildbot/test-amd64.bat
+++ b/Tools/buildbot/test-amd64.bat
@@ -1,6 +1,6 @@
@rem Used by the buildbot "test" step.
rem The following line should be removed before #20035 is closed
-set TCL_LIBRARY=%CD%\..\tcltk64\lib\tcl8.6
-cd PCbuild
-call rt.bat -d -q -x64 -uall -rwW -n --timeout=3600 %1 %2 %3 %4 %5 %6 %7 %8 %9
+set TCL_LIBRARY=%~dp0..\..\..\tcltk64\lib\tcl8.6
+
+"%~dp0..\..\PCbuild\amd64\python_d.exe" "%~dp0..\scripts\run_tests.py" -j 1 -u all -W --timeout=3600 %*
diff --git a/Tools/buildbot/test.bat b/Tools/buildbot/test.bat
index 6b98c79..ec6eaff 100644
--- a/Tools/buildbot/test.bat
+++ b/Tools/buildbot/test.bat
@@ -1,6 +1,6 @@
@rem Used by the buildbot "test" step.
rem The following line should be removed before #20035 is closed
-set TCL_LIBRARY=%CD%\..\tcltk\lib\tcl8.6
-cd PCbuild
-call rt.bat -d -q -uall -rwW -n --timeout=3600 %1 %2 %3 %4 %5 %6 %7 %8 %9
+set TCL_LIBRARY=%~dp0..\..\..\tcltk\lib\tcl8.6
+
+"%~dp0..\..\PCbuild\python_d.exe" "%~dp0..\scripts\run_tests.py" -j 1 -u all -W --timeout=3600 %*
diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
index 490a37e..b451a75 100644
--- a/Tools/scripts/run_tests.py
+++ b/Tools/scripts/run_tests.py
@@ -48,7 +48,11 @@ def main(regrtest_args):
args.extend(['-u', 'all,-largefile,-audio,-gui'])
args.extend(regrtest_args)
print(' '.join(args))
- os.execv(sys.executable, args)
+ if sys.platform == 'win32':
+ from subprocess import call
+ call(args)
+ else:
+ os.execv(sys.executable, args)
if __name__ == '__main__':