##// END OF EJS Templates
dispatch: do not close stdout and stderr, just flush() instead...
dispatch: do not close stdout and stderr, just flush() instead Since 3a4c0905f357 "util: always force line buffered stdout when stdout is a tty", we have two file objects attached to the same STDOUT_FILENO. If one is closed, the underlying file descriptor is also closed, and writing to the other file object would crash the Python interpreter in a hard way, at least on Windows. So, it seems safer to not close the standard streams. This also matches the behavior of the default sys.stdout/stderr.close(), which never close the FILE* streams in C layer. https://hg.python.org/cpython/file/v2.7.13/Python/sysmodule.c#l1401

File last commit:

r32080:fcddcf44 stable
r32687:12941a78 default
Show More
build-linux-wheels.sh
34 lines | 1.1 KiB | application/x-sh | BashLexer
/ contrib / build-linux-wheels.sh
Boris Feld
packaging: add make target for linux wheels...
r32080 #!/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/cp2*/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