| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9f1b7b9 commit ced9cb5
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,19 @@ group: beta | |||
| 7 | 7 | cache: | |
| 8 | 8 | - pip | |
| 9 | 9 | - ccache | |
| 10 | + - directories: | ||
| 11 | + - $HOME/multissl | ||
| 12 | + | ||
| 13 | + env: | ||
| 14 | + global: | ||
| 15 | + - OPENSSL=1.1.0g | ||
| 16 | + - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}" | ||
| 17 | + - PATH="${OPENSSL_DIR}/bin:$PATH" | ||
| 18 | + - CFLAGS="-I${OPENSSL_DIR}/include" | ||
| 19 | + - LDFLAGS="-L${OPENSSL_DIR}/lib" | ||
| 20 | + # Set rpath with env var instead of -Wl,-rpath linker flag | ||
| 21 | + # OpenSSL ignores LDFLAGS when linking bin/openssl | ||
| 22 | + - LD_RUN_PATH="${OPENSSL_DIR}/lib" | ||
| 10 | 23 | ||
| 11 | 24 | branches: | |
| 12 | 25 | only: | |
@@ -48,6 +61,10 @@ matrix: | |||
| 48 | 61 | echo "Only docs were updated, stopping build process." | |
| 49 | 62 | exit | |
| 50 | 63 | fi | |
| 64 | + python3 Tools/ssl/multissltests.py --steps=library \ | ||
| 65 | + --base-directory ${HOME}/multissl \ | ||
| 66 | + --openssl ${OPENSSL} >/dev/null | ||
| 67 | + openssl version | ||
| 51 | 68 | ./configure | |
| 52 | 69 | make -s -j4 | |
| 53 | 70 | # Need a venv that can parse covered code. | |
@@ -71,6 +88,13 @@ before_script: | |||
| 71 | 88 | echo "Only docs were updated, stopping build process." | |
| 72 | 89 | exit | |
| 73 | 90 | fi | |
| 91 | + if [ "${TESTING}" != "docs" ]; then | ||
| 92 | + # clang complains about unused-parameter a lot, redirect stderr | ||
| 93 | + python3 Tools/ssl/multissltests.py --steps=library \ | ||
| 94 | + --base-directory ${HOME}/multissl \ | ||
| 95 | + --openssl ${OPENSSL} >/dev/null 2>&1 | ||
| 96 | + fi | ||
| 97 | + openssl version | ||
| 74 | 98 | ./configure --with-pydebug | |
| 75 | 99 | make -j4 | |
| 76 | 100 | make -j4 regen-all clinic | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1086,7 +1086,7 @@ quicktest: @DEF_MAKE_RULE@ platform | |||
| 1086 | 1086 | # SSL tests | |
| 1087 | 1087 | .PHONY: multisslcompile multissltest | |
| 1088 | 1088 | multisslcompile: build_all | |
| 1089 | - $(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py --compile-only | ||
| 1089 | + $(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py --steps=modules | ||
| 1090 | 1090 | ||
| 1091 | 1091 | multissltest: build_all | |
| 1092 | 1092 | $(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + On Travis CI, Python now Compiles and uses a local copy of OpenSSL 1.1.0g for testing. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,8 +41,8 @@ | |||
| 41 | 41 | log = logging.getLogger("multissl") | |
| 42 | 42 | ||
| 43 | 43 | OPENSSL_OLD_VERSIONS = [ | |
| 44 | - "0.9.8zh", | ||
| 45 | - "1.0.1u", | ||
| 44 | + # "0.9.8zh", | ||
| 45 | + # "1.0.1u", | ||
| 46 | 46 | ] | |
| 47 | 47 | ||
| 48 | 48 | OPENSSL_RECENT_VERSIONS = [ | |
@@ -52,8 +52,8 @@ | |||
| 52 | 52 | ] | |
| 53 | 53 | ||
| 54 | 54 | LIBRESSL_OLD_VERSIONS = [ | |
| 55 | - "2.3.10", | ||
| 56 | - "2.4.5", | ||
| 55 | + # "2.3.10", | ||
| 56 | + # "2.4.5", | ||
| 57 | 57 | ] | |
| 58 | 58 | ||
| 59 | 59 | LIBRESSL_RECENT_VERSIONS = [ | |
@@ -62,8 +62,10 @@ | |||
| 62 | 62 | ] | |
| 63 | 63 | ||
| 64 | 64 | # store files in ../multissl | |
| 65 | - HERE = os.path.abspath(os.getcwd()) | ||
| 66 | - MULTISSL_DIR = os.path.abspath(os.path.join(HERE, '..', 'multissl')) | ||
| 65 | + HERE = os.path.dirname(os.path.abspath(__file__)) | ||
| 66 | + PYTHONROOT = os.path.abspath(os.path.join(HERE, '..', '..')) | ||
| 67 | + MULTISSL_DIR = os.path.abspath(os.path.join(PYTHONROOT, '..', 'multissl')) | ||
| 68 | + | ||
| 67 | 69 | ||
| 68 | 70 | parser = argparse.ArgumentParser( | |
| 69 | 71 | prog='multissl', | |
@@ -118,9 +120,14 @@ | |||
| 118 | 120 | help="Disable network tests." | |
| 119 | 121 | ) | |
| 120 | 122 | parser.add_argument( | |
| 121 | - '--compile-only', | ||
| 122 | - action='store_true', | ||
| 123 | - help="Don't run tests, only compile _ssl.c and _hashopenssl.c." | ||
| 123 | + '--steps', | ||
| 124 | + choices=['library', 'modules', 'tests'], | ||
| 125 | + default='tests', | ||
| 126 | + help=( | ||
| 127 | + "Which steps to perform. 'library' downloads and compiles OpenSSL " | ||
| 128 | + "or LibreSSL. 'module' also compiles Python modules. 'tests' builds " | ||
| 129 | + "all and runs the test suite." | ||
| 130 | + ) | ||
| 124 | 131 | ) | |
| 125 | 132 | ||
| 126 | 133 | ||
@@ -129,21 +136,21 @@ class AbstractBuilder(object): | |||
| 129 | 136 | url_template = None | |
| 130 | 137 | src_template = None | |
| 131 | 138 | build_template = None | |
| 139 | + install_target = 'install' | ||
| 132 | 140 | ||
| 133 | 141 | module_files = ("Modules/_ssl.c", | |
| 134 | 142 | "Modules/_hashopenssl.c") | |
| 135 | 143 | module_libs = ("_ssl", "_hashlib") | |
| 136 | 144 | ||
| 137 | - def __init__(self, version, compile_args=(), | ||
| 138 | - basedir=MULTISSL_DIR): | ||
| 145 | + def __init__(self, version, args): | ||
| 139 | 146 | self.version = version | |
| 140 | - self.compile_args = compile_args | ||
| 147 | + self.args = args | ||
| 141 | 148 | # installation directory | |
| 142 | 149 | self.install_dir = os.path.join( | |
| 143 | - os.path.join(basedir, self.library.lower()), version | ||
| 150 | + os.path.join(args.base_directory, self.library.lower()), version | ||
| 144 | 151 | ) | |
| 145 | 152 | # source file | |
| 146 | - self.src_dir = os.path.join(basedir, 'src') | ||
| 153 | + self.src_dir = os.path.join(args.base_directory, 'src') | ||
| 147 | 154 | self.src_file = os.path.join( | |
| 148 | 155 | self.src_dir, self.src_template.format(version)) | |
| 149 | 156 | # build directory (removed after install) | |
@@ -252,13 +259,15 @@ def _build_src(self): | |||
| 252 | 259 | log.info("Running build in {}".format(self.build_dir)) | |
| 253 | 260 | cwd = self.build_dir | |
| 254 | 261 | cmd = ["./config", "shared", "--prefix={}".format(self.install_dir)] | |
| 255 | - cmd.extend(self.compile_args) | ||
| 256 | 262 | self._subprocess_call(cmd, cwd=cwd) | |
| 257 | 263 | # Old OpenSSL versions do not support parallel builds. | |
| 258 | 264 | self._subprocess_call(["make", "-j1"], cwd=cwd) | |
| 259 | 265 | ||
| 260 | 266 | def _make_install(self, remove=True): | |
| 261 | - self._subprocess_call(["make", "-j1", "install"], cwd=self.build_dir) | ||
| 267 | + self._subprocess_call( | ||
| 268 | + ["make", "-j1", self.install_target], | ||
| 269 | + cwd=self.build_dir | ||
| 270 | + ) | ||
| 262 | 271 | if remove: | |
| 263 | 272 | shutil.rmtree(self.build_dir) | |
| 264 | 273 | ||
@@ -330,6 +339,8 @@ class BuildOpenSSL(AbstractBuilder): | |||
| 330 | 339 | url_template = "https://www.openssl.org/source/openssl-{}.tar.gz" | |
| 331 | 340 | src_template = "openssl-{}.tar.gz" | |
| 332 | 341 | build_template = "openssl-{}" | |
| 342 | + # only install software, skip docs | ||
| 343 | + install_target = 'install_sw' | ||
| 333 | 344 | ||
| 334 | 345 | ||
| 335 | 346 | class BuildLibreSSL(AbstractBuilder): | |
@@ -368,57 +379,63 @@ def main(): | |||
| 368 | 379 | ||
| 369 | 380 | start = datetime.now() | |
| 370 | 381 | ||
| 371 | - for name in ['python', 'setup.py', 'Modules/_ssl.c']: | ||
| 372 | - if not os.path.isfile(name): | ||
| 382 | + if args.steps in {'modules', 'tests'}: | ||
| 383 | + for name in ['setup.py', 'Modules/_ssl.c']: | ||
| 384 | + if not os.path.isfile(os.path.join(PYTHONROOT, name)): | ||
| 385 | + parser.error( | ||
| 386 | + "Must be executed from CPython build dir" | ||
| 387 | + ) | ||
| 388 | + if not os.path.samefile('python', sys.executable): | ||
| 373 | 389 | parser.error( | |
| 374 | - "Must be executed from CPython build dir" | ||
| 390 | + "Must be executed with ./python from CPython build dir" | ||
| 375 | 391 | ) | |
| 376 | - if not os.path.samefile('python', sys.executable): | ||
| 377 | - parser.error( | ||
| 378 | - "Must be executed with ./python from CPython build dir" | ||
| 379 | - ) | ||
| 380 | - | ||
| 381 | - # check for configure and run make | ||
| 382 | - configure_make() | ||
| 392 | + # check for configure and run make | ||
| 393 | + configure_make() | ||
| 383 | 394 | ||
| 384 | 395 | # download and register builder | |
| 385 | 396 | builds = [] | |
| 386 | 397 | ||
| 387 | 398 | for version in args.openssl: | |
| 388 | - build = BuildOpenSSL(version) | ||
| 399 | + build = BuildOpenSSL( | ||
| 400 | + version, | ||
| 401 | + args | ||
| 402 | + ) | ||
| 389 | 403 | build.install() | |
| 390 | 404 | builds.append(build) | |
| 391 | 405 | ||
| 392 | 406 | for version in args.libressl: | |
| 393 | - build = BuildLibreSSL(version) | ||
| 407 | + build = BuildLibreSSL( | ||
| 408 | + version, | ||
| 409 | + args | ||
| 410 | + ) | ||
| 394 | 411 | build.install() | |
| 395 | 412 | builds.append(build) | |
| 396 | 413 | ||
| 397 | - for build in builds: | ||
| 398 | - try: | ||
| 399 | - build.recompile_pymods() | ||
| 400 | - build.check_pyssl() | ||
| 401 | - if not args.compile_only: | ||
| 402 | - build.run_python_tests( | ||
| 403 | - tests=args.tests, | ||
| 404 | - network=args.network, | ||
| 405 | - ) | ||
| 406 | - except Exception as e: | ||
| 407 | - log.exception("%s failed", build) | ||
| 408 | - print("{} failed: {}".format(build, e), file=sys.stderr) | ||
| 409 | - sys.exit(2) | ||
| 410 | - | ||
| 411 | - print("\n{} finished in {}".format( | ||
| 412 | - "Tests" if not args.compile_only else "Builds", | ||
| 413 | - datetime.now() - start | ||
| 414 | - )) | ||
| 414 | + if args.steps in {'modules', 'tests'}: | ||
| 415 | + for build in builds: | ||
| 416 | + try: | ||
| 417 | + build.recompile_pymods() | ||
| 418 | + build.check_pyssl() | ||
| 419 | + if args.steps == 'tests': | ||
| 420 | + build.run_python_tests( | ||
| 421 | + tests=args.tests, | ||
| 422 | + network=args.network, | ||
| 423 | + ) | ||
| 424 | + except Exception as e: | ||
| 425 | + log.exception("%s failed", build) | ||
| 426 | + print("{} failed: {}".format(build, e), file=sys.stderr) | ||
| 427 | + sys.exit(2) | ||
| 428 | + | ||
| 429 | + log.info("\n{} finished in {}".format( | ||
| 430 | + args.steps.capitalize(), | ||
| 431 | + datetime.now() - start | ||
| 432 | + )) | ||
| 415 | 433 | print('Python: ', sys.version) | |
| 416 | - if args.compile_only: | ||
| 417 | - print('Build only') | ||
| 418 | - elif args.tests: | ||
| 419 | - print('Executed Tests:', ' '.join(args.tests)) | ||
| 420 | - else: | ||
| 421 | - print('Executed all SSL tests.') | ||
| 434 | + if args.steps == 'tests': | ||
| 435 | + if args.tests: | ||
| 436 | + print('Executed Tests:', ' '.join(args.tests)) | ||
| 437 | + else: | ||
| 438 | + print('Executed all SSL tests.') | ||
| 422 | 439 | ||
| 423 | 440 | print('OpenSSL / LibreSSL versions:') | |
| 424 | 441 | for build in builds: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments