MCPcopy
hub / github.com/astral-sh/python-build-standalone / simple_build

Function simple_build

cpython-unix/build.py:229–289  ·  view source on GitHub ↗
(
    settings,
    client,
    image,
    entry,
    host_platform,
    target_triple,
    build_options,
    dest_archive,
    extra_archives=None,
    tools_path="deps",
    python_host_version=None,
)

Source from the content-addressed store, hash-verified

227
228
229def simple_build(
230 settings,
231 client,
232 image,
233 entry,
234 host_platform,
235 target_triple,
236 build_options,
237 dest_archive,
238 extra_archives=None,
239 tools_path="deps",
240 python_host_version=None,
241):
242 archive = download_entry(entry, DOWNLOADS_PATH)
243
244 with build_environment(client, image) as build_env:
245 if settings.get("needs_toolchain"):
246 build_env.install_toolchain(
247 BUILD,
248 host_platform,
249 target_triple,
250 binutils=install_binutils(host_platform),
251 clang=True,
252 musl="musl" in target_triple,
253 static="static" in build_options,
254 )
255
256 for a in extra_archives or []:
257 build_env.install_artifact_archive(BUILD, a, target_triple, build_options)
258
259 if python_host_version:
260 majmin = ".".join(python_host_version.split(".")[0:2])
261 build_env.install_toolchain_archive(
262 BUILD,
263 f"cpython-{majmin}",
264 host_platform,
265 version=python_host_version,
266 )
267
268 build_env.copy_file(archive)
269 build_env.copy_file(SUPPORT / ("build-%s.sh" % entry))
270
271 env = {
272 "%s_VERSION" % entry.upper().replace("-", "_").replace(".", "_"): DOWNLOADS[
273 entry
274 ]["version"],
275 }
276
277 if "static" in build_options:
278 env["STATIC"] = 1
279
280 add_target_env(env, host_platform, target_triple, build_env, build_options)
281
282 # for OpenSSL, set the OPENSSL_TARGET environment variable
283 if entry.startswith("openssl-"):
284 settings = get_targets(TARGETS_CONFIG)[target_triple]
285 env["OPENSSL_TARGET"] = settings["openssl_target"]
286

Callers 1

mainFunction · 0.85

Calls 11

download_entryFunction · 0.90
build_environmentFunction · 0.90
get_targetsFunction · 0.90
install_binutilsFunction · 0.85
add_target_envFunction · 0.85
install_toolchainMethod · 0.45
copy_fileMethod · 0.45
runMethod · 0.45
get_tools_archiveMethod · 0.45

Tested by

no test coverage detected