diff options
author | Trent Nelson <trent.nelson@snakebite.org> | 2008-04-03 20:47:30 (GMT) |
---|---|---|
committer | Trent Nelson <trent.nelson@snakebite.org> | 2008-04-03 20:47:30 (GMT) |
commit | 61828c725aa7324cb192ca9486de464c58b5871f (patch) | |
tree | 21a68814a5666299233fd2c0eb7b726509475b09 /Tools | |
parent | f12e5411743fe1a2c43efe90c906c1f330b0f1f9 (diff) | |
download | cpython-61828c725aa7324cb192ca9486de464c58b5871f.zip cpython-61828c725aa7324cb192ca9486de464c58b5871f.tar.gz cpython-61828c725aa7324cb192ca9486de464c58b5871f.tar.bz2 |
Merged revisions 62129,62131,62133 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r62129 | trent.nelson | 2008-04-03 19:27:06 +0100 (Thu, 03 Apr 2008) | 16 lines
Reimplement kill_python. The existing version had a number of flaws, namely, it didn't work for x64 and it wasn't precise about which python_d.exe it was killing -- it just killed the first one it came across that happened to have 'pcbuild\python_d.exe' or 'build\python_d.exe' in it's path. The new version has been rewritten from the ground up and now lives in PCbuild, instead of Tools\buildbot, and it has also been incorporated into the Visual Studio solution (pcbuild.sln) as 'kill_python'. The solution has also been altered such that kill_python is called where necessary in the build process in order to prevent any linking errors due to open file locks. In lieu of this, all of the existing bits and pieces in Tools\buildbot that called out to kill_python at various points have also been removed as they are now obsolete. Tested on both Win32 and x64.
Change set (included to improve usefulness of svnmerge log entry):
M PCbuild\pythoncore.vcproj
M PCbuild\pcbuild.sln
M PCbuild\release.vsprops
A PCbuild\kill_python.vcproj
M PCbuild\debug.vsprops
A PCbuild\kill_python.c
D Tools\buildbot\kill_python.bat
D Tools\buildbot\kill_python.mak
M Tools\buildbot\build.bat
D Tools\buildbot\Makefile
M Tools\buildbot\build-amd64.bat
M Tools\buildbot\buildmsi.bat
D Tools\buildbot\kill_python.c
........
r62131 | trent.nelson | 2008-04-03 19:48:53 +0100 (Thu, 03 Apr 2008) | 1 line
Add the correct OutputFile values for debug builds. Fixes r62129's commit.
........
r62133 | trent.nelson | 2008-04-03 21:00:08 +0100 (Thu, 03 Apr 2008) | 1 line
Make kill_python a little more forgiving if it can't obtain a snapshot of module information for a given python[_d].exe process. Failing here was too pessimistic; the python[_d].exe process may be owned by another user, which is the case in some buildbot environments.
........
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/buildbot/Makefile | 6 | ||||
-rw-r--r-- | Tools/buildbot/build-amd64.bat | 1 | ||||
-rw-r--r-- | Tools/buildbot/build.bat | 1 | ||||
-rw-r--r-- | Tools/buildbot/buildmsi.bat | 1 | ||||
-rw-r--r-- | Tools/buildbot/kill_python.bat | 3 | ||||
-rw-r--r-- | Tools/buildbot/kill_python.c | 68 | ||||
-rw-r--r-- | Tools/buildbot/kill_python.mak | 2 |
7 files changed, 0 insertions, 82 deletions
diff --git a/Tools/buildbot/Makefile b/Tools/buildbot/Makefile deleted file mode 100644 index 1660231..0000000 --- a/Tools/buildbot/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -all: kill_python.exe - ./kill_python.exe - -kill_python.exe: kill_python.c - gcc -o kill_python.exe kill_python.c -lpsapi - diff --git a/Tools/buildbot/build-amd64.bat b/Tools/buildbot/build-amd64.bat index 0425d19..1d828eb 100644 --- a/Tools/buildbot/build-amd64.bat +++ b/Tools/buildbot/build-amd64.bat @@ -1,6 +1,5 @@ @rem Used by the buildbot "compile" step. cmd /c Tools\buildbot\external-amd64.bat call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 -REM cmd /q/c Tools\buildbot\kill_python.bat cmd /c Tools\buildbot\clean-amd64.bat vcbuild PCbuild\pcbuild.sln "Debug|x64" diff --git a/Tools/buildbot/build.bat b/Tools/buildbot/build.bat index 5087981..6bac3ed 100644 --- a/Tools/buildbot/build.bat +++ b/Tools/buildbot/build.bat @@ -1,7 +1,6 @@ @rem Used by the buildbot "compile" step. cmd /c Tools\buildbot\external.bat call "%VS90COMNTOOLS%vsvars32.bat" -cmd /q/c Tools\buildbot\kill_python.bat cmd /c Tools\buildbot\clean.bat vcbuild /useenv PCbuild\pcbuild.sln "Debug|Win32" diff --git a/Tools/buildbot/buildmsi.bat b/Tools/buildbot/buildmsi.bat index 5410193..962df66 100644 --- a/Tools/buildbot/buildmsi.bat +++ b/Tools/buildbot/buildmsi.bat @@ -8,7 +8,6 @@ if not exist ..\db-4.4.20\build_win32\release\libdb44s.lib ( ) @rem build Python -cmd /q/c Tools\buildbot\kill_python.bat vcbuild /useenv PCbuild\pcbuild.sln "Release|Win32" @rem build the documentation diff --git a/Tools/buildbot/kill_python.bat b/Tools/buildbot/kill_python.bat deleted file mode 100644 index d78b6d4..0000000 --- a/Tools/buildbot/kill_python.bat +++ /dev/null @@ -1,3 +0,0 @@ -cd Tools\buildbot -nmake /C /S /f kill_python.mak -kill_python.exe diff --git a/Tools/buildbot/kill_python.c b/Tools/buildbot/kill_python.c deleted file mode 100644 index 5ba450f..0000000 --- a/Tools/buildbot/kill_python.c +++ /dev/null @@ -1,68 +0,0 @@ -/* This program looks for processes which have build\PCbuild\python.exe - in their path and terminates them. */ -#include <windows.h> -#include <psapi.h> -#include <stdio.h> - -int main() -{ - DWORD pids[1024], cbNeeded; - int i, num_processes; - if (!EnumProcesses(pids, sizeof(pids), &cbNeeded)) { - printf("EnumProcesses failed\n"); - return 1; - } - num_processes = cbNeeded/sizeof(pids[0]); - for (i = 0; i < num_processes; i++) { - HANDLE hProcess; - char path[MAX_PATH]; - HMODULE mods[1024]; - int k, num_mods; - hProcess = OpenProcess(PROCESS_QUERY_INFORMATION - | PROCESS_VM_READ - | PROCESS_TERMINATE , - FALSE, pids[i]); - if (!hProcess) - /* process not accessible */ - continue; - if (!EnumProcessModules(hProcess, mods, sizeof(mods), &cbNeeded)) { - /* For unknown reasons, this sometimes returns ERROR_PARTIAL_COPY; - this apparently means we are not supposed to read the process. */ - if (GetLastError() == ERROR_PARTIAL_COPY) { - CloseHandle(hProcess); - continue; - } - printf("EnumProcessModules failed: %d\n", GetLastError()); - return 1; - } - if (!GetModuleFileNameEx(hProcess, NULL, path, sizeof(path))) { - printf("GetProcessImageFileName failed\n"); - return 1; - } - - _strlwr(path); - /* printf("%s\n", path); */ - - /* Check if we are running a buildbot version of Python. - - On Windows, this will always be a debug build from the - PCbuild directory. build\\PCbuild\\python_d.exe - - On Cygwin, the pathname is similar to other Unixes. - Use \\build\\python.exe to ensure we don't match - PCbuild\\python.exe which could be a normal instance - of Python running on vanilla Windows. - */ - if ((strstr(path, "pcbuild\\python_d.exe") != NULL) || - (strstr(path, "\\build\\python.exe") != NULL)) { - printf("Terminating %s (pid %d)\n", path, pids[i]); - if (!TerminateProcess(hProcess, 1)) { - printf("Termination failed: %d\n", GetLastError()); - return 1; - } - return 0; - } - - CloseHandle(hProcess); - } -} diff --git a/Tools/buildbot/kill_python.mak b/Tools/buildbot/kill_python.mak deleted file mode 100644 index 6027d3f..0000000 --- a/Tools/buildbot/kill_python.mak +++ /dev/null @@ -1,2 +0,0 @@ -kill_python.exe: kill_python.c - cl -nologo -o kill_python.exe kill_python.c psapi.lib |