From 48dbcfebc0322c826629785209c876097bfb5b56 Mon Sep 17 00:00:00 2001 From: iphydf Date: Thu, 31 Aug 2023 14:24:41 +0000 Subject: [PATCH] cleanup: Remove redundant `-DSODIUM_EXPORT` from definitions. `-DSODIUM_STATIC` implies `-DSODIUM_EXPORT`. --- .circleci/bazel-test | 14 ++++++++++ .circleci/config.yml | 27 ++++++++++++++++++- .cirrus.yml | 62 -------------------------------------------- CMakeLists.txt | 2 +- 4 files changed, 41 insertions(+), 64 deletions(-) create mode 100755 .circleci/bazel-test diff --git a/.circleci/bazel-test b/.circleci/bazel-test new file mode 100755 index 00000000..b2d236d9 --- /dev/null +++ b/.circleci/bazel-test @@ -0,0 +1,14 @@ +#!/bin/sh + +set -eux + +git submodule update --init --recursive +/src/workspace/tools/inject-repo c-toxcore +cd /src/workspace && bazel test -k \ + --config=remote \ + --build_tag_filters=-haskell \ + --test_tag_filters=-haskell \ + --remote_download_minimal \ + -- \ + //c-toxcore/... \ + "$@" diff --git a/.circleci/config.yml b/.circleci/config.yml index aaa09d31..bfa39f09 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,10 @@ workflows: version: 2 program-analysis: jobs: - # Dynamic analysis + # Dynamic analysis in the Bazel build + - bazel-asan + - bazel-tsan + # Dynamic analysis with CMake - asan - tsan - msan @@ -18,6 +21,28 @@ workflows: - static-analysis jobs: + bazel-asan: + working_directory: /tmp/cirrus-ci-build + docker: + - image: toxchat/toktok-stack:latest-asan + + steps: + - checkout + - run: .circleci/bazel-test + + bazel-tsan: + working_directory: /tmp/cirrus-ci-build + docker: + - image: toxchat/toktok-stack:latest-tsan + + steps: + - checkout + - run: .circleci/bazel-test + -//c-toxcore/auto_tests:conference_av_test + -//c-toxcore/auto_tests:conference_test + -//c-toxcore/auto_tests:onion_test + -//c-toxcore/auto_tests:tox_many_test + asan: working_directory: ~/work docker: diff --git a/.cirrus.yml b/.cirrus.yml index 9a3d27f3..f0b49c01 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -35,68 +35,6 @@ bazel-dbg_task: //c-toxcore/... -//c-toxcore/auto_tests:tcp_relay_test # TODO(robinlinden): Why does this pass locally but not in Cirrus? -bazel-asan_task: - container: - image: toxchat/toktok-stack:latest-asan - cpu: 2 - memory: 4G - configure_script: - - git submodule update --init --recursive - - /src/workspace/tools/inject-repo c-toxcore - test_all_script: - - cd /src/workspace && bazel test -k - --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST - --build_tag_filters=-haskell - --test_tag_filters=-haskell - --remote_download_minimal - -- - //c-toxcore/... - -//c-toxcore/auto_tests:tcp_relay_test # TODO(robinlinden): Why does this pass locally but not in Cirrus? - -# TODO(iphydf): Enable once this works properly. -#bazel-msan_task: -# container: -# image: toxchat/toktok-stack:latest-msan -# cpu: 2 -# memory: 4G -# configure_script: -# - git submodule update --init --recursive -# - /src/workspace/tools/inject-repo c-toxcore -# test_all_script: -# - cd /src/workspace && bazel test -k -# --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST -# --build_tag_filters=-haskell -# --test_tag_filters=-haskell -# --remote_download_minimal -# -- -# //c-toxcore/... -# -//c-toxcore/auto_tests:tcp_relay_test # TODO(robinlinden): Why does this pass locally but not in Cirrus? - -# TODO(iphydf): Fix test timeouts. -bazel-tsan_task: - container: - image: toxchat/toktok-stack:latest-tsan - cpu: 2 - memory: 4G - configure_script: - - git submodule update --init --recursive - - /src/workspace/tools/inject-repo c-toxcore - test_all_script: - - cd /src/workspace && bazel test -k - --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST - --build_tag_filters=-haskell - --test_tag_filters=-haskell - --remote_download_minimal - -- - //c-toxcore/... - -//c-toxcore/auto_tests:conference_av_test - -//c-toxcore/auto_tests:conference_test - -//c-toxcore/auto_tests:file_transfer_test - -//c-toxcore/auto_tests:group_tcp_test - -//c-toxcore/auto_tests:onion_test - -//c-toxcore/auto_tests:tcp_relay_test - -//c-toxcore/auto_tests:tox_many_test - cimple_task: container: image: toxchat/toktok-stack:latest-release diff --git a/CMakeLists.txt b/CMakeLists.txt index d3cabf06..028112d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,7 +156,7 @@ endif() if(MSVC) option(MSVC_STATIC_SODIUM "Whether to link libsodium statically for MSVC" OFF) if(MSVC_STATIC_SODIUM) - add_definitions(-DSODIUM_STATIC=1 -DSODIUM_EXPORT) + add_definitions(-DSODIUM_STATIC=1) endif() endif()