Skip to content

Commit 923bb91

Browse files
committed
ensure NDEBUG is set consistently
otherwise grpcio ends up with missing symbols at runtime, because ``` class DomainStorage : public DualRefCounted<DomainStorage>, public channelz::DataSource ``` ends up having a different class layout, due to inheriting from DualRefCounted, which changes size depending on NDEBUG being present or not, see https://github.com/grpc/grpc/blob/v1.78.0-pre1/src/core/util/dual_ref_counted.h
1 parent ca26f6b commit 923bb91

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

recipe/build-cpp.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ pushd build-cpp
7171
echo CC="${CC}"
7272
echo CFLAGS="${CFLAGS}"
7373

74+
# our compilers set `-DNDEBUG` in CPPFLAGS, but grpc does not seem to respect
75+
# this consistently; add it to CXXFLAGS as well to avoid any doubt, see
76+
# https://github.com/abseil/abseil-cpp/issues/1624#issuecomment-1968073823
77+
CXXFLAGS="${CXXFLAGS} -DNDEBUG"
78+
7479
# point to right protoc
7580
if [[ "$CONDA_BUILD_CROSS_COMPILATION" == 1 ]]; then
7681
export CMAKE_ARGS="${CMAKE_ARGS} -DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc"

recipe/build-grpcio.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -ex
23

34
export GRPC_BUILD_WITH_BORING_SSL_ASM=""
45
export GRPC_PYTHON_BUILD_SYSTEM_ABSL="True"
@@ -25,4 +26,9 @@ fi
2526
ln -sf "$(which $CC)" "$SRC_DIR/cc"
2627
export PATH="$SRC_DIR:$PATH"
2728

29+
# our compilers set `-DNDEBUG` in CPPFLAGS, but grpc does not seem to respect
30+
# this consistently; add it to CXXFLAGS as well to avoid any doubt, see
31+
# https://github.com/abseil/abseil-cpp/issues/1624#issuecomment-1968073823
32+
CXXFLAGS="${CXXFLAGS} -DNDEBUG"
33+
2834
$PYTHON -m pip install . --no-deps --ignore-installed --no-cache-dir -v

0 commit comments

Comments
 (0)