(pythons, arch)
| 496 | |
| 497 | |
| 498 | def build_cefpython_modules(pythons, arch): |
| 499 | for python in pythons: |
| 500 | print("[build_distrib.py] Build cefpython module for {python_name}" |
| 501 | .format(python_name=python["name"])) |
| 502 | flags = "" |
| 503 | if UNITTESTS: |
| 504 | flags += " --unittests" |
| 505 | # On Linux/Mac Makefiles are used and must pass --clean flag |
| 506 | command = ("\"{python}\" {build_py} {version} --clean {flags}" |
| 507 | .format(python=python["executable"], |
| 508 | build_py=os.path.join(TOOLS_DIR, "build.py"), |
| 509 | version=VERSION, |
| 510 | flags=flags)) |
| 511 | # build.py may require sudo if system python, so shell=True |
| 512 | pcode = subprocess.call(command, shell=True) |
| 513 | if pcode != 0: |
| 514 | print("[build_distrib.py] ERROR: failed to build cefpython" |
| 515 | " module for {python_name}" |
| 516 | .format(python_name=python["name"])) |
| 517 | sys.exit(1) |
| 518 | print("[build_distrib.py] Built successfully cefpython module for" |
| 519 | " {python_name}".format(python_name=python["name"])) |
| 520 | # Issue #342 |
| 521 | backup_subprocess_executable_issue342(python) |
| 522 | |
| 523 | # Issue #342 |
| 524 | restore_subprocess_executable_issue342(arch) |
| 525 | |
| 526 | print("[build_distrib.py] Successfully built cefpython modules for {arch}" |
| 527 | .format(arch=arch)) |
| 528 | |
| 529 | |
| 530 | def backup_subprocess_executable_issue342(python): |
no test coverage detected