From a7e09d8b4f7c25fec4e270d9549dff521648ca3c Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 6 May 2019 20:48:51 -0400 Subject: Add manylinux1 wheel builder to azure (#4873) * Add manylinux1 wheel builder to azure * ? * Drop 32-bit manylinux1 * cleanup * fix * Run as root * fix? * Do it in a venv * typo * Added an extra step * For debugging * Fix * computers are stupid * gibberish * fix? --- .azure-pipelines/wheel-builder.yml | 57 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) (limited to '.azure-pipelines') diff --git a/.azure-pipelines/wheel-builder.yml b/.azure-pipelines/wheel-builder.yml index 7770757d..1507b4b4 100644 --- a/.azure-pipelines/wheel-builder.yml +++ b/.azure-pipelines/wheel-builder.yml @@ -2,7 +2,7 @@ trigger: none pr: none jobs: - - job: 'mac' + - job: 'macOS' pool: vmImage: 'macOS-10.14' strategy: @@ -65,4 +65,57 @@ jobs: displayName: Verify that we did not link against OpenSSL - upload: wheelhouse/ - artifact: cryptography-python$(python.version) + artifact: cryptography-macos-python$(python.version) + + - job: 'manylinux1' + pool: + vmImage: 'ubuntu-16.04' + container: 'pyca/cryptography-manylinux1:x86_64' + strategy: + matrix: + Python27m: + PYTHON_VERSION: 'cp27-cp27m' + Python27mu: + PYTHON_VERSION: 'cp27-cp27mu' + Python3m: + PYTHON_VERSION: 'cp34-cp34m' + steps: + - script: /opt/python/$PYTHON_VERSION/bin/python -m virtualenv .venv + displayName: Create virtualenv + - script: .venv/bin/pip install cffi six idna asn1crypto ipaddress enum34 + displayName: Install our Python dependencies + - script: | + set -e + set -x + + REGEX="cp3([0-9])*" + if [[ "$PYTHON_VERSION" =~ $REGEX ]]; then + PY_LIMITED_API="--build-option --py-limited-api=cp3${BASH_REMATCH[1]}" + fi + LDFLAGS="-L/opt/pyca/cryptography/openssl/lib" \ + CFLAGS="-I/opt/pyca/cryptography/openssl/include -Wl,--exclude-libs,ALL" \ + .venv/bin/pip wheel cryptography==$BUILD_VERSION --no-use-pep517 --no-binary cryptography --no-deps --wheel-dir=tmpwheelhouse $PY_LIMITED_API + displayName: Build the wheel + - script: auditwheel repair tmpwheelhouse/cryptograph*.whl -w wheelhouse/ + displayName: Run auditwheel + - script: unzip wheelhouse/*.whl -d execstack.check + displayName: Unzip the wheel + - script: | + set -e + set -x + + results=$(execstack execstack.check/cryptography/hazmat/bindings/*.so) + count=$(echo "$results" | grep -c '^X' || true) + if [ "$count" -ne 0 ]; then + exit 1 + else + exit 0 + fi + displayName: Run execstack on the wheel + - script: .venv/bin/pip install cryptography==$BUILD_VERSION --no-index -f wheelhouse/ + displayName: Test installing the wheel + - script: | + .venv/bin/python -c "from cryptography.hazmat.backends.openssl.backend import backend;print('Loaded: ' + backend.openssl_version_text());print('Linked Against: ' + backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii'))" + displayName: Print the OpenSSL we built and linked against + - upload: wheelhouse/ + artifact: cryptography-manylinux1-$(PYTHON_VERSION) -- cgit v1.2.3