• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

_asyncio.vcxprojD23-Nov-20234.3 KiB110109

_asyncio.vcxproj.filtersD23-Nov-2023733 2121

_bz2.vcxprojD23-Nov-20235.3 KiB128128

_bz2.vcxproj.filtersD23-Nov-20232.1 KiB5959

_ctypes.vcxprojD23-Nov-20235 KiB125124

_ctypes.vcxproj.filtersD23-Nov-20231.7 KiB4747

_ctypes_test.vcxprojD23-Nov-20234.4 KiB112112

_ctypes_test.vcxproj.filtersD23-Nov-20231,021 2929

_decimal.vcxprojD23-Nov-20237.7 KiB160159

_decimal.vcxproj.filtersD23-Nov-20235.1 KiB127127

_elementtree.vcxprojD23-Nov-20235.7 KiB136135

_elementtree.vcxproj.filtersD23-Nov-20233.2 KiB8686

_freeze_importlib.vcxprojD23-Nov-20237.3 KiB160156

_freeze_importlib.vcxproj.filtersD23-Nov-20231,001 2828

_hashlib.vcxprojD23-Nov-20234.5 KiB116115

_hashlib.vcxproj.filtersD23-Nov-2023731 2121

_lzma.vcxprojD23-Nov-20235 KiB123122

_lzma.vcxproj.filtersD23-Nov-2023730 2121

_msi.vcxprojD23-Nov-20234.5 KiB115115

_msi.vcxproj.filtersD23-Nov-2023718 2121

_multiprocessing.vcxprojD23-Nov-20234.7 KiB118118

_multiprocessing.vcxproj.filtersD23-Nov-20231.1 KiB3232

_overlapped.vcxprojD23-Nov-20234.5 KiB114114

_overlapped.vcxproj.filtersD23-Nov-2023729 2121

_queue.vcxprojD23-Nov-20234.3 KiB110109

_queue.vcxproj.filtersD23-Nov-2023731 2121

_socket.vcxprojD23-Nov-20234.6 KiB117117

_socket.vcxproj.filtersD23-Nov-20231,005 2929

_sqlite3.vcxprojD23-Nov-20235.8 KiB138138

_sqlite3.vcxproj.filtersD23-Nov-20232.7 KiB7777

_ssl.vcxprojD23-Nov-20234.9 KiB122122

_ssl.vcxproj.filtersD23-Nov-2023836 2424

_testbuffer.vcxprojD23-Nov-20234.3 KiB109109

_testbuffer.vcxproj.filtersD23-Nov-2023730 2121

_testcapi.vcxprojD23-Nov-20234.4 KiB110110

_testcapi.vcxproj.filtersD23-Nov-2023734 2121

_testconsole.vcxprojD23-Nov-20234.5 KiB115115

_testconsole.vcxproj.filtersD23-Nov-2023919 2323

_testembed.vcxprojD23-Nov-20234.4 KiB112112

_testembed.vcxproj.filtersD23-Nov-2023923 2323

_testimportmultiple.vcxprojD23-Nov-20234.4 KiB111110

_testimportmultiple.vcxproj.filtersD23-Nov-2023738 2121

_testinternalcapi.vcxprojD23-Nov-20234.4 KiB111110

_testinternalcapi.vcxproj.filtersD23-Nov-2023736 2121

_testmultiphase.vcxprojD23-Nov-20234.5 KiB115115

_testmultiphase.vcxproj.filtersD23-Nov-2023927 2323

_tkinter.vcxprojD23-Nov-20235.9 KiB136136

_tkinter.vcxproj.filtersD23-Nov-2023832 2424

_uuid.vcxprojD23-Nov-20234.5 KiB115115

_uuid.vcxproj.filtersD23-Nov-2023804 2222

_zoneinfo.vcxprojD23-Nov-20234.3 KiB110109

_zoneinfo.vcxproj.filtersD23-Nov-2023728 2121

build.batD23-Nov-20237.3 KiB179164

build_env.batD23-Nov-202326 21

clean.batD23-Nov-2023133 64

env.batD23-Nov-20231.3 KiB2824

env.ps1D23-Nov-2023105 32

field3.pyD23-Nov-2023974 3617

find_msbuild.batD23-Nov-20232.9 KiB6451

find_python.batD23-Nov-20233.3 KiB7964

fix_encoding.pyD23-Nov-2023952 3722

get_external.pyD23-Nov-20231.8 KiB6148

get_externals.batD23-Nov-20234.4 KiB11899

idle.batD23-Nov-2023713 2822

lib.pyprojD23-Nov-202390.2 KiB1,8301,829

libffi.propsD23-Nov-20231 KiB2121

liblzma.vcxprojD23-Nov-202314.4 KiB247244

liblzma.vcxproj.filtersD23-Nov-202317.7 KiB435435

openssl.propsD23-Nov-20231.5 KiB2929

openssl.vcxprojD23-Nov-20235.8 KiB139125

pcbuild.projD23-Nov-20236.3 KiB129103

pcbuild.slnD23-Nov-2023117.1 KiB1,5191,518

prepare_libffi.batD23-Nov-20237 KiB205167

prepare_ssl.batD23-Nov-20232.1 KiB5947

prepare_ssl.pyD23-Nov-20236.7 KiB204148

prepare_tcltk.batD23-Nov-20232 KiB5644

pyexpat.vcxprojD23-Nov-20234.9 KiB120119

pyexpat.vcxproj.filtersD23-Nov-20231.4 KiB4141

pylauncher.vcxprojD23-Nov-20234.5 KiB115114

pylauncher.vcxproj.filtersD23-Nov-20231 KiB2828

pyproject.propsD23-Nov-202313.5 KiB228202

pyshellext.vcxprojD23-Nov-20234.7 KiB119119

pyshellext.vcxproj.filtersD23-Nov-20231.2 KiB3636

python.propsD23-Nov-202314.8 KiB231145

python.vcxprojD23-Nov-20237.4 KiB168166

python.vcxproj.filtersD23-Nov-2023850 2726

python3dll.vcxprojD23-Nov-20238.1 KiB183181

python3dll.vcxproj.filtersD23-Nov-20231 KiB2828

python_uwp.vcxprojD23-Nov-20235.1 KiB129128

python_uwp.vcxproj.filtersD23-Nov-2023848 2626

pythoncore.vcxprojD23-Nov-202329 KiB560557

pythoncore.vcxproj.filtersD23-Nov-202343.1 KiB1,2531,253

pythonw.vcxprojD23-Nov-20234.3 KiB110110

pythonw.vcxproj.filtersD23-Nov-2023723 2121

pythonw_uwp.vcxprojD23-Nov-20235.1 KiB129128

pythonw_uwp.vcxproj.filtersD23-Nov-2023850 2626

pywlauncher.vcxprojD23-Nov-20234.5 KiB114114

pywlauncher.vcxproj.filtersD23-Nov-20231 KiB2828

readme.txtD23-Nov-202311.2 KiB290240

regen.vcxprojD23-Nov-202312.3 KiB231220

rmpyc.pyD23-Nov-2023409 2012

rt.batD23-Nov-20232.7 KiB7968

select.vcxprojD23-Nov-20234.4 KiB113113

select.vcxproj.filtersD23-Nov-2023731 2121

sqlite3.vcxprojD23-Nov-20235.4 KiB122121

sqlite3.vcxproj.filtersD23-Nov-20231.1 KiB3232

tcl.vcxprojD23-Nov-20233 KiB7366

tcltk.propsD23-Nov-20233.8 KiB6151

tix.vcxprojD23-Nov-20233.9 KiB9788

tk.vcxprojD23-Nov-20233.3 KiB7973

unicodedata.vcxprojD23-Nov-20234.5 KiB113113

unicodedata.vcxproj.filtersD23-Nov-20231.1 KiB3232

urlretrieve.pyD23-Nov-20231.2 KiB4033

venvlauncher.vcxprojD23-Nov-20234.7 KiB118117

venvlauncher.vcxproj.filtersD23-Nov-2023847 2626

venvwlauncher.vcxprojD23-Nov-20234.7 KiB118117

venvwlauncher.vcxproj.filtersD23-Nov-2023847 2626

winsound.vcxprojD23-Nov-20234.5 KiB115115

winsound.vcxproj.filtersD23-Nov-2023796 2222

xxlimited.vcxprojD23-Nov-20234.5 KiB114114

xxlimited.vcxproj.filtersD23-Nov-2023445 1313

readme.txt

1Quick Start Guide
2-----------------
3
41.  Install Microsoft Visual Studio 2017 with Python workload and
5    Python native development component.
61a. Optionally install Python 3.6 or later.  If not installed,
7    get_externals.bat (via build.bat) will download and use Python via
8    NuGet.
92.  Run "build.bat" to build Python in 32-bit Release configuration.
103.  (Optional, but recommended) Run the test suite with "rt.bat -q".
11
12
13Building Python using Microsoft Visual C++
14------------------------------------------
15
16This directory is used to build CPython for Microsoft Windows NT version
176.0 or higher (Windows Vista, Windows Server 2008, or later) on 32 and 64
18bit platforms.  Using this directory requires an installation of
19Microsoft Visual Studio 2017 (MSVC 14.1) with the *Python workload* and
20its optional *Python native development* component selected. (For
21command-line builds, Visual Studio 2015 may also be used.)
22
23Building from the command line is recommended in order to obtain any
24external dependencies. To build, simply run the "build.bat" script without
25any arguments. After this succeeds, you can open the "pcbuild.sln"
26solution in Visual Studio to continue development.
27
28To build an installer package, refer to the README in the Tools/msi folder.
29
30The solution currently supports two platforms.  The Win32 platform is
31used to build standard x86-compatible 32-bit binaries, output into the
32win32 sub-directory.  The x64 platform is used for building 64-bit AMD64
33(aka x86_64 or EM64T) binaries, output into the amd64 sub-directory.
34The Itanium (IA-64) platform is no longer supported.
35
36Four configuration options are supported by the solution:
37Debug
38    Used to build Python with extra debugging capabilities, equivalent
39    to using ./configure --with-pydebug on UNIX.  All binaries built
40    using this configuration have "_d" added to their name:
41    python39_d.dll, python_d.exe, parser_d.pyd, and so on.  Both the
42    build and rt (run test) batch files in this directory accept a -d
43    option for debug builds.  If you are building Python to help with
44    development of CPython, you will most likely use this configuration.
45PGInstrument, PGUpdate
46    Used to build Python in Release configuration using PGO, which
47    requires Premium Edition of Visual Studio.  See the "Profile
48    Guided Optimization" section below for more information.  Build
49    output from each of these configurations lands in its own
50    sub-directory of this directory.  The official Python releases may
51    be built using these configurations.
52Release
53    Used to build Python as it is meant to be used in production
54    settings, though without PGO.
55
56
57Building Python using the build.bat script
58----------------------------------------------
59
60In this directory you can find build.bat, a script designed to make
61building Python on Windows simpler.  This script will use the env.bat
62script to detect either Visual Studio 2017 or 2015, either of
63which may be used to build Python. Currently Visual Studio 2017 is
64officially supported.
65
66By default, build.bat will build Python in Release configuration for
67the 32-bit Win32 platform.  It accepts several arguments to change
68this behavior, try `build.bat -h` to learn more.
69
70
71C Runtime
72---------
73
74Visual Studio 2017 uses version 14.0 of the C runtime (vcruntime140).
75The executables no longer use the "Side by Side" assemblies used in
76previous versions of the compiler.  This simplifies distribution of
77applications.
78
79The run time libraries are available under the redist folder of your
80Visual Studio distribution. For more info, see the Readme in the
81redist folder.
82
83
84Sub-Projects
85------------
86
87The CPython project is split up into several smaller sub-projects which
88are managed by the pcbuild.sln solution file.  Each sub-project is
89represented by a .vcxproj and a .vcxproj.filters file starting with the
90name of the sub-project.  These sub-projects fall into a few general
91categories:
92
93The following sub-projects represent the bare minimum required to build
94a functioning CPython interpreter.  If nothing else builds but these,
95you'll have a very limited but usable python.exe:
96pythoncore
97    .dll and .lib
98python
99    .exe
100
101These sub-projects provide extra executables that are useful for running
102CPython in different ways:
103pythonw
104    pythonw.exe, a variant of python.exe that doesn't open a Command
105    Prompt window
106pylauncher
107    py.exe, the Python Launcher for Windows, see
108        http://docs.python.org/3/using/windows.html#launcher
109pywlauncher
110    pyw.exe, a variant of py.exe that doesn't open a Command Prompt
111    window
112_testembed
113    _testembed.exe, a small program that embeds Python for testing
114    purposes, used by test_capi.py
115
116These are miscellaneous sub-projects that don't really fit the other
117categories:
118_freeze_importlib
119    _freeze_importlib.exe, used to regenerate Python\importlib.h after
120    changes have been made to Lib\importlib\_bootstrap.py
121pyshellext
122    pyshellext.dll, the shell extension deployed with the launcher
123python3dll
124    python3.dll, the PEP 384 Stable ABI dll
125xxlimited
126    builds an example module that makes use of the PEP 384 Stable ABI,
127    see Modules\xxlimited.c
128
129The following sub-projects are for individual modules of the standard
130library which are implemented in C; each one builds a DLL (renamed to
131.pyd) of the same name as the project:
132_asyncio
133_ctypes
134_ctypes_test
135_zoneinfo
136_decimal
137_elementtree
138_hashlib
139_msi
140_multiprocessing
141_overlapped
142_socket
143_testbuffer
144_testcapi
145_testconsole
146_testimportmultiple
147_testmultiphase
148_tkinter
149pyexpat
150select
151unicodedata
152winsound
153
154The following Python-controlled sub-projects wrap external projects.
155Note that these external libraries are not necessary for a working
156interpreter, but they do implement several major features.  See the
157"Getting External Sources" section below for additional information
158about getting the source for building these libraries.  The sub-projects
159are:
160_bz2
161    Python wrapper for version 1.0.6 of the libbzip2 compression library
162    Homepage:
163        http://www.bzip.org/
164_lzma
165    Python wrapper for version 5.2.2 of the liblzma compression library
166    Homepage:
167        http://tukaani.org/xz/
168_ssl
169    Python wrapper for version 1.1.1c of the OpenSSL secure sockets
170    library, which is downloaded from our binaries repository at
171    https://github.com/python/cpython-bin-deps.
172
173    Homepage:
174        http://www.openssl.org/
175
176    Building OpenSSL requires Perl on your path, and can be performed by
177    running PCbuild\prepare_ssl.bat. This will retrieve the version of
178    the sources matched to the current commit from the OpenSSL branch
179    in our source repository at
180    https://github.com/python/cpython-source-deps.
181
182    To use an alternative build of OpenSSL completely, you should replace
183    the files in the externals/openssl-bin-<version> folder with your own.
184    As long as this folder exists, its contents will not be downloaded
185    again when building.
186
187_sqlite3
188    Wraps SQLite 3.33.0, which is itself built by sqlite3.vcxproj
189    Homepage:
190        http://www.sqlite.org/
191_tkinter
192    Wraps version 8.6.6 of the Tk windowing system, which is downloaded
193    from our binaries repository at
194    https://github.com/python/cpython-bin-deps.
195
196    Homepage:
197        http://www.tcl.tk/
198
199    Building Tcl and Tk can be performed by running
200    PCbuild\prepare_tcltk.bat. This will retrieve the version of the
201    sources matched to the current commit from the Tcl and Tk branches
202    in our source repository at
203    https://github.com/python/cpython-source-deps.
204
205    The two projects install their respective components in a
206    directory alongside the source directories called "tcltk" on
207    Win32 and "tcltk64" on x64.  They also copy the Tcl and Tk DLLs
208    into the current output directory, which should ensure that Tkinter
209    is able to load Tcl/Tk without having to change your PATH.
210
211
212Getting External Sources
213------------------------
214
215The last category of sub-projects listed above wrap external projects
216Python doesn't control, and as such a little more work is required in
217order to download the relevant source files for each project before they
218can be built.  However, a simple script is provided to make this as
219painless as possible, called "get_externals.bat" and located in this
220directory.  This script extracts all the external sub-projects from
221    https://github.com/python/cpython-source-deps
222and
223    https://github.com/python/cpython-bin-deps
224via a Python script called "get_external.py", located in this directory.
225If Python 3.6 or later is not available via the "py.exe" launcher, the
226path or command to use for Python can be provided in the PYTHON_FOR_BUILD
227environment variable, or get_externals.bat will download the latest
228version of NuGet and use it to download the latest "pythonx86" package
229for use with get_external.py.  Everything downloaded by these scripts is
230stored in ..\externals (relative to this directory).
231
232It is also possible to download sources from each project's homepage,
233though you may have to change folder names or pass the names to MSBuild
234as the values of certain properties in order for the build solution to
235find them.  This is an advanced topic and not necessarily fully
236supported.
237
238The get_externals.bat script is called automatically by build.bat
239unless you pass the '-E' option.
240
241
242Profile Guided Optimization
243---------------------------
244
245The solution has two configurations for PGO. The PGInstrument
246configuration must be built first. The PGInstrument binaries are linked
247against a profiling library and contain extra debug information. The
248PGUpdate configuration takes the profiling data and generates optimized
249binaries.
250
251The build_pgo.bat script automates the creation of optimized binaries.
252It creates the PGI files, runs the unit test suite or PyBench with the
253PGI python, and finally creates the optimized files.
254
255See
256    http://msdn.microsoft.com/en-us/library/e7k32f4k(VS.140).aspx
257for more on this topic.
258
259
260Static library
261--------------
262
263The solution has no configuration for static libraries. However it is
264easy to build a static library instead of a DLL. You simply have to set
265the "Configuration Type" to "Static Library (.lib)" and alter the
266preprocessor macro "Py_ENABLE_SHARED" to "Py_NO_ENABLE_SHARED". You may
267also have to change the "Runtime Library" from "Multi-threaded DLL
268(/MD)" to "Multi-threaded (/MT)".
269
270
271Visual Studio properties
272------------------------
273
274The PCbuild solution makes use of Visual Studio property files (*.props)
275to simplify each project. The properties can be viewed in the Property
276Manager (View -> Other Windows -> Property Manager) but should be
277carefully modified by hand.
278
279The property files used are:
280 * python (versions, directories and build names)
281 * pyproject (base settings for all projects)
282 * openssl (used by projects dependent upon OpenSSL)
283 * tcltk (used by _tkinter, tcl, tk and tix projects)
284
285The pyproject property file defines all of the build settings for each
286project, with some projects overriding certain specific values. The GUI
287doesn't always reflect the correct settings and may confuse the user
288with false information, especially for settings that automatically adapt
289for different configurations.
290