8000 Update macOS build-installer script comments for 3.10 and remove unus… · python/cpython@42205ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 42205ee

Browse files
authored
Update macOS build-installer script comments for 3.10 and remove unused pre-10.5 vestiges. (GH-27253)
1 parent fbc349f commit 42205ee

File tree

2 files changed

+74
-59
lines changed

2 files changed

+74
-59
lines changed

Mac/BuildScript/README.rst

Lines changed: 69 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,87 @@ Starting with macOS 10.15 Catalina, Gatekeeper now also requires
1919
that installer packages are submitted to and pass Apple's automated
2020
notarization service using the altool command. To pass notarization,
2121
the binaries included in the package must be built with at least
22-
the macOS 10.9 SDK, mout now be signed with the codesign utility
22+
the macOS 10.9 SDK, must now be signed with the codesign utility,
2323
and executables must opt in to the hardened run time option with
2424
any necessary entitlements. Details of these processes are
2525
available in the on-line Apple Developer Documentation and man pages.
2626

27-
As of 3.8.0 and 3.7.7, PSF practice is to build one installer variants
28-
for each release. Note that as of this writing, no Pythons support
29-
building on a newer version of macOS that will run on older versions
27+
A goal of PSF-provided (python.org) Python binaries for macOS is to
28+
support a wide-range of operating system releases with one set of
29+
binaries. Currently, the oldest release supported by python.org
30+
binaries is macOS 10.9; it is still possible to build Python and
31+
Python installers on older versions of macOS but we not regularly
32+
test on those systems nor provide binaries for them.
33+
34+
Prior to Python 3.9.1, no Python releases supported building on a
35+
newer version of macOS that will run on older versions
3036
by setting MACOSX_DEPLOYMENT_TARGET. This is because the various
31-
Python C modules do not yet support runtime testing of macOS
37+
Python C modules did not yet support runtime testing of macOS
3238
feature availability (for example, by using macOS AvailabilityMacros.h
33-
and weak-linking). To build a Python that is to be used on a
34-
range of macOS releases, always build on the oldest release to be
35-
supported; the necessary shared libraries for that release will
36-
normally also be available on later systems, with the occasional
37-
exception such as the removal of 32-bit libraries in macOS 10.15.
38-
39-
build-installer requires Apple Developer tools, either from the
39+
and weak-linking). To build a Python that is to be used on a
40+
range of macOS releases, it was necessary to always build on the
41+
oldest release to be supported; the necessary shared libraries for
42+
that release will normally also be available on later systems,
43+
with the occasional exception such as the removal of 32-bit
44+
libraries in macOS 10.15. For 3.9.x and recent earlier systems,
45+
PSF practice was to provide a "macOS 64-bit Intel installer" variant
46+
that was built on 10.9 that would run on macOS 10.9 and later.
47+
48+
Starting with 3.9.1, Python fully supports macOS "weaklinking",
49+
meaning it is now possible to build a Python on a current macOS version
50+
with a deployment target of an earlier macOS system. For 3.9.1 and
51+
later systems, we provide a "macOS 64-bit universal2 installer"
52+
variant, currently build on macOS 11 Big Sur with fat binaries
53+
natively supporting both Apple Silicon (arm64) and Intel-64
54+
(x86_64) Macs running macOS 10.9 or later.
55+
56+
The legacy "macOS 64-bit Intel installer" variant is expected to
57+
be retired prior to the end of 3.9.x support.
58+
59+
build-installer.py requires Apple Developer tools, either from the
4060
Command Line Tools package or from a full Xcode installation.
4161
You should use the most recent version of either for the operating
4262
system version in use. (One notable exception: on macOS 10.6,
4363
Snow Leopard, use Xcode 3, not Xcode 4 which was released later
44-
in the 10.6 support cycle.)
64+
in the 10.6 support cycle.) build-installer.py also must be run
65+
with recent versions of Python 3.x or 2.7. On older systems,
66+
due to changes in TLS practices, it may be easier to manually
67+
download and cache third-party source distributions used by
68+
build-installer.py rather than have it attempt to automatically
69+
download them.
70+
71+
1. universal2, arm64 and x86_64, for OS X 10.9 (and later)::
72+
73+
/path/to/bootstrap/python3 build-installer.py \
74+
--universal-archs=universal2 \
75+
--dep-target=10.9
76+
77+
- builds the following third-party libraries
78+
79+
* OpenSSL 1.1.1
80+
* Tcl/Tk 8.6
81+
* NCurses
82+
* SQLite
83+
* XZ
84+
* libffi
85+
86+
- uses system-supplied versions of third-party libraries
87+
88+
* readline module links with Apple BSD editline (libedit)
89+
* zlib
90+
* bz2
91+
92+
- recommended build environment:
93+
94+
* Mac OS X 11 or later
95+
* Xcode Command Line Tools 12.5 or later
96+
* current default macOS SDK
97+
* ``MACOSX_DEPLOYMENT_TARGET=10.9``
98+
* Apple ``clang``
4599

46-
1. 64-bit, x86_64, for OS X 10.9 (and later)::
100+
2. legacy Intel 64-bit, x86_64, for OS X 10.9 (and later)::
47101

48-
/path/to/bootstrap/python2.7 build-installer.py \
102+
/path/to/bootstrap/python3 build-installer.py \
49103
--universal-archs=intel-64 \
50104
--dep-target=10.9
51105

Mac/BuildScript/build-installer.py

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"""
33
This script is used to build "official" universal installers on macOS.
44
5+
NEW for 3.10 and backports:
6+
- support universal2 variant with arm64 and x86_64 archs
7+
- enable clang optimizations when building on 10.15+
8+
59
NEW for 3.9.0 and backports:
610
- 2.7 end-of-life issues:
711
- Python 3 installs now update the Current version link
@@ -236,8 +240,6 @@ def tweak_tcl_build(basedir, archList):
236240
def library_recipes():
237241
result = []
238242

239-
LT_10_5 = bool(getDeptargetTuple() < (10, 5))
240-
241243
# Since Apple removed the header files for the deprecated system
242244
# OpenSSL as of the Xcode 7 release (for OS X 10.10+), we do not
243245
# have much choice but to build our own copy here, too.
@@ -367,7 +369,7 @@ def library_recipes():
367369
'-DSQLITE_ENABLE_RTREE '
368370
'-DSQLITE_OMIT_AUTOINIT '
369371
'-DSQLITE_TCL=0 '
370-
'%s' % ('','-DSQLITE_WITHOUT_ZONEMALLOC ')[LT_10_5]),
372+
),
371373
configure_pre=[
372374
'--enable-threadsafe',
373375
'--enable-shared=no',
@@ -378,47 +380,6 @@ def library_recipes():
378380
),
379381
])
380382

381-
if getDeptargetTuple() < (10, 5):
382-
result.extend([
383-
dict(
384-
name="Bzip2 1.0.6",
385-
url="http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz",
386-
checksum='00b516f4704d4a7cb50a1d97e6e8e15b',
387-
configure=None,
388-
install='make install CC=%s CXX=%s, PREFIX=%s/usr/local/ CFLAGS="-arch %s"'%(
389-
CC, CXX,
390-
shellQuote(os.path.join(WORKDIR, 'libraries')),
391-
' -arch '.join(ARCHLIST),
392-
),
393-
),
394-
dict(
395-
name="ZLib 1.2.3",
396-
url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz",
397-
checksum='debc62758716a169df9f62e6ab2bc634',
398-
configure=None,
399-
install='make install CC=%s CXX=%s, prefix=%s/usr/local/ CFLAGS="-arch %s"'%(
400-
CC, CXX,
401-
shellQuote(os.path.join(WORKDIR, 'libraries')),
402-
' -arch '.join(ARCHLIST),
403-
),
404-
),
405-
dict(
406-
# Note that GNU readline is GPL'd software
407-
name="GNU Readline 6.1.2",
408-
url="http://ftp.gnu.org/pub/gnu/readline/readline-6.1.tar.gz" ,
409-
checksum='fc2f7e714fe792db1ce6ddc4c9fb4ef3',
410-
patchlevel='0',
411-
patches=[
412-
# The readline maintainers don't do actual micro releases, but
413-
# just ship a set of patches.
414-
('http://ftp.gnu.org/pub/gnu/readline/readline-6.1-patches/readline61-001',
415-
'c642f2e84d820884b0bf9fd176bc6c3f'),
416-
('http://ftp.gnu.org/pub/gnu/readline/readline-6.1-patches/readline61-002',
417-
'1a76781a1ea734e831588285db7ec9b1'),
418-
]
419-
),
420-
])
421-
422383
if not PYTHON_3:
423384
result.extend([
424385
dict(

0 commit comments

Comments
 (0)
0