Skip to content

Commit

Permalink
chore: Fix tsan build on circleci.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Dec 11, 2024
1 parent 6460c25 commit 1a4d211
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
41 changes: 23 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ workflows:
# - bazel-tsan
# Dynamic analysis with CMake
- asan
# - tsan
- tsan
- ubsan
# Static analysis
- clang-analyze
Expand Down Expand Up @@ -60,27 +60,15 @@ jobs:
- image: ubuntu

steps:
- run: &apt_install
- run: &apt_install_git
apt-get update &&
DEBIAN_FRONTEND=noninteractive
apt-get install -y
ca-certificates
clang
cmake
git
libbenchmark-dev
libconfig-dev
libgmock-dev
libgtest-dev
libopus-dev
libsodium-dev
libvpx-dev
llvm-dev
ninja-build
pkg-config
- checkout
- run: git submodule update --init --recursive
- run: CC=clang .circleci/cmake-asan
- run: other/docker/circleci/run asan

tsan:
working_directory: ~/work
Expand All @@ -91,7 +79,7 @@ jobs:
- run: *apt_install
- checkout
- run: git submodule update --init --recursive
- run: CC=clang .circleci/cmake-tsan
- run: other/docker/circleci/run tsan

ubsan:
working_directory: ~/work
Expand All @@ -102,15 +90,32 @@ jobs:
- run: *apt_install
- checkout
- run: git submodule update --init --recursive
- run: CC=clang .circleci/cmake-ubsan
- run: other/docker/circleci/run ubsan

static-analysis:
working_directory: ~/work
docker:
- image: ubuntu

steps:
- run: *apt_install
- run: &apt_install
apt-get update &&
DEBIAN_FRONTEND=noninteractive
apt-get install -y
ca-certificates
clang
cmake
git
libbenchmark-dev
libconfig-dev
libgmock-dev
libgtest-dev
libopus-dev
libsodium-dev
libvpx-dev
llvm-dev
ninja-build
pkg-config
- run:
apt-get install -y --no-install-recommends
ca-certificates
Expand Down
9 changes: 5 additions & 4 deletions other/docker/circleci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
################################################
# cmake-asan
FROM ubuntu:20.04
FROM ubuntu:24.04

RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
clang \
cmake \
libclang-rt-dev \
libconfig-dev \
libgmock-dev \
libgtest-dev \
Expand All @@ -20,12 +21,12 @@ RUN apt-get update && \

COPY entrypoint.sh /
RUN ["chmod", "755", "/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]

WORKDIR /home/builder
RUN groupadd -r -g 1000 builder \
&& useradd --no-log-init -r -g builder -u 1000 builder \
RUN groupadd -r -g 987 builder \
&& useradd --no-log-init -r -g builder -u 987 builder \
&& chown builder:builder /home/builder
USER builder

ENV CC=clang CXX=clang++
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion other/docker/circleci/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ SANITIZER="${1:-asan}"

cp -a /c-toxcore .
cd c-toxcore
.circleci/cmake-"$SANITIZER"
.circleci/cmake-"$SANITIZER" || cat /home/builder/c-toxcore/_build/CMakeFiles/CMakeError.log

0 comments on commit 1a4d211

Please sign in to comment.