Skip to content
Snippets Groups Projects
Commit 8831d4c3 authored by Masood Malekghassemi's avatar Masood Malekghassemi
Browse files

Merge pull request #5690 from soltanmm/merp

Don't set linetrace unless testing coverage
parents 01dd7fe6 68a94c8f
No related branches found
No related tags found
No related merge requests found
...@@ -108,8 +108,13 @@ if "linux" in sys.platform or "darwin" in sys.platform: ...@@ -108,8 +108,13 @@ if "linux" in sys.platform or "darwin" in sys.platform:
def cython_extensions(package_names, module_names, extra_sources, include_dirs, def cython_extensions(package_names, module_names, extra_sources, include_dirs,
libraries, define_macros, build_with_cython=False): libraries, define_macros, build_with_cython=False):
# Set compiler directives linetrace argument only if we care about tracing;
# this is due to Cython having different behavior between linetrace being
# False and linetrace being unset. See issue #5689.
cython_compiler_directives = {}
if ENABLE_CYTHON_TRACING: if ENABLE_CYTHON_TRACING:
define_macros = define_macros + [('CYTHON_TRACE_NOGIL', 1)] define_macros = define_macros + [('CYTHON_TRACE_NOGIL', 1)]
cython_compiler_directives['linetrace'] = True
file_extension = 'pyx' if build_with_cython else 'c' file_extension = 'pyx' if build_with_cython else 'c'
module_files = [os.path.join(PYTHON_STEM, module_files = [os.path.join(PYTHON_STEM,
name.replace('.', '/') + '.' + file_extension) name.replace('.', '/') + '.' + file_extension)
...@@ -129,7 +134,7 @@ def cython_extensions(package_names, module_names, extra_sources, include_dirs, ...@@ -129,7 +134,7 @@ def cython_extensions(package_names, module_names, extra_sources, include_dirs,
return Cython.Build.cythonize( return Cython.Build.cythonize(
extensions, extensions,
include_path=include_dirs, include_path=include_dirs,
compiler_directives={'linetrace': bool(ENABLE_CYTHON_TRACING)}) compiler_directives=cython_compiler_directives)
else: else:
return extensions return extensions
......
...@@ -40,7 +40,11 @@ export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH ...@@ -40,7 +40,11 @@ export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH
export CFLAGS="-I$ROOT/include -std=gnu99" export CFLAGS="-I$ROOT/include -std=gnu99"
export LDFLAGS="-L$ROOT/libs/$CONFIG" export LDFLAGS="-L$ROOT/libs/$CONFIG"
export GRPC_PYTHON_BUILD_WITH_CYTHON=1 export GRPC_PYTHON_BUILD_WITH_CYTHON=1
export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1
if [ "$CONFIG" = "gcov" ]
then
export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1
fi
tox --notest tox --notest
......
...@@ -40,10 +40,10 @@ export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH ...@@ -40,10 +40,10 @@ export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH
export CFLAGS="-I$ROOT/include -std=c89" export CFLAGS="-I$ROOT/include -std=c89"
export LDFLAGS="-L$ROOT/libs/$CONFIG" export LDFLAGS="-L$ROOT/libs/$CONFIG"
export GRPC_PYTHON_BUILD_WITH_CYTHON=1 export GRPC_PYTHON_BUILD_WITH_CYTHON=1
export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1
if [ "$CONFIG" = "gcov" ] if [ "$CONFIG" = "gcov" ]
then then
export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1
tox tox
else else
$ROOT/.tox/py27/bin/python $ROOT/setup.py test_lite $ROOT/.tox/py27/bin/python $ROOT/setup.py test_lite
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment