MCPcopy Index your code
hub / github.com/python/cpython / buildPython

Function buildPython

Mac/BuildScript/build-installer.py:1133–1398  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1131
1132
1133def buildPython():
1134 print("Building a universal python for %s architectures" % UNIVERSALARCHS)
1135
1136 buildDir = os.path.join(WORKDIR, '_bld', 'python')
1137 rootDir = os.path.join(WORKDIR, '_root')
1138
1139 if os.path.exists(buildDir):
1140 shutil.rmtree(buildDir)
1141 if os.path.exists(rootDir):
1142 shutil.rmtree(rootDir)
1143 os.makedirs(buildDir)
1144 os.makedirs(rootDir)
1145 os.makedirs(os.path.join(rootDir, 'empty-dir'))
1146 curdir = os.getcwd()
1147 os.chdir(buildDir)
1148
1149 # Extract the version from the configure file, needed to calculate
1150 # several paths.
1151 version = getVersion()
1152
1153 # Since the extra libs are not in their installed framework location
1154 # during the build, augment the library path so that the interpreter
1155 # will find them during its extension import sanity checks.
1156
1157 print("Running configure...")
1158 print(" NOTE: --with-mimalloc=no pending resolution of weak linking issues")
1159 runCommand("%s -C --enable-framework --enable-universalsdk=/ "
1160 "--with-mimalloc=no "
1161 "--with-system-libmpdec "
1162 "--with-universal-archs=%s "
1163 "%s "
1164 "%s "
1165 "%s "
1166 "%s "
1167 "%s "
1168 "%s "
1169 "LDFLAGS='-g -L%s/libraries/usr/local/lib' "
1170 "CFLAGS='-g -I%s/libraries/usr/local/include' 2>&1"%(
1171 shellQuote(os.path.join(SRCDIR, 'configure')),
1172 UNIVERSALARCHS,
1173 (' ', '--with-computed-gotos ')[PYTHON_3],
1174 (' ', '--without-ensurepip ')[PYTHON_3],
1175 (' ', "--with-openssl='%s/libraries/usr/local'"%(
1176 shellQuote(WORKDIR)[1:-1],))[PYTHON_3],
1177 (' ', "--enable-optimizations --with-lto")[compilerCanOptimize()],
1178 (' ', "TCLTK_CFLAGS='-I%s/libraries/usr/local/include'"%(
1179 shellQuote(WORKDIR)[1:-1],))[internalTk()],
1180 (' ', "TCLTK_LIBS='-L%s/libraries/usr/local/lib -ltcl8.6 -ltk8.6'"%(
1181 shellQuote(WORKDIR)[1:-1],))[internalTk()],
1182 shellQuote(WORKDIR)[1:-1],
1183 shellQuote(WORKDIR)[1:-1]))
1184
1185 # As of macOS 10.11 with SYSTEM INTEGRITY PROTECTION, DYLD_*
1186 # environment variables are no longer automatically inherited
1187 # by child processes from their parents. We used to just set
1188 # DYLD_LIBRARY_PATH, pointing to the third-party libs,
1189 # in build-installer.py's process environment and it was
1190 # passed through the make utility into the environment of

Callers 1

mainFunction · 0.85

Calls 15

getVersionFunction · 0.85
runCommandFunction · 0.85
shellQuoteFunction · 0.85
compilerCanOptimizeFunction · 0.85
internalTkFunction · 0.85
grepValueFunction · 0.85
captureCommandFunction · 0.85
getVersionMajorMinorFunction · 0.85
chownMethod · 0.80
islinkMethod · 0.80
listdirMethod · 0.80
fatalFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…