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

Function make_emscripten_libffi

Platforms/emscripten/__main__.py:350–381  ·  view source on GitHub ↗
(context, working_dir)

Source from the content-addressed store, hash-verified

348
349@subdir("host_build_dir", clean_ok=True)
350def make_emscripten_libffi(context, working_dir):
351 validate_emsdk_version(context.emsdk_cache)
352 prefix = context.build_paths["prefix_dir"]
353 libffi_config = load_config_toml()["dependencies"]["libffi"]
354 with open(EMSCRIPTEN_DIR / "make_libffi.sh", "rb") as f:
355 libffi_config["make_libffi_shasum"] = hashlib.file_digest(f, "sha256").hexdigest()
356 if not should_build_library(
357 prefix, "libffi", libffi_config, context.quiet
358 ):
359 return
360
361 if context.check_up_to_date:
362 print("libffi out of date, expected to be up to date", file=sys.stderr)
363 sys.exit(1)
364
365 url = libffi_config["url"]
366 version = libffi_config["version"]
367 shasum = libffi_config["shasum"]
368 libffi_dir = working_dir / f"libffi-{version}"
369 shutil.rmtree(libffi_dir, ignore_errors=True)
370 download_and_unpack(
371 working_dir,
372 url.format(version=version),
373 shasum,
374 )
375 call(
376 [EMSCRIPTEN_DIR / "make_libffi.sh"],
377 env=updated_env({"PREFIX": prefix}, context.emsdk_cache),
378 cwd=libffi_dir,
379 quiet=context.quiet,
380 )
381 write_library_config(prefix, "libffi", libffi_config, context.quiet)
382
383
384@subdir("host_build_dir", clean_ok=True)

Callers 1

make_dependenciesFunction · 0.85

Calls 11

validate_emsdk_versionFunction · 0.85
load_config_tomlFunction · 0.85
should_build_libraryFunction · 0.85
download_and_unpackFunction · 0.85
write_library_configFunction · 0.85
hexdigestMethod · 0.80
callFunction · 0.70
updated_envFunction · 0.70
openFunction · 0.50
exitMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…