()
| 515 | |
| 516 | |
| 517 | def main(): |
| 518 | args = parser.parse_args() |
| 519 | if not args.openssl and not args.libressl and not args.awslc: |
| 520 | args.openssl = list(OPENSSL_RECENT_VERSIONS) |
| 521 | args.libressl = list(LIBRESSL_RECENT_VERSIONS) |
| 522 | args.awslc = list(AWSLC_RECENT_VERSIONS) |
| 523 | if not args.disable_ancient: |
| 524 | args.openssl.extend(OPENSSL_OLD_VERSIONS) |
| 525 | args.libressl.extend(LIBRESSL_OLD_VERSIONS) |
| 526 | |
| 527 | logging.basicConfig( |
| 528 | level=logging.DEBUG if args.debug else logging.INFO, |
| 529 | format="*** %(levelname)s %(message)s" |
| 530 | ) |
| 531 | |
| 532 | start = datetime.now() |
| 533 | |
| 534 | if args.steps in {'modules', 'tests'}: |
| 535 | for name in ['Makefile.pre.in', 'Modules/_ssl.c']: |
| 536 | if not os.path.isfile(os.path.join(PYTHONROOT, name)): |
| 537 | parser.error( |
| 538 | "Must be executed from CPython build dir" |
| 539 | ) |
| 540 | if not os.path.samefile('python', sys.executable): |
| 541 | parser.error( |
| 542 | "Must be executed with ./python from CPython build dir" |
| 543 | ) |
| 544 | # check for configure and run make |
| 545 | configure_make() |
| 546 | |
| 547 | # download and register builder |
| 548 | builds = [] |
| 549 | for build_class, versions in [ |
| 550 | (BuildOpenSSL, args.openssl), |
| 551 | (BuildLibreSSL, args.libressl), |
| 552 | (BuildAWSLC, args.awslc), |
| 553 | ]: |
| 554 | for version in versions: |
| 555 | build = build_class(version, args) |
| 556 | build.install() |
| 557 | builds.append(build) |
| 558 | |
| 559 | if args.steps in {'modules', 'tests'}: |
| 560 | for build in builds: |
| 561 | try: |
| 562 | build.recompile_pymods() |
| 563 | build.check_pyssl() |
| 564 | if args.steps == 'tests': |
| 565 | build.run_python_tests( |
| 566 | tests=args.tests, |
| 567 | network=args.network, |
| 568 | ) |
| 569 | except Exception as e: |
| 570 | log.exception("%s failed", build) |
| 571 | print("{} failed: {}".format(build, e), file=sys.stderr) |
| 572 | sys.exit(2) |
| 573 | |
| 574 | log.info("\n{} finished in {}".format( |
no test coverage detected
searching dependent graphs…