diff --git a/.circleci/bazel-test b/.circleci/bazel-test new file mode 100755 index 00000000000..4041c80e326 --- /dev/null +++ b/.circleci/bazel-test @@ -0,0 +1,13 @@ +#!/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 aaa09d31537..b905c2e487f 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,24 @@ 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 + asan: working_directory: ~/work docker: diff --git a/.cirrus.yml b/.cirrus.yml index 9a3d27f35b0..f0b49c019ed 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 d3cabf06c66..028112d42e5 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()