From e9c67f23f35a5f90b12db259cd3efc4fb5cee6c7 Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Thu, 31 Jan 2019 16:18:13 -0800 Subject: [PATCH] Add a new environment variable GRPC_BAZEL_BUILD --- src/python/grpcio_tests/tests/bazel_namespace_package_hack.py | 4 ++-- tools/bazel.rc | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/grpcio_tests/tests/bazel_namespace_package_hack.py b/src/python/grpcio_tests/tests/bazel_namespace_package_hack.py index 168aa163fe2..b533ca3074c 100644 --- a/src/python/grpcio_tests/tests/bazel_namespace_package_hack.py +++ b/src/python/grpcio_tests/tests/bazel_namespace_package_hack.py @@ -24,8 +24,8 @@ import sys # Analysis in depth: https://github.com/bazelbuild/rules_python/issues/55 def sys_path_to_site_dir_hack(): """Add valid sys.path item to site directory to parse the .pth files.""" - # If not running under Bazel, return. - if 'RUN_UNDER_RUNFILES' not in os.environ: + # GRPC_BAZEL_BUILD is explicitly set by tools/bazel.rc. + if 'GRPC_BAZEL_BUILD' not in os.environ: return for item in sys.path: if os.path.exists(item): diff --git a/tools/bazel.rc b/tools/bazel.rc index 99347495361..2d04bf7c9e8 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -5,6 +5,7 @@ build --client_env=CC=clang build --copt=-DGRPC_BAZEL_BUILD +build --action_env=GRPC_BAZEL_BUILD=1 build:opt --compilation_mode=opt build:opt --copt=-Wframe-larger-than=16384