]> granicus.if.org Git - python/commitdiff
Merged revisions 62129,62131,62133 via svnmerge from
authorTrent Nelson <trent.nelson@snakebite.org>
Thu, 3 Apr 2008 20:47:30 +0000 (20:47 +0000)
committerTrent Nelson <trent.nelson@snakebite.org>
Thu, 3 Apr 2008 20:47:30 +0000 (20:47 +0000)
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.
........

13 files changed:
PCbuild/debug.vsprops
PCbuild/kill_python.c [new file with mode: 0644]
PCbuild/kill_python.vcproj [new file with mode: 0644]
PCbuild/pcbuild.sln
PCbuild/pythoncore.vcproj
PCbuild/release.vsprops
Tools/buildbot/Makefile [deleted file]
Tools/buildbot/build-amd64.bat
Tools/buildbot/build.bat
Tools/buildbot/buildmsi.bat
Tools/buildbot/kill_python.bat [deleted file]
Tools/buildbot/kill_python.c [deleted file]
Tools/buildbot/kill_python.mak [deleted file]

index 59acd9097492e5faa4f8ca764e3f1715b376f696..2be7f742314ff0d9280a9d31bd3d812b07f24151 100644 (file)
@@ -8,4 +8,8 @@
                Name="VCCLCompilerTool"
                PreprocessorDefinitions="_DEBUG"
        />
-</VisualStudioPropertySheet>
\ No newline at end of file
+       <UserMacro
+               Name="KillPythonExe"
+               Value="$(OutDir)\kill_python_d.exe"
+       />
+</VisualStudioPropertySheet>
diff --git a/PCbuild/kill_python.c b/PCbuild/kill_python.c
new file mode 100644 (file)
index 0000000..8ee22e8
--- /dev/null
@@ -0,0 +1,178 @@
+/*\r
+ * Helper program for killing lingering python[_d].exe processes before\r
+ * building, thus attempting to avoid build failures due to files being\r
+ * locked.\r
+ */\r
+\r
+#include <windows.h>\r
+#include <wchar.h>\r
+#include <tlhelp32.h>\r
+#include <stdio.h>\r
+\r
+#pragma comment(lib, "psapi")\r
+\r
+#ifdef _DEBUG\r
+#define PYTHON_EXE          (L"python_d.exe")\r
+#define PYTHON_EXE_LEN      (12)\r
+#define KILL_PYTHON_EXE     (L"kill_python_d.exe")\r
+#define KILL_PYTHON_EXE_LEN (17)\r
+#else\r
+#define PYTHON_EXE          (L"python.exe")\r
+#define PYTHON_EXE_LEN      (10)\r
+#define KILL_PYTHON_EXE     (L"kill_python.exe")\r
+#define KILL_PYTHON_EXE_LEN (15)\r
+#endif\r
+\r
+int\r
+main(int argc, char **argv)\r
+{\r
+    HANDLE   hp, hsp, hsm; /* process, snapshot processes, snapshot modules */\r
+    DWORD    dac, our_pid;\r
+    size_t   len;\r
+    wchar_t  path[MAX_PATH+1];\r
+\r
+    MODULEENTRY32W  me;\r
+    PROCESSENTRY32W pe;\r
+\r
+    me.dwSize = sizeof(MODULEENTRY32W);\r
+    pe.dwSize = sizeof(PROCESSENTRY32W);\r
+\r
+    memset(path, 0, MAX_PATH+1);\r
+\r
+    our_pid = GetCurrentProcessId();\r
+\r
+    hsm = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, our_pid);\r
+    if (hsm == INVALID_HANDLE_VALUE) {\r
+        printf("CreateToolhelp32Snapshot[1] failed: %d\n", GetLastError());\r
+        return 1;\r
+    }\r
+\r
+    if (!Module32FirstW(hsm, &me)) {\r
+        printf("Module32FirstW[1] failed: %d\n", GetLastError());\r
+        CloseHandle(hsm);\r
+        return 1;\r
+    }\r
+\r
+    /*\r
+     * Enumerate over the modules for the current process in order to find\r
+     * kill_process[_d].exe, then take a note of the directory it lives in.\r
+     */\r
+    do {\r
+        if (_wcsnicmp(me.szModule, KILL_PYTHON_EXE, KILL_PYTHON_EXE_LEN))\r
+            continue;\r
+\r
+        len = wcsnlen_s(me.szExePath, MAX_PATH) - KILL_PYTHON_EXE_LEN;\r
+        wcsncpy_s(path, MAX_PATH+1, me.szExePath, len); \r
+\r
+        break;\r
+\r
+    } while (Module32NextW(hsm, &me));\r
+\r
+    CloseHandle(hsm);\r
+\r
+    if (path == NULL) {\r
+        printf("failed to discern directory of running process\n");\r
+        return 1;\r
+    }\r
+\r
+    /*\r
+     * Take a snapshot of system processes.  Enumerate over the snapshot,\r
+     * looking for python processes.  When we find one, verify it lives\r
+     * in the same directory we live in.  If it does, kill it.  If we're\r
+     * unable to kill it, treat this as a fatal error and return 1.\r
+     * \r
+     * The rationale behind this is that we're called at the start of the \r
+     * build process on the basis that we'll take care of killing any\r
+     * running instances, such that the build won't encounter permission\r
+     * denied errors during linking. If we can't kill one of the processes,\r
+     * we can't provide this assurance, and the build shouldn't start.\r
+     */\r
+\r
+    hsp = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);\r
+    if (hsp == INVALID_HANDLE_VALUE) {\r
+        printf("CreateToolhelp32Snapshot[2] failed: %d\n", GetLastError());\r
+        return 1;\r
+    }\r
+\r
+    if (!Process32FirstW(hsp, &pe)) {\r
+        printf("Process32FirstW failed: %d\n", GetLastError());\r
+        CloseHandle(hsp);\r
+        return 1;\r
+    }\r
+\r
+    dac = PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_TERMINATE;\r
+    do {\r
+\r
+        /*\r
+         * XXX TODO: if we really wanted to be fancy, we could check the \r
+         * modules for all processes (not just the python[_d].exe ones)\r
+         * and see if any of our DLLs are loaded (i.e. python30[_d].dll),\r
+         * as that would also inhibit our ability to rebuild the solution.\r
+         * Not worth loosing sleep over though; for now, a simple check \r
+         * for just the python executable should be sufficient.\r
+         */\r
+\r
+        if (_wcsnicmp(pe.szExeFile, PYTHON_EXE, PYTHON_EXE_LEN))\r
+            /* This isn't a python process. */\r
+            continue;\r
+\r
+        /* It's a python process, so figure out which directory it's in... */\r
+        hsm = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pe.th32ProcessID);\r
+        if (hsm == INVALID_HANDLE_VALUE)\r
+            /* \r
+             * If our module snapshot fails (which will happen if we don't own\r
+             * the process), just ignore it and continue.  (It seems different\r
+             * versions of Windows return different values for GetLastError()\r
+             * in this situation; it's easier to just ignore it and move on vs.\r
+             * stopping the build for what could be a false positive.)\r
+             */\r
+             continue;\r
+\r
+        if (!Module32FirstW(hsm, &me)) {\r
+            printf("Module32FirstW[2] failed: %d\n", GetLastError());\r
+            CloseHandle(hsp);\r
+            CloseHandle(hsm);\r
+            return 1;\r
+        }\r
+\r
+        do {\r
+            if (_wcsnicmp(me.szModule, PYTHON_EXE, PYTHON_EXE_LEN))\r
+                /* Wrong module, we're looking for python[_d].exe... */\r
+                continue;\r
+\r
+            if (_wcsnicmp(path, me.szExePath, len))\r
+                /* Process doesn't live in our directory. */\r
+                break;\r
+\r
+            /* Python process residing in the right directory, kill it!  */\r
+            hp = OpenProcess(dac, FALSE, pe.th32ProcessID);\r
+            if (!hp) {\r
+                printf("OpenProcess failed: %d\n", GetLastError());\r
+                CloseHandle(hsp);\r
+                CloseHandle(hsm);\r
+                return 1;\r
+            }\r
+\r
+            if (!TerminateProcess(hp, 1)) {\r
+                printf("TerminateProcess failed: %d\n", GetLastError());\r
+                CloseHandle(hsp);\r
+                CloseHandle(hsm);\r
+                CloseHandle(hp);\r
+                return 1;\r
+            }\r
+\r
+            CloseHandle(hp);\r
+            break;\r
+\r
+        } while (Module32NextW(hsm, &me));\r
+\r
+        CloseHandle(hsm);\r
+\r
+    } while (Process32NextW(hsp, &pe));\r
+\r
+    CloseHandle(hsp);\r
+\r
+    return 0;\r
+}\r
+\r
+/* vi: set ts=8 sw=4 sts=4 expandtab */\r
diff --git a/PCbuild/kill_python.vcproj b/PCbuild/kill_python.vcproj
new file mode 100644 (file)
index 0000000..9f11075
--- /dev/null
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="kill_python"\r
+       ProjectGUID="{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}"\r
+       RootNamespace="kill_python"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+               <Platform\r
+                       Name="x64"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops"\r
+                       CharacterSet="0"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)\$(ProjectName)_d.exe"\r
+                               SubSystem="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               Description="Killing existing Python processes..."\r
+                               CommandLine="&quot;$(KillPythonExe)&quot;"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|x64"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets=".\pyproject.vsprops;.\debug.vsprops;.\x64.vsprops"\r
+                       CharacterSet="0"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)\$(ProjectName)_d.exe"\r
+                               SubSystem="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               Description="Killing existing Python processes..."\r
+                               CommandLine="&quot;$(KillPythonExe)&quot;"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"\r
+                       CharacterSet="0"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               SubSystem="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               Description="Killing existing Python processes..."\r
+                               CommandLine="&quot;$(KillPythonExe)&quot;"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|x64"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\x64.vsprops"\r
+                       CharacterSet="0"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               SubSystem="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               Description="Killing existing Python processes..."\r
+                               CommandLine="&quot;$(KillPythonExe)&quot;"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\kill_python.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 6838d6264360c6414d6c990b3eb82612ac6173be..a12c05592317facc2ca2fec467b1d60693fc48ab 100644 (file)
@@ -11,6 +11,7 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"
        ProjectSection(ProjectDependencies) = postProject
                {F0E0541E-F17D-430B-97C4-93ADF0DD284E} = {F0E0541E-F17D-430B-97C4-93ADF0DD284E}
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31} = {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}
                {C73F0EC1-358B-4177-940F-0846AC8B04CD} = {C73F0EC1-358B-4177-940F-0846AC8B04CD}
        EndProjectSection
 EndProject
@@ -20,6 +21,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcproj",
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "w9xpopen", "w9xpopen.vcproj", "{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}"
+       ProjectSection(ProjectDependencies) = postProject
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31} = {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}
+       EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_buildinfo", "make_buildinfo.vcproj", "{C73F0EC1-358B-4177-940F-0846AC8B04CD}"
 EndProject
@@ -36,6 +40,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcproj
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bsddb", "_bsddb.vcproj", "{B4D38F3F-68FB-42EC-A45D-E00657BB3627}"
        ProjectSection(ProjectDependencies) = postProject
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31} = {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}
                {62172C7D-B39E-409A-B352-370FF5098C19} = {62172C7D-B39E-409A-B352-370FF5098C19}
                {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
        EndProjectSection
@@ -117,8 +122,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcproj
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bsddb44", "_bsddb44.vcproj", "{62172C7D-B39E-409A-B352-370FF5098C19}"
+       ProjectSection(ProjectDependencies) = postProject
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31} = {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}
+       EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}"
+       ProjectSection(ProjectDependencies) = postProject
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31} = {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kill_python", "kill_python.vcproj", "{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}"
 EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -524,6 +537,22 @@ Global
                {A1A295E5-463C-437F-81CA-1F32367685DA}.Release|Win32.Build.0 = Release|Win32
                {A1A295E5-463C-437F-81CA-1F32367685DA}.Release|x64.ActiveCfg = Release|x64
                {A1A295E5-463C-437F-81CA-1F32367685DA}.Release|x64.Build.0 = Release|x64
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|Win32.ActiveCfg = Debug|Win32
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|Win32.Build.0 = Debug|Win32
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|x64.ActiveCfg = Debug|x64
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Debug|x64.Build.0 = Debug|x64
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGInstrument|Win32.ActiveCfg = Release|Win32
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGInstrument|Win32.Build.0 = Release|Win32
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGInstrument|x64.ActiveCfg = Release|x64
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGInstrument|x64.Build.0 = Release|x64
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGUpdate|Win32.ActiveCfg = Release|Win32
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGUpdate|Win32.Build.0 = Release|Win32
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGUpdate|x64.ActiveCfg = Release|x64
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.PGUpdate|x64.Build.0 = Release|x64
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|Win32.ActiveCfg = Release|Win32
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|Win32.Build.0 = Release|Win32
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.ActiveCfg = Release|x64
+               {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 930ee5f6d1beb40136e4c8e7fc75bee92b3f9a2d..9c9c239446310a8314a9de3d35edcc5382990260 100644 (file)
@@ -58,8 +58,8 @@
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="generate buildinfo"
-                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; $(ConfigurationName)"
+                               Description="Generate build information and kill existing Python processes..."
+                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release&#x0D;&#x0A;&quot;$(KillPythonExe)&quot;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="generate buildinfo"
-                               CommandLine="$(SolutionDir)make_buildinfo.exe $(ConfigurationName)"
+                               Description="Generate build information and kill existing Python processes..."
+                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release&#x0D;&#x0A;&quot;$(KillPythonExe)&quot;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="generate buildinfo"
-                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; $(ConfigurationName)"
+                               Description="Generate build information and kill existing Python processes..."
+                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug&#x0D;&#x0A;&quot;$(KillPythonExe)&quot;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="generate buildinfo"
-                               CommandLine="$(SolutionDir)make_buildinfo.exe $(ConfigurationName)"
+                               Description="Generate build information and kill existing Python processes..."
+                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug&#x0D;&#x0A;&quot;$(KillPythonExe)&quot;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="generate buildinfo"
-                               CommandLine="$(SolutionDir)make_buildinfo.exe Release"
+                               Description="Generate build information and kill existing Python processes..."
+                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release&#x0D;&#x0A;&quot;$(KillPythonExe)&quot;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="generate buildinfo"
-                               CommandLine="$(SolutionDir)make_buildinfo.exe $(ConfigurationName)"
+                               Description="Generate build information and kill existing Python processes..."
+                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release&#x0D;&#x0A;&quot;$(KillPythonExe)&quot;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="generate buildinfo"
-                               CommandLine="$(SolutionDir)make_buildinfo.exe Release"
+                               Description="Generate build information and kill existing Python processes..."
+                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release&#x0D;&#x0A;&quot;$(KillPythonExe)&quot;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="generate buildinfo"
-                               CommandLine="$(SolutionDir)make_buildinfo.exe $(ConfigurationName)"
+                               Description="Generate build information and kill existing Python processes..."
+                               CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release&#x0D;&#x0A;&quot;$(KillPythonExe)&quot;"
                        />
                        <Tool
                                Name="VCLinkerTool"
index 4bbda6820d7acd79fda1bc792d9884322b01eded..6d6842d623cc081b85488ae5034b232c9b4d94c3 100644 (file)
@@ -8,4 +8,8 @@
                Name="VCCLCompilerTool"
                PreprocessorDefinitions="NDEBUG"
        />
+       <UserMacro
+               Name="KillPythonExe"
+               Value="$(OutDir)\kill_python.exe"
+       />      
 </VisualStudioPropertySheet>
diff --git a/Tools/buildbot/Makefile b/Tools/buildbot/Makefile
deleted file mode 100644 (file)
index 1660231..0000000
+++ /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
-
index 0425d19a301479f18a7bd511507c7fafc0da173f..1d828ebc4f39fcec445cc079d1552f72b589d1c2 100644 (file)
@@ -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"
index 508798125a0b73244bbe76c9951259f6c5406e23..6bac3edbeb9768952d1c3f78d59ea3af5576eaa0 100644 (file)
@@ -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"
 
index 54101931c2ab718e5d1261cbb6a7a0d165eafd0f..962df6638f91e45d681ca6bd6d1acb53cf429212 100644 (file)
@@ -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 (file)
index d78b6d4..0000000
+++ /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 (file)
index 5ba450f..0000000
+++ /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 (file)
index 6027d3f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-kill_python.exe:       kill_python.c
-               cl -nologo -o kill_python.exe kill_python.c psapi.lib