##// END OF EJS Templates
bundle1: fix bundle1-denied reporting for push over ssh...
bundle1: fix bundle1-denied reporting for push over ssh Changeset b288fb2724bf introduced a config option to have the server deny push using bundle1. The original protocol has not really be design to allow such kind of error reporting so some hack was used. It turned the hack only works on HTTP and that ssh wire peer hangs forever when the same hack is used. After further digging, there is no way to report the error in a unified way. Using 'ooberror' freeze ssh and raising 'Abort' makes HTTP return a HTTP500 without further details. So with sadness we implement a version that dispatch according to the protocol used. We also add a test for pushing over ssh to make sure we won't regress in the future. That test show that the hint is missing, this is another bug fixed in the next changeset.

File last commit:

r30895:c32454d6 default
r30909:d554e624 stable
Show More
setup_zstd.py
91 lines | 2.4 KiB | text/x-python | PythonLexer
# 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',
'common/xxhash.c',
'common/zstd_common.c',
'compress/fse_compress.c',
'compress/huf_compress.c',
'compress/zstd_compress.c',
'decompress/huf_decompress.c',
'decompress/zstd_decompress.c',
'dictBuilder/divsufsort.c',
'dictBuilder/zdict.c',
)]
zstd_sources_legacy = ['zstd/%s' % p for p in (
'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'
)]
zstd_includes = [
'c-ext',
'zstd',
'zstd/common',
'zstd/compress',
'zstd/decompress',
'zstd/dictBuilder',
]
zstd_includes_legacy = [
'zstd/deprecated',
'zstd/legacy',
]
ext_sources = [
'zstd.c',
'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',
'c-ext/dictparams.c',
]
zstd_depends = [
'c-ext/python-zstandard.h',
]
def get_c_extension(support_legacy=False, name='zstd'):
"""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]
if support_legacy:
sources.extend([os.path.join(root, p) for p in zstd_sources_legacy])
include_dirs = [os.path.join(root, d) for d in zstd_includes]
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]
# TODO compile with optimizations.
return Extension(name, sources,
include_dirs=include_dirs,
depends=depends,
extra_compile_args=["-DZSTD_LEGACY_SUPPORT=1"] if support_legacy else [])