# HG changeset patch # User Steve Dower # Date 1416689881 28800 # Sat Nov 22 12:58:01 2014 -0800 # Branch Projects # Node ID d08b456124e51369d023bd28735255e9bcb1e2b1 # Parent 73d74d6d28a3729c5738c7125b2fd49ab3e1ab55 Changes diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -19,6 +19,8 @@ i = i + len(prefix) s, rest = sys.version[i:].split(" ", 1) majorVersion = int(s[:-2]) - 6 + if majorVersion >= 13: + majorVersion += 1 minorVersion = int(s[2:3]) / 10.0 # I don't think paths are affected by minor version in version 6 if majorVersion == 6: @@ -36,8 +38,10 @@ return None if version <= 6: clibname = 'msvcrt' + elif version <= 13: + clibname = 'msvcr%d' % (version * 10) else: - clibname = 'msvcr%d' % (version * 10) + clibname = 'appcrt%d' % (version * 10) # If python was built with in debug mode import importlib.machinery diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -7,6 +7,17 @@ #include +#ifdef _MSC_VER +#if _MSC_VER >= 1900 +/* MSVC 14 redefines these names with a leading underscore, but they are + * otherwise identical. + */ +#define timezone _timezone +#define daylight _daylight +#define tzname _tzname +#endif +#endif + /* Differentiate between building the core module and building extension * modules. */ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1046,15 +1046,33 @@ /* The actual size of the structure is determined at runtime. * Only the first items must be present. */ + +#if _MSC_VER >= 1900 + +typedef struct { + CRITICAL_SECTION lock; + intptr_t osfhnd; + __int64 startpos; + char osfile; +} my_ioinfo; + +#define IOINFO_L2E 6 +#define IOINFO_ARRAYS 128 + +#else + typedef struct { intptr_t osfhnd; char osfile; } my_ioinfo; +#define IOINFO_L2E 5 +#define IOINFO_ARRAYS 64 + +#endif + extern __declspec(dllimport) char * __pioinfo[]; -#define IOINFO_L2E 5 #define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) -#define IOINFO_ARRAYS 64 #define _NHANDLE_ (IOINFO_ARRAYS * IOINFO_ARRAY_ELTS) #define FOPEN 0x01 #define _NO_CONSOLE_FILENO (intptr_t)-2 diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -284,6 +284,11 @@ # include # endif +#if defined(_MSC_VER) && _MSC_VER >= 1800 +/* Provides the IsWindows7SP1OrGreater() function */ +#include +#endif + #endif #include @@ -5845,11 +5850,15 @@ #ifdef MS_WINDOWS if (support_wsa_no_inherit == -1) { +#if defined(_MSC_VER) && _MSC_VER >= 1800 + support_wsa_no_inherit = IsWindows7SP1OrGreater(); +#else DWORD version = GetVersion(); DWORD major = (DWORD)LOBYTE(LOWORD(version)); DWORD minor = (DWORD)HIBYTE(LOWORD(version)); /* need Windows 7 SP1, 2008 R2 SP1 or later */ - support_wsa_no_inherit = (major >= 6 && minor >= 1); + support_wsa_no_inherit = major > 6 || (major == 6 && minor >= 1); +#endif } #endif diff --git a/Modules/timemodule.c b/Modules/timemodule.c --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -30,14 +30,19 @@ #endif /* MS_WINDOWS */ #endif /* !__WATCOMC__ || __QNX__ */ +#if defined(_MSC_VER) && _MSC_VER >= 1900 +/* MSVC 14 redefines these names with a leading underscore, but they are +* otherwise identical. +*/ +#define timezone _timezone +#define daylight _daylight +#define tzname _tzname +#endif + /* Forward declarations */ static int floatsleep(double); static PyObject* floattime(_Py_clock_info_t *info); -#ifdef MS_WINDOWS -static OSVERSIONINFOEX winver; -#endif - static PyObject * time_time(PyObject *self, PyObject *unused) { @@ -1359,15 +1364,6 @@ if (PyStructSequence_InitType2(&StructTimeType, &struct_time_type_desc) < 0) return NULL; - -#ifdef MS_WINDOWS - winver.dwOSVersionInfoSize = sizeof(winver); - if (!GetVersionEx((OSVERSIONINFO*)&winver)) { - Py_DECREF(m); - PyErr_SetFromWindowsErr(0); - return NULL; - } -#endif } Py_INCREF(&StructTimeType); #ifdef HAVE_STRUCT_TM_TM_ZONE diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c --- a/PC/bdist_wininst/install.c +++ b/PC/bdist_wininst/install.c @@ -82,6 +82,10 @@ #include #include #include "resource.h" +#if defined(_MSC_VER) && _MSC_VER >= 1800 +/* Provides the IsWindowsXPOrGreater() function */ +#include +#endif #include #include @@ -1216,7 +1220,7 @@ #include -BOOL CALLBACK +INT_PTR CALLBACK IntroDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { LPNMHDR lpnm; @@ -1565,7 +1569,7 @@ return old_scheme; } -BOOL CALLBACK +INT_PTR CALLBACK SelectPythonDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { LPNMHDR lpnm; @@ -1857,7 +1861,7 @@ fclose(logfile); } -BOOL CALLBACK +INT_PTR CALLBACK InstallFilesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { LPNMHDR lpnm; @@ -2012,7 +2016,7 @@ } -BOOL CALLBACK +INT_PTR CALLBACK FinishedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { LPNMHDR lpnm; @@ -2194,6 +2198,9 @@ // Note that win2k does seem to support ShellExecute with 'runas', // but does *not* support IsUserAnAdmin - so we just pretend things // only work on XP and later. +#if defined(_MSC_VER) && _MSC_VER >= 1800 + return IsWindowsXPOrGreater(); +#else BOOL bIsWindowsXPorLater; OSVERSIONINFO winverinfo; winverinfo.dwOSVersionInfoSize = sizeof(winverinfo); @@ -2203,6 +2210,7 @@ ( (winverinfo.dwMajorVersion > 5) || ( (winverinfo.dwMajorVersion == 5) && (winverinfo.dwMinorVersion >= 1) )); return bIsWindowsXPorLater; +#endif } // Spawn ourself as an elevated application. On failure, a message is diff --git a/PC/pylauncher.rc b/PC/pylauncher.rc --- a/PC/pylauncher.rc +++ b/PC/pylauncher.rc @@ -34,7 +34,7 @@ VALUE "FileDescription", "Python Launcher for Windows (Console)" VALUE "FileVersion", PYTHON_VERSION VALUE "InternalName", "py" - VALUE "LegalCopyright", "Copyright (C) 2011-2012 Python Software Foundation" + VALUE "LegalCopyright", "Copyright (C) 2011-2014 Python Software Foundation" VALUE "OriginalFilename", "py" VALUE "ProductName", "Python Launcher for Windows" VALUE "ProductVersion", PYTHON_VERSION diff --git a/PC/python_nt.rc b/PC/python_nt.rc --- a/PC/python_nt.rc +++ b/PC/python_nt.rc @@ -13,7 +13,7 @@ #endif /* e.g., 3.3.0a1 - * PY_VERSION comes from patchevel.h + * PY_VERSION comes from patchlevel.h */ #define PYTHON_VERSION PY_VERSION "\0" diff --git a/PC/readme.txt b/PC/readme.txt --- a/PC/readme.txt +++ b/PC/readme.txt @@ -76,7 +76,7 @@ Legacy support for older versions of Visual Studio ================================================== -The subdirectories VC6, VS7.1 and VS8.0 contain legacy support older +The subdirectories VS9.0 and VS10.0 contain legacy support for older versions of Microsoft Visual Studio. See PCbuild/readme.txt. Note for Windows 3.x and DOS users diff --git a/PCbuild/build.bat b/PCbuild/build.bat --- a/PCbuild/build.bat +++ b/PCbuild/build.bat @@ -6,29 +6,35 @@ 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, Clean, or CleanAll) rem -d Set the configuration to Debug rem -e Pull in external libraries using get_externals.bat +rem -M Disable parallel build setlocal set platf=Win32 +set vs_platf=x86 set conf=Release set target=Build set dir=%~dp0 +set parallel=/m :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' (set target=%2) & shift & shift & goto CheckOpts if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts +if '%1'=='-M' (set parallel=) & shift & goto CheckOpts if '%platf%'=='x64' (set vs_platf=x86_amd64) rem Setup the environment -call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" %vs_platf% +call "%dir%env.bat" %vs_platf% rem Call on MSBuild 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 -msbuild "%dir%pcbuild.sln" /t:%target% /p:Configuration=%conf% /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9 +msbuild "%dir%pcbuild.proj" /t:%target% %parallel% /p:Configuration=%conf% /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/PCbuild/build_pgo.bat b/PCbuild/build_pgo.bat --- a/PCbuild/build_pgo.bat +++ b/PCbuild/build_pgo.bat @@ -7,6 +7,7 @@ setlocal set platf=Win32 +set parallel=/m set dir=%~dp0 rem use the performance testsuite. This is quick and simple @@ -23,26 +24,25 @@ :CheckOpts if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts if "%1"=="-2" (set job=%job2%) & (set clrpath=%path2%) & shift & goto CheckOpts +if "%1"=="-M" (set parallel=) & shift & goto CheckOpts -set PGI=%dir%%platf%-pgi -set PGO=%dir%%platf%-pgo rem We cannot cross compile PGO builds, as the optimization needs to be run natively set vs_platf=x86 -if "%platf%"=="x64" (set vs_platf=amd64) +set PGO=%dir%win32-pgo + +if "%platf%"=="x64" (set vs_platf=amd64) & (set PGO=%dir%amd64-pgo) rem Setup the environment -call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" %vs_platf% +call "%dir%env.bat" %vs_platf% + rem build the instrumented version -msbuild "%dir%pcbuild.sln" /t:Build /p:Configuration=PGInstrument /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9 +msbuild "%dir%pcbuild.proj" %parallel% /t:Build /p:Configuration=PGInstrument /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9 rem remove .pyc files, .pgc files and execute the job -"%PGI%\python.exe" "%dir%rmpyc.py" %clrpath% -del "%PGI%\*.pgc" -"%PGI%\python.exe" %job% - -rem clean -if exist "%PGO%" del /s /q "%PGO%" +"%PGO%\python.exe" "%dir%rmpyc.py" %clrpath% +del "%PGO%\*.pgc" +"%PGO%\python.exe" %job% rem build optimized version -msbuild "%dir%pcbuild.sln" /t:Build /p:Configuration=PGUpdate /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9 +msbuild "%dir%pcbuild.proj" %parallel% /t:Build /p:Configuration=PGUpdate /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/PCbuild/clean.bat b/PCbuild/clean.bat new file mode 100644 --- /dev/null +++ b/PCbuild/clean.bat @@ -0,0 +1,5 @@ +@echo off +rem A batch program to clean a particular configuration, +rem just for convenience. + +call build.bat -t Clean %* diff --git a/PCbuild/env.bat b/PCbuild/env.bat --- a/PCbuild/env.bat +++ b/PCbuild/env.bat @@ -1,5 +1,9 @@ @echo off -echo Build environments: x86, ia64, amd64, x86_amd64, x86_ia64 +echo Build environments: x86, amd64, x86_amd64 echo. -call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" %1 +set VSTOOLS=%VS140COMNTOOLS% +if "%VSTOOLS%"=="" set VSTOOLS=%VS120COMNTOOLS% +if "%VSTOOLS%"=="" set VSTOOLS=%VS110COMNTOOLS% +if "%VSTOOLS%"=="" set VSTOOLS=%VS100COMNTOOLS% +call "%VSTOOLS%..\..\VC\vcvarsall.bat" %* diff --git a/PCbuild/idle.bat b/PCbuild/idle.bat --- a/PCbuild/idle.bat +++ b/PCbuild/idle.bat @@ -4,10 +4,10 @@ rem -d Run Debug build (python_d.exe). Else release build. setlocal -set exe=python -PATH %PATH%;..\..\tcltk\bin +set exe=win32\python +PATH %PATH%;..\externals\tcltk\bin -if "%1"=="-d" (set exe=python_d) & shift +if "%1"=="-d" (set exe=%exe%_d) & shift set cmd=%exe% ../Lib/idlelib/idle.py %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj new file mode 100644 --- /dev/null +++ b/PCbuild/pcbuild.proj @@ -0,0 +1,76 @@ + + + + {CC9B93A2-439D-4058-9D29-6DCF43774405} + Win32 + Release + true + true + true + + + + + $(Platform) + $(Configuration) + + Build + Clean + CleanAll + true + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PCbuild/python.props b/PCbuild/python.props new file mode 100644 --- /dev/null +++ b/PCbuild/python.props @@ -0,0 +1,105 @@ + + + + Win32 + Release + + v140 + v120 + v110 + v100 + + + amd64 + win32 + $(ArchName)-pgo + + + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)\..\)) + $(PySourcePath)\ + + + $(PySourcePath)PCBuild\$(ArchName)\ + $(BuildPath)\ + + + $([System.IO.Path]::GetFullPath(`$(PySourcePath)externals\`)) + $(ExternalsDir)sqlite-3.8.3.1\ + $(ExternalsDir)bzip2-1.0.6\ + $(ExternalsDir)xz-5.0.5\ + $(ExternalsDir)openssl-1.0.1j\ + $(externalsDir)\nasm-2.11.06\ + + + _d + + + $(BuildPath)python$(PyDebugExt).exe + + + <_PatchLevelContent>$([System.IO.File]::ReadAllText(`$(PySourcePath)Include\patchlevel.h`)) + $([System.Text.RegularExpressions.Regex]::Match($(_PatchLevelContent), `define\s+PY_MAJOR_VERSION\s+(\d+)`).Groups[1].Value) + $([System.Text.RegularExpressions.Regex]::Match($(_PatchLevelContent), `define\s+PY_MINOR_VERSION\s+(\d+)`).Groups[1].Value) + $([System.Text.RegularExpressions.Regex]::Match($(_PatchLevelContent), `define\s+PY_MICRO_VERSION\s+(\d+)`).Groups[1].Value) + <_ReleaseLevel>$([System.Text.RegularExpressions.Regex]::Match($(_PatchLevelContent), `define\s+PY_RELEASE_LEVEL\s+PY_RELEASE_LEVEL_(\w+)`).Groups[1].Value) + $([System.Text.RegularExpressions.Regex]::Match($(_PatchLevelContent), `define\s+PY_RELEASE_SERIAL\s+(\d+)`).Groups[1].Value) + 10 + 11 + 12 + 15 + a$(ReleaseSerial) + b$(ReleaseSerial) + rc$(ReleaseSerial) + + $(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber) + $(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)$(ReleaseLevelName) + $([msbuild]::BitwiseOr( + $([msbuild]::Multiply($(MajorVersionNumber), 16777216)), + $([msbuild]::BitwiseOr( + $([msbuild]::Multiply($(MinorVersionNumber), 65536)), + $([msbuild]::BitwiseOr( + $([msbuild]::Multiply($(MicroVersionNumber), 256)), + $(ReleaseSerial) + )) + )) + )) + $([msbuild]::Add( + $(ReleaseSerial), + $([msbuild]::Add( + $([msbuild]::Multiply($(ReleaseLevelNumber), 10)), + $([msbuild]::Multiply($(MicroVersionNumber), 1000)) + )) + )) + + + python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt) + + + + + + + + + + diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -1,7 +1,7 @@ Quick Start Guide ----------------- -1. Install Microsoft Visual C++ 2010 SP1, any edition. +1. Install Microsoft Visual Studio 2015, any edition. 2. Install Subversion, and make sure 'svn.exe' is on your PATH. 3. Run "build.bat -e" to build Python in 32-bit Release configuration. 4. (Optional, but recommended) Run the test suite with "rt.bat -q". @@ -11,41 +11,38 @@ ------------------------------------------ This directory is used to build CPython for Microsoft Windows NT version -5.1 or higher (Windows XP, Windows Server 2003, or later) on 32 and 64 +6.0 or higher (Windows Vista, Windows Server 2008, or later) on 32 and 64 bit platforms. Using this directory requires an installation of -Microsoft Visual C++ 2010 (MSVC 10.0) of any edition. The specific +Microsoft Visual C++ 2015 (MSVC 14.0) of any edition. The specific requirements are as follows: -Visual C++ 2010 Express Edition - Required for building 32-bit Debug and Release configuration builds. +Visual Studio Express 2015 for Desktop +Visual Studio Professional 2015 + Either edition is sufficient for building all configurations except + for Profile Guided Optimization. The Python build solution pcbuild.sln makes use of Solution Folders, which this edition does not support. Any time pcbuild.sln is opened - or reloaded by Visual C++, a warning about Solution Folders will be - displayed which can be safely dismissed with no impact on your + or reloaded by Visual CStudio, a warning about Solution Folders will + be displayed, which can be safely dismissed with no impact on your ability to build Python. -Visual Studio 2010 Professional Edition Required for building 64-bit Debug and Release configuration builds -Visual Studio 2010 Premium Edition +Visual Studio Premium 2015 Required for building Release configuration builds that make use of Profile Guided Optimization (PGO), on either platform. -Installing Service Pack 1 for Visual Studio 2010 is highly recommended -to avoid LNK1123 errors. - All you need to do to build is open the solution "pcbuild.sln" in Visual Studio, select the desired combination of configuration and platform, -then build with "Build Solution" or the F7 keyboard shortcut. You can -also build from the command line using the "build.bat" script in this -directory; see below for details. The solution is configured to build -the projects in the correct order. +then build with "Build Solution". You can also build from the command +line using the "build.bat" script in this directory; see below for +details. The solution is configured to build the projects in the correct +order. The solution currently supports two platforms. The Win32 platform is -used to build standard x86-compatible 32-bit binaries, output into this -directory. The x64 platform is used for building 64-bit AMD64 (aka -x86_64 or EM64T) binaries, output into the amd64 sub-directory which -will be created if it doesn't already exist. The Itanium (IA-64) -platform is no longer supported. See the "Building for AMD64" section -below for more information about 64-bit builds. +used to build standard x86-compatible 32-bit binaries, output into the +win32 sub-directory. The x64 platform is used for building 64-bit AMD64 +(aka x86_64 or EM64T) binaries, output into the amd64 sub-directory. +The Itanium (IA-64) platform is no longer supported. See the "Building +for AMD64" section below for more information about 64-bit builds. Four configuration options are supported by the solution: Debug @@ -61,8 +58,8 @@ requires Premium Edition of Visual Studio. See the "Profile Guided Optimization" section below for more information. Build output from each of these configurations lands in its own - sub-directory of this directory. The official Python releases are - built using these configurations. + sub-directory of this directory. The official Python releases may + be built using these configurations. Release Used to build Python as it is meant to be used in production settings, though without PGO. @@ -72,10 +69,10 @@ ---------------------------------------------- In this directory you can find build.bat, a script designed to make -building Python on Windows simpler. The only absolute requirement for -using this script is for the VS100COMNTOOLS environment variable to be -properly set, which should be done by Microsoft Visual C++ 2010 -installation. +building Python on Windows simpler. This script will use the env.bat +script to detect one of Visual Studio 2015, 2013, 2012, or 2010, any of +which may be used to build Python, though only Visual Studio 2015 is +officially supported. By default, build.bat will build Python in Release configuration for the 32-bit Win32 platform. It accepts several arguments to change @@ -86,15 +83,16 @@ -p Set the platform to build for ("Win32" or "x64") -r Rebuild instead of just building -e Use get_externals.bat to fetch external sources + -M Don't build in parallel Up to 9 MSBuild switches can also be passed, though they must be passed after specifying any of the above switches. For example, use: - build.bat -e -d /m + build.bat -e -d /fl -to do a concurrent debug build with externals fetched as needed. If -the MSBuild switch requires an equal sign ("="), the entire switch must -be quoted: +to do a debug build with externals fetched as needed and write detailed +build logs to a file. If the MSBuild switch requires an equal sign +("="), the entire switch must be quoted: build.bat -e -d "/p:externalsDir=P:\cpython-externals" @@ -108,14 +106,18 @@ Visual C++ in the PC directory. The legacy build directories are no longer actively maintained and may not work out of the box. -Currently, the only legacy build directory is PC\VS9.0, for Visual -Studio 2008 (9.0). +The PC\VS9.0 directory is for Visual Studio 2008 (9.0). + +The PC\VS10.0 directory is for Visual Studio 2010 (10.0). This is a copy +of the PCBuild directory prior to adding support for later versions of +Visual Studio, and since Visual Studio 2010 can still be used with the +updated projects, this copy is unlikely to be needed. C Runtime --------- -Visual Studio 2010 uses version 10 of the C runtime (MSVCRT10). The +Visual Studio 2015 uses version 14 of the C runtime (MSVCRT14). The executables no longer use the "Side by Side" assemblies used in previous versions of the compiler. This simplifies distribution of applications. @@ -140,13 +142,12 @@ .dll and .lib python .exe -kill_python - kill_python.exe, a small program designed to kill any instances of - python(_d).exe that are running and live in the build output - directory; this is meant to avoid build issues due to locked files make_buildinfo, make_versioninfo helpers to provide necessary information to the build process +(The old kill_python project is no longer required as pythoncore now +includes the equivalent functionality.) + These sub-projects provide extra executables that are useful for running CPython in different ways: pythonw @@ -163,8 +164,7 @@ purposes, used by test_capi.py These are miscellaneous sub-projects that don't really fit the other -categories. By default, these projects do not build in Debug -configuration: +categories: _freeze_importlib _freeze_importlib.exe, used to regenerate Python\importlib.h after changes have been made to Lib\importlib\_bootstrap.py @@ -225,10 +225,10 @@ need a later version of NASM. If OpenSSL's self tests don't pass, you should first try to update NASM and do a full rebuild of OpenSSL. get_externals.py also downloads a snapshot of NASM, and the - ssl sub-project includes that version of nasm.exe on PATH. + libeay and ssleay sub-projects use that version of nasm.exe. - The ssl sub-project expects your OpenSSL sources to have already - been configured and be ready to build. If you get your sources + The libeay/ssleay sub-projects expect your OpenSSL sources to have + already been configured and be ready to build. If you get your sources from svn.python.org as suggested in the "Getting External Sources" section below, the OpenSSL source will already be ready to go. If you want to build a different version, you will need to run @@ -241,8 +241,11 @@ OpenSSL. ActivePerl is recommended and is available from http://www.activestate.com/activeperl/ - The ssl sub-project does not have the ability to clean the OpenSSL - build; if you need to rebuild, you'll have to clean it by hand. + The libeay and ssleay sub-projects will build the modules of OpenSSL + required by _ssl and _hashlib and may need to be manually updated when + upgrading to a newer version of OpenSSL or when adding new + functionality to _ssl or _hashlib. They will not clean up their output + with the normal Clean target; CleanAll should be used instead. _sqlite3 Wraps SQLite 3.8.3.1, which is itself built by sqlite3.vcxproj Homepage: @@ -262,9 +265,9 @@ into the current output directory, which should ensure that Tkinter is able to load Tcl/Tk without having to change your PATH. - The tcl, tk, and tix sub-projects do not have the ability to clean - their builds; if you need to rebuild, you'll have to clean them by - hand. + The tcl, tk, and tix sub-projects do not clean their builds with + the normal Clean target; if you need to rebuild, you should use the + CleanAll target or manually delete their builds. Getting External Sources @@ -293,9 +296,7 @@ The build process for AMD64 / x64 is very similar to standard builds, you just have to set x64 as platform. In addition, the HOST_PYTHON environment variable must point to a Python interpreter (at least 2.4), -to support cross-compilation from Win32. Note that Visual Studio -requires Professional Edition or better in order to build 64-bit -binaries. +to support cross-compilation from Win32. Profile Guided Optimization @@ -330,31 +331,22 @@ Visual Studio properties ------------------------ -The PCbuild solution makes heavy use of Visual Studio property files -(*.props). The properties can be viewed and altered in the Property -Manager (View -> Other Windows -> Property Manager). +The PCbuild solution makes use of Visual Studio property files (*.props) +to simplify each project. The properties can be viewed in the Property +Manager (View -> Other Windows -> Property Manager) but should be +carefully modified by hand. The property files used are (+-- = "also imports"): - * debug (debug macro: _DEBUG) - * pginstrument (PGO) - * pgupdate (PGO) - +-- pginstrument - * pyd (python extension, release build) - +-- release - +-- pyproject - * pyd_d (python extension, debug build) - +-- debug - +-- pyproject - * pyproject (base settings for all projects, user macros like PyDllName) - * release (release macro: NDEBUG) - * sqlite3 (used only by sqlite3.vcxproj) + * python (versions, directories and build names) + * pyproject (base settings for all projects) + * openssl (used by libeay and ssleay projects) * tcltk (used by _tkinter, tcl, tk and tix projects) - * x64 (AMD64 / x64 platform specific settings) -The pyproject property file defines _WIN32 and x64 defines _WIN64 and -_M_X64 although the macros are set by the compiler, too. The GUI doesn't -always know about the macros and confuse the user with false -information. +The pyproject property file defines all of the build settings for each +project, with some projects overriding certain specific values. The GUI +doesn't always reflect the correct settings and may confuse the user +with false information, especially for settings that automatically adapt +for diffirent configurations. Your Own Extension DLLs diff --git a/PCbuild/rt.bat b/PCbuild/rt.bat --- a/PCbuild/rt.bat +++ b/PCbuild/rt.bat @@ -28,7 +28,7 @@ setlocal set pcbuild=%~dp0 -set prefix=%pcbuild% +set prefix=%pcbuild%win32\ set suffix= set qmode= set dashO= @@ -39,8 +39,9 @@ if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts if "%1"=="-x64" (set prefix=%pcbuild%amd64\) & shift & goto CheckOpts -set exe=%prefix%python%suffix%.exe -set cmd="%exe%" %dashO% -Wd -E -bb "%pcbuild%..\lib\test\regrtest.py" %1 %2 %3 %4 %5 %6 %7 %8 %9 +set cmd=%exe% %dashO% -Wd -E -bb ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9 +set exe=%prefix%python%suffix% +set cmd=%exe% %dashO% -Wd -E -bb ../lib/test/regrtest.py %* if defined qmode goto Qmode echo Deleting .pyc/.pyo files ... 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,2 +1,17 @@ @rem Used by the buildbot "compile" step. -call "%~dp0build.bat" -p x64 %* + +@rem Clean up +call "%~dp0clean.bat" x64 + +@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" -p x64 -e -d %* diff --git a/Tools/buildbot/buildmsi.bat b/Tools/buildbot/buildmsi.bat --- a/Tools/buildbot/buildmsi.bat +++ b/Tools/buildbot/buildmsi.bat @@ -2,6 +2,7 @@ setlocal set cwd=%CD% + @rem build release versions of things call "%~dp0build.bat" -c Release @@ -9,7 +10,7 @@ call "%~dp0..\..\Doc\make.bat" htmlhelp @rem build the MSI file -call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" x86 +call "%~dp0..\..\PCBuild\env.bat" x86 cd "%~dp0..\..\PC" nmake /f icons.mak cd ..\Tools\msi diff --git a/Tools/buildbot/clean.bat b/Tools/buildbot/clean.bat --- a/Tools/buildbot/clean.bat +++ b/Tools/buildbot/clean.bat @@ -5,29 +5,25 @@ 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" - ) -) if "%1" == "x64" ( set vcvars_target=x86_amd64 - set platform_target=x64 + set platform=x64 ) else ( set vcvars_target=x86 - set platform_target=x86 + set platform=Win32 ) -call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" %vcvars_target% + +call "%pcbuild%\env.bat" %vcvars_target% + +echo.Attempting to kill Pythons... +msbuild /v:m /nologo /target:KillPython "%pcbuild%\pythoncore.vcxproj" /p:Configuration=Release /p:Platform=%platform% + echo Deleting .pyc/.pyo files ... del /s "%root%\Lib\*.pyc" "%root%\Lib\*.pyo" + echo Deleting test leftovers ... rmdir /s /q "%root%\build" -msbuild /target:clean "%pcbuild%\pcbuild.sln" /p:Configuration=Release /p:PlatformTarget=%platform_target% -msbuild /target:clean "%pcbuild%\pcbuild.sln" /p:Configuration=Debug /p:PlatformTarget=%platform_target% +echo Deleting build +msbuild /v:m /nologo /target:clean "%pcbuild%\pcbuild.proj" /p:Configuration=Release /p:Platform=%platform% +msbuild /v:m /nologo /target:clean "%pcbuild%\pcbuild.proj" /p:Configuration=Debug /p:Platform=%platform%