Skip to content

Commit

Permalink
Debug CI
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Ivanov <[email protected]>
  • Loading branch information
alexander-e1off committed Jul 16, 2024
1 parent fd66e41 commit 77056d8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/sanitizer-debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,26 @@ 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
uses: ./.github/workflows/sanitizer-check.yaml
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'
44 changes: 22 additions & 22 deletions .github/workflows/sanitizers/build_sanitizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,24 +198,24 @@ 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"


# 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" \
Expand All @@ -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"
Expand All @@ -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

Expand All @@ -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"

0 comments on commit 77056d8

Please sign in to comment.