From 77056d83e6845dd943dc88456332b5fd7c787370 Mon Sep 17 00:00:00 2001 From: Aleksandr Ivanov Date: Tue, 16 Jul 2024 16:33:58 +0300 Subject: [PATCH] Debug CI Signed-off-by: Aleksandr Ivanov --- .github/workflows/sanitizer-debug.yaml | 30 ++++++------- .../workflows/sanitizers/build_sanitizer.sh | 44 +++++++++---------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/sanitizer-debug.yaml b/.github/workflows/sanitizer-debug.yaml index 52a4fc4726..4ef3f8042b 100644 --- a/.github/workflows/sanitizer-debug.yaml +++ b/.github/workflows/sanitizer-debug.yaml @@ -55,17 +55,17 @@ jobs: path: deps key: deps-${{ steps.get-hash.outputs.deps_hash }} - # run_asan: - # needs: build_dependencies - # uses: ./.github/workflows/sanitizer-check.yaml - # with: - # sanitizer-name: 'asan' + run_asan: + needs: build_dependencies + uses: ./.github/workflows/sanitizer-check.yaml + with: + sanitizer-name: 'asan' - # run_msan: - # needs: build_dependencies - # uses: ./.github/workflows/sanitizer-check.yaml - # with: - # sanitizer-name: 'msan' + run_msan: + needs: build_dependencies + uses: ./.github/workflows/sanitizer-check.yaml + with: + sanitizer-name: 'msan' run_tsan: needs: build_dependencies @@ -73,8 +73,8 @@ jobs: with: sanitizer-name: 'tsan' - # run_ubsan: - # needs: build_dependencies - # uses: ./.github/workflows/sanitizer-check.yaml - # with: - # sanitizer-name: 'ubsan' + run_ubsan: + needs: build_dependencies + uses: ./.github/workflows/sanitizer-check.yaml + with: + sanitizer-name: 'ubsan' diff --git a/.github/workflows/sanitizers/build_sanitizer.sh b/.github/workflows/sanitizers/build_sanitizer.sh index b29ec3cd38..c60d638c38 100755 --- a/.github/workflows/sanitizers/build_sanitizer.sh +++ b/.github/workflows/sanitizers/build_sanitizer.sh @@ -198,16 +198,16 @@ ln -sf "/opt/bb/include" "/opt/include" ln -sf "/opt/bb/lib64" "/opt/lib64" # Setup CMake options for all remaining builds -CMAKE_OPTIONS="\ +CMAKE_OPTIONS=( \ -D BUILD_BITNESS=64 \ -D CMAKE_BUILD_TYPE=Debug \ -D CMAKE_INSTALL_INCLUDEDIR=include \ -D CMAKE_INSTALL_LIBDIR=lib64 \ - -D CMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}" + -D CMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_PATH}") # Build GoogleTest cmake -B "${DIR_SRCS_EXT}/googletest/cmake.bld" \ - -S "${DIR_SRCS_EXT}/googletest" ${CMAKE_OPTIONS} \ + -S "${DIR_SRCS_EXT}/googletest" "${CMAKE_OPTIONS[@]}" \ -DCMAKE_INSTALL_PREFIX=/opt/bb cmake --build "${DIR_SRCS_EXT}/googletest/cmake.bld" -j${PARALLELISM} cmake --install "${DIR_SRCS_EXT}/googletest/cmake.bld" --prefix "/opt/bb" @@ -215,7 +215,7 @@ cmake --install "${DIR_SRCS_EXT}/googletest/cmake.bld" --prefix "/opt/bb" # Build Google Benchmark cmake -B "${DIR_SRCS_EXT}/google-benchmark/cmake.bld" \ - -S "${DIR_SRCS_EXT}/google-benchmark" ${CMAKE_OPTIONS} \ + -S "${DIR_SRCS_EXT}/google-benchmark" "${CMAKE_OPTIONS[@]}" \ -DCMAKE_INSTALL_PREFIX=/opt/bb \ -DBENCHMARK_DOWNLOAD_DEPENDENCIES="ON" \ -DBENCHMARK_ENABLE_GTEST_TESTS="false" \ @@ -231,7 +231,7 @@ cmake --install "${DIR_SRCS_EXT}/google-benchmark/cmake.bld" --prefix "/opt/bb" # https://discourse.cmake.org/t/cmake-install-prefix-not-work/5040 cmake -B "${DIR_SRCS_EXT}/zlib/cmake.bld" -S "${DIR_SRCS_EXT}/zlib" \ -D CMAKE_INSTALL_PREFIX="/opt/bb" \ - ${CMAKE_OPTIONS} + "${CMAKE_OPTIONS[@]}" # Make and install zlib. cmake --build "${DIR_SRCS_EXT}/zlib/cmake.bld" -j${PARALLELISM} cmake --install "${DIR_SRCS_EXT}/zlib/cmake.bld" @@ -242,7 +242,7 @@ cmake -B "${DIR_BUILD_BMQ}" -S "${DIR_SRC_BMQ}" -G Ninja \ -DBDE_BUILD_TARGET_64=ON \ -DBDE_BUILD_TARGET_CPP17=ON \ -DCMAKE_PREFIX_PATH="${DIR_SRCS_EXT}/bde-tools/BdeBuildSystem" \ - -DBDE_BUILD_TARGET_SAFE=1 ${CMAKE_OPTIONS} + -DBDE_BUILD_TARGET_SAFE=1 "${CMAKE_OPTIONS[@]}" cmake --build "${DIR_BUILD_BMQ}" -j${PARALLELISM} \ --target all.t -v --clean-first @@ -253,35 +253,35 @@ envcfgquery() { # be used to set the environment for a command. # e.g. 'asan' -> 'ASAN_OPTIONS="foo=bar:baz=baf" LSAN_OPTIONS="abc=fgh"' # - echo $(cfgquery " \ - .${1}.environment | \ - to_entries | \ - map(\"\(.key)=\\\"\(.value | \ - to_entries | \ - map(\"\(.key)=\(.value)\") | \ - join(\":\"))\\\"\") | \ - join(\" \")") | - sed "s|%%SRC%%|$(realpath ${DIR_SRC_BMQ})|g" | - sed "s|%%ROOT%%|$(realpath ${DIR_ROOT})|g" + cfgquery " \ + .${1}.environment | \ + to_entries | \ + map(\"\(.key)=\\\"\(.value | \ + to_entries | \ + map(\"\(.key)=\(.value)\") | \ + join(\":\"))\\\"\") | \ + join(\" \")" | + sed "s|%%SRC%%|$(realpath "${DIR_SRC_BMQ}")|g" | + sed "s|%%ROOT%%|$(realpath "${DIR_ROOT}")|g" } mkscript() { local cmd=${1} local outfile=${2} - echo '#!/usr/bin/env bash' > ${outfile} - echo "${cmd}" >> ${outfile} - chmod +x ${outfile} + echo '#!/usr/bin/env bash' > "${outfile}" + echo "${cmd}" >> "${outfile}" + chmod +x "${outfile}" } -SANITIZER_ENV="BMQ_BUILD=$(realpath ${DIR_BUILD_BMQ}) " +SANITIZER_ENV="BMQ_BUILD=$(realpath "${DIR_BUILD_BMQ}") " SANITIZER_ENV+="BMQ_REPO=${DIR_SRC_BMQ} " -SANITIZER_ENV+="$(envcfgquery ${SANITIZER_NAME})" +SANITIZER_ENV+="$(envcfgquery "${SANITIZER_NAME}")" # 'run-env.sh' runs a command with environment required of the sanitizer. mkscript "${SANITIZER_ENV} \${@}" "${DIR_BUILD_BMQ}/run-env.sh" # 'run-unittests.sh' runs all instrumented unit-tests. -CMD="cd $(realpath ${DIR_BUILD_BMQ}) && " +CMD="cd $(realpath "${DIR_BUILD_BMQ}") && " CMD+="./run-env.sh ctest -E mwcsys_executil.t --output-on-failure" mkscript "${CMD}" "${DIR_BUILD_BMQ}/run-unittests.sh"