diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ec833e023..67a82f3eb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -269,7 +269,7 @@ jobs: sudo ./ci/setup_ci_environment.sh - name: run otlp exporter tests run: | - sudo ./ci/setup_grpc.sh -b OFF + sudo ./ci/setup_grpc.sh -T ./ci/do_ci.sh cmake.exporter.otprotocol.shared_libs.with_static_grpc.test plugin_test: diff --git a/ci/setup_grpc.sh b/ci/setup_grpc.sh index 05b7887cc0..2cbb2ff5d1 100755 --- a/ci/setup_grpc.sh +++ b/ci/setup_grpc.sh @@ -14,7 +14,7 @@ install_dir='/usr/local/' build_shared_libs='' usage() { echo "Usage: $0 [-v ] [-i "] 1>&2; exit 1;} -while getopts ":v:i:r:s:b:" o; do +while getopts ":v:i:r:s:TH" o; do case "${o}" in v) gcc_version=${OPTARG} @@ -28,8 +28,11 @@ while getopts ":v:i:r:s:b:" o; do s) std_version=${OPTARG} ;; - b) - build_shared_libs=${OPTARG} + T) + build_shared_libs="OFF" + ;; + H) + build_shared_libs="ON" ;; *) usage @@ -57,13 +60,21 @@ pushd grpc git submodule init git submodule update --depth 1 mkdir -p "third_party/abseil-cpp/build" && pushd "third_party/abseil-cpp/build" -cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ - -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR .. -make -j${nproc} install && popd +set -x + +ABSEIL_CPP_BUILD_OPTIONS=( + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE + -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR +) +if [ ! -z "$build_shared_libs" ]; then + ABSEIL_CPP_BUILD_OPTIONS=(${ABSEIL_CPP_BUILD_OPTIONS[@]} "-DBUILD_SHARED_LIBS=$build_shared_libs"}) +fi +cmake ${ABSEIL_CPP_BUILD_OPTIONS[@]} .. +cmake --build . -j${nproc} --target install && popd mkdir -p build && pushd build -BUILD_OPTIONS=( +GRPC_BUILD_OPTIONS=( -DgRPC_INSTALL=ON -DCMAKE_CXX_STANDARD=${std_version} -DgRPC_BUILD_TESTS=OFF @@ -71,12 +82,12 @@ BUILD_OPTIONS=( -DCMAKE_PREFIX_PATH=$INSTALL_DIR ) if [ ! -z "$build_shared_libs" ]; then - BUILD_OPTIONS=(${BUILD_OPTIONS[@]} "-DBUILD_SHARED_LIBS=$build_shared_libs"}) + GRPC_BUILD_OPTIONS=(${GRPC_BUILD_OPTIONS[@]} "-DBUILD_SHARED_LIBS=$build_shared_libs"}) fi -cmake ${BUILD_OPTIONS[@]} .. -make -j $(nproc) -make install +cmake ${GRPC_BUILD_OPTIONS[@]} .. +cmake --build . -j$(nproc) +cmake --install . popd popd