##// END OF EJS Templates
sshpeer: don't read from stderr when that behavior is disabled...
sshpeer: don't read from stderr when that behavior is disabled We previously prevented the creation of doublepipe instances when we're not supposed to automatically read from stderr. However, there were other automatic calls to read from stderr that were undermining this effort. This commit prevents all automatic reads from stderr from occurring when they are supposed to be disabled. Because stderr is no longer being read, we need to call "readavailable" from tests so stderr is read from. Test output changes because stderr is now always (manually) read after stdout. And, since sshpeer no longer automatically tends to stderr, no "remote: " messages are printed. This should fix non-deterministic test output. FWIW, doublepipe automatically reads from stderr when reading from stdout, so I'm not sure some of these calls to self._readerr() are even needed. Differential Revision: https://phab.mercurial-scm.org/D2571

File last commit:

r31796:e0dc4053 default
r36626:1151c731 default
Show More
setup_zstd.py
102 lines | 2.6 KiB | text/x-python | PythonLexer
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 # Copyright (c) 2016-present, Gregory Szorc
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import os
from distutils.extension import Extension
zstd_sources = ['zstd/%s' % p for p in (
'common/entropy_common.c',
'common/error_private.c',
'common/fse_decompress.c',
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895 'common/pool.c',
'common/threading.c',
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 'common/xxhash.c',
'common/zstd_common.c',
'compress/fse_compress.c',
'compress/huf_compress.c',
'compress/zstd_compress.c',
Gregory Szorc
zstd: vendor python-zstandard 0.8.0...
r31796 'compress/zstdmt_compress.c',
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 'decompress/huf_decompress.c',
'decompress/zstd_decompress.c',
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895 'dictBuilder/cover.c',
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 'dictBuilder/divsufsort.c',
'dictBuilder/zdict.c',
)]
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 zstd_sources_legacy = ['zstd/%s' % p for p in (
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895 'deprecated/zbuff_common.c',
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 'deprecated/zbuff_compress.c',
'deprecated/zbuff_decompress.c',
'legacy/zstd_v01.c',
'legacy/zstd_v02.c',
'legacy/zstd_v03.c',
'legacy/zstd_v04.c',
'legacy/zstd_v05.c',
'legacy/zstd_v06.c',
'legacy/zstd_v07.c'
)]
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435
zstd_includes = [
'c-ext',
'zstd',
'zstd/common',
'zstd/compress',
'zstd/decompress',
'zstd/dictBuilder',
]
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 zstd_includes_legacy = [
'zstd/deprecated',
'zstd/legacy',
]
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 ext_sources = [
'zstd.c',
Gregory Szorc
zstd: vendor python-zstandard 0.8.0...
r31796 'c-ext/bufferutil.c',
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 'c-ext/compressiondict.c',
'c-ext/compressobj.c',
'c-ext/compressor.c',
'c-ext/compressoriterator.c',
'c-ext/compressionparams.c',
'c-ext/compressionwriter.c',
'c-ext/constants.c',
'c-ext/decompressobj.c',
'c-ext/decompressor.c',
'c-ext/decompressoriterator.c',
'c-ext/decompressionwriter.c',
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895 'c-ext/frameparams.c',
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 ]
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 zstd_depends = [
'c-ext/python-zstandard.h',
]
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822
def get_c_extension(support_legacy=False, name='zstd'):
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 """Obtain a distutils.extension.Extension for the C extension."""
root = os.path.abspath(os.path.dirname(__file__))
sources = [os.path.join(root, p) for p in zstd_sources + ext_sources]
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 if support_legacy:
sources.extend([os.path.join(root, p) for p in zstd_sources_legacy])
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 include_dirs = [os.path.join(root, d) for d in zstd_includes]
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 if support_legacy:
include_dirs.extend([os.path.join(root, d) for d in zstd_includes_legacy])
depends = [os.path.join(root, p) for p in zstd_depends]
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435
Gregory Szorc
zstd: vendor python-zstandard 0.8.0...
r31796 extra_args = ['-DZSTD_MULTITHREAD']
if support_legacy:
extra_args.append('-DZSTD_LEGACY_SUPPORT=1')
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 # TODO compile with optimizations.
return Extension(name, sources,
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 include_dirs=include_dirs,
depends=depends,
Gregory Szorc
zstd: vendor python-zstandard 0.8.0...
r31796 extra_compile_args=extra_args)