[dnm] try building manylinux builder

Change-Id: Id2a5450aec1b0b3e27fb837d5a1c901bcfb44060
This commit is contained in:
Ian Wienand 2020-08-13 17:38:59 +10:00
parent f867e7921a
commit db2c107c16
7 changed files with 92 additions and 1 deletions

View File

@ -0,0 +1,11 @@
FROM quay.io/pypa/manylinux2014_aarch64
MAINTAINER Infra Root
WORKDIR /root
RUN yum -y install prelink && yum -y clean all
ADD install_libffi.sh /root/install_libffi.sh
RUN sh install_libffi.sh manylinux2010
ADD install_openssl.sh /root/install_openssl.sh
ADD openssl-version.sh /root/openssl-version.sh
RUN sh install_openssl.sh manylinux2010
ADD install_virtualenv.sh /root/install_virtualenv.sh
RUN sh install_virtualenv.sh manylinux2010

View File

@ -0,0 +1,28 @@
#!/bin/bash
set -xe
LIBFFI_SHA256="d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37"
LIBFFI_VERSION="3.2.1"
function check_sha256sum {
local fname=$1
local sha256=$2
echo "${sha256} ${fname}" > "${fname}.sha256"
sha256sum -c "${fname}.sha256"
rm "${fname}.sha256"
}
curl -#O "https://mirrors.ocf.berkeley.edu/debian/pool/main/libf/libffi/libffi_${LIBFFI_VERSION}.orig.tar.gz"
check_sha256sum "libffi_${LIBFFI_VERSION}.orig.tar.gz" ${LIBFFI_SHA256}
tar zxf libffi*.orig.tar.gz
PATH=/opt/perl/bin:$PATH
pushd libffi*
if [ "$1" == "manylinux1" ]; then
STACK_PROTECTOR_FLAGS="-fstack-protector --param=ssp-buffer-size=4"
else
STACK_PROTECTOR_FLAGS="-fstack-protector-strong"
fi
./configure CFLAGS="-g -O2 $STACK_PROTECTOR_FLAGS -Wformat -Werror=format-security"
make install
popd
rm -rf libffi*

View File

@ -0,0 +1,27 @@
#!/bin/bash
set -xe
OPENSSL_URL="https://www.openssl.org/source/"
source /root/openssl-version.sh
function check_sha256sum {
local fname=$1
local sha256=$2
echo "${sha256} ${fname}" > "${fname}.sha256"
sha256sum -c "${fname}.sha256"
rm "${fname}.sha256"
}
curl -#O "${OPENSSL_URL}/${OPENSSL_VERSION}.tar.gz"
check_sha256sum ${OPENSSL_VERSION}.tar.gz ${OPENSSL_SHA256}
tar zxf ${OPENSSL_VERSION}.tar.gz
PATH=/opt/perl/bin:$PATH
pushd ${OPENSSL_VERSION}
./config $OPENSSL_BUILD_FLAGS --prefix=/opt/pyca/cryptography/openssl --openssldir=/opt/pyca/cryptography/openssl
make depend
make -j4
# avoid installing the docs
# https://github.com/openssl/openssl/issues/6685#issuecomment-403838728
make install_sw install_ssldirs
popd
rm -rf openssl*

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -xe
for python in /opt/python/*; do
"$python/bin/pip" install virtualenv
done

View File

@ -0,0 +1,6 @@
export OPENSSL_VERSION="openssl-1.1.1g"
export OPENSSL_SHA256="ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46"
# We need a base set of flags because on Windows using MSVC
# enable-ec_nistp_64_gcc_128 doesn't work since there's no 128-bit type
export OPENSSL_BUILD_FLAGS_WINDOWS="no-ssl3 no-ssl3-method no-zlib no-shared no-comp no-dynamic-engine"
export OPENSSL_BUILD_FLAGS="${OPENSSL_BUILD_FLAGS_WINDOWS} enable-ec_nistp_64_gcc_128"

12
zuul.d/jobs.yaml Normal file
View File

@ -0,0 +1,12 @@
- job:
name: pyca-cryptography-build-image-manylinux2014
description: Build a manylinux image
provides: pyca-crytopgraphy-manylinux2014-container-image
parent: opendev-build-docker-image
dependencies: opendev-buildset-registry
vars:
docker_images:
- context: docker/manylinux2014_aarch64
repository: opendevorg/etherpad
files:
- docker/

View File

@ -2,7 +2,8 @@
name: pyca/project-config
check:
jobs:
- noop
- opendev-buildset-registry
- pyca-cryptography-build-image-manylinux2014
gate:
jobs:
- noop