# HG changeset patch # User Gregory Szorc # Date 1526147264 25200 # Node ID 142998a45056393f6015cb6f32b1f8c2d0cfbb95 # Parent e51c91c14a07a89f23b79cc1cbd85384c0f453de packaging: move build-linux-wheels.sh to contrib/packaging/ Differential Revision: https://phab.mercurial-scm.org/D3548 diff -r e51c91c14a07 -r 142998a45056 Makefile --- a/Makefile Sat May 12 17:16:09 2018 -0700 +++ b/Makefile Sat May 12 10:47:44 2018 -0700 @@ -300,10 +300,10 @@ linux-wheels: linux-wheels-x86_64 linux-wheels-i686 linux-wheels-x86_64: - docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/build-linux-wheels.sh + docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/packaging/build-linux-wheels.sh linux-wheels-i686: - docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/build-linux-wheels.sh + docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/packaging/build-linux-wheels.sh .PHONY: help all local build doc cleanbutpackages clean install install-bin \ install-doc install-home install-home-bin install-home-doc \ diff -r e51c91c14a07 -r 142998a45056 contrib/build-linux-wheels.sh --- a/contrib/build-linux-wheels.sh Sat May 12 17:16:09 2018 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -#!/bin/bash -# This file is directly inspired by -# https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh -set -e -x - -PYTHON_TARGETS=$(ls -d /opt/python/cp27*/bin) - -# Create an user for the tests -useradd hgbuilder - -# Bypass uid/gid problems -cp -R /src /io && chown -R hgbuilder:hgbuilder /io - -# Compile wheels for Python 2.X -for PYBIN in $PYTHON_TARGETS; do - "${PYBIN}/pip" wheel /io/ -w wheelhouse/ -done - -# Bundle external shared libraries into the wheels with -# auditwheel (https://github.com/pypa/auditwheel) repair. -# It also fix the ABI tag on the wheel making it pip installable. -for whl in wheelhouse/*.whl; do - auditwheel repair "$whl" -w /src/wheelhouse/ -done - -# Install packages and run the tests for all Python versions -cd /io/tests/ - -for PYBIN in $PYTHON_TARGETS; do - # Install mercurial wheel as root - "${PYBIN}/pip" install mercurial --no-index -f /src/wheelhouse - # But run tests as hgbuilder user (non-root) - su hgbuilder -c "\"${PYBIN}/python\" /io/tests/run-tests.py --with-hg=\"${PYBIN}/hg\" --blacklist=/io/contrib/linux-wheel-centos5-blacklist" -done diff -r e51c91c14a07 -r 142998a45056 contrib/packaging/build-linux-wheels.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/packaging/build-linux-wheels.sh Sat May 12 10:47:44 2018 -0700 @@ -0,0 +1,34 @@ +#!/bin/bash +# This file is directly inspired by +# https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh +set -e -x + +PYTHON_TARGETS=$(ls -d /opt/python/cp27*/bin) + +# Create an user for the tests +useradd hgbuilder + +# Bypass uid/gid problems +cp -R /src /io && chown -R hgbuilder:hgbuilder /io + +# Compile wheels for Python 2.X +for PYBIN in $PYTHON_TARGETS; do + "${PYBIN}/pip" wheel /io/ -w wheelhouse/ +done + +# Bundle external shared libraries into the wheels with +# auditwheel (https://github.com/pypa/auditwheel) repair. +# It also fix the ABI tag on the wheel making it pip installable. +for whl in wheelhouse/*.whl; do + auditwheel repair "$whl" -w /src/wheelhouse/ +done + +# Install packages and run the tests for all Python versions +cd /io/tests/ + +for PYBIN in $PYTHON_TARGETS; do + # Install mercurial wheel as root + "${PYBIN}/pip" install mercurial --no-index -f /src/wheelhouse + # But run tests as hgbuilder user (non-root) + su hgbuilder -c "\"${PYBIN}/python\" /io/tests/run-tests.py --with-hg=\"${PYBIN}/hg\" --blacklist=/io/contrib/linux-wheel-centos5-blacklist" +done