Skip to content

Commit 4f09f4e

Browse files
committed
chore: Fix tsan build by moving it to GitHub CI.
In exchange, moved some github actions to circleci.
1 parent 6460c25 commit 4f09f4e

File tree

5 files changed

+58
-87
lines changed

5 files changed

+58
-87
lines changed

.circleci/config.yml

Lines changed: 23 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,15 @@ version: 2
33

44
workflows:
55
version: 2
6-
program-analysis:
7-
# TODO(iphydf): Re-enable tsan when it's fixed.
6+
circleci:
87
jobs:
9-
# Dynamic analysis in the Bazel build
108
- bazel-asan
119
- bazel-msan
12-
# - bazel-tsan
13-
# Dynamic analysis with CMake
14-
- asan
15-
# - tsan
16-
- ubsan
17-
# Static analysis
1810
- clang-analyze
1911
- cpplint
2012
- static-analysis
13+
- cimplefmt
14+
- generate-events
2115

2216
jobs:
2317
bazel-asan:
@@ -30,20 +24,6 @@ jobs:
3024
- run: .circleci/bazel-test
3125
//c-toxcore/...
3226

33-
bazel-tsan:
34-
working_directory: /tmp/cirrus-ci-build
35-
docker:
36-
- image: toxchat/toktok-stack:latest-tsan
37-
38-
steps:
39-
- checkout
40-
- run: .circleci/bazel-test
41-
//c-toxcore/...
42-
-//c-toxcore/auto_tests:conference_av_test
43-
-//c-toxcore/auto_tests:conference_test
44-
-//c-toxcore/auto_tests:onion_test
45-
-//c-toxcore/auto_tests:tox_many_test
46-
4727
bazel-msan:
4828
working_directory: /tmp/cirrus-ci-build
4929
docker:
@@ -54,7 +34,7 @@ jobs:
5434
- run: .circleci/bazel-test
5535
//c-toxcore/auto_tests:lossless_packet_test
5636

57-
asan:
37+
static-analysis:
5838
working_directory: ~/work
5939
docker:
6040
- image: ubuntu
@@ -78,39 +58,6 @@ jobs:
7858
llvm-dev
7959
ninja-build
8060
pkg-config
81-
- checkout
82-
- run: git submodule update --init --recursive
83-
- run: CC=clang .circleci/cmake-asan
84-
85-
tsan:
86-
working_directory: ~/work
87-
docker:
88-
- image: ubuntu
89-
90-
steps:
91-
- run: *apt_install
92-
- checkout
93-
- run: git submodule update --init --recursive
94-
- run: CC=clang .circleci/cmake-tsan
95-
96-
ubsan:
97-
working_directory: ~/work
98-
docker:
99-
- image: ubuntu
100-
101-
steps:
102-
- run: *apt_install
103-
- checkout
104-
- run: git submodule update --init --recursive
105-
- run: CC=clang .circleci/cmake-ubsan
106-
107-
static-analysis:
108-
working_directory: ~/work
109-
docker:
110-
- image: ubuntu
111-
112-
steps:
113-
- run: *apt_install
11461
- run:
11562
apt-get install -y --no-install-recommends
11663
ca-certificates
@@ -147,3 +94,22 @@ jobs:
14794
- checkout
14895
- run: git submodule update --init --recursive
14996
- run: other/analysis/run-cpplint
97+
98+
cimplefmt:
99+
working_directory: ~/work
100+
machine: { image: ubuntu-2204:current }
101+
102+
steps:
103+
- checkout
104+
- run: git submodule update --init --recursive
105+
- run: other/docker/cimplefmt/run -u $(find tox* -name "*.[ch]")
106+
107+
generate-events:
108+
working_directory: ~/work
109+
machine: { image: ubuntu-2204:current }
110+
111+
steps:
112+
- checkout
113+
- run: git submodule update --init --recursive
114+
- run: other/event_tooling/run
115+
- run: git diff --exit-code

.github/workflows/ci.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
tool: [autotools, clang-tidy, compcert, cppcheck, doxygen, goblint, infer, freebsd, misra, modules, pkgsrc, rpm, slimcc, sparse, tcc, tokstyle]
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-22.04
2222
steps:
2323
- name: Set up Docker Buildx
2424
uses: docker/setup-buildx-action@v3
@@ -34,37 +34,34 @@ jobs:
3434
with:
3535
file: other/docker/${{ matrix.tool }}/${{ matrix.tool }}.Dockerfile
3636

37-
coverage-linux:
38-
runs-on: ubuntu-latest
37+
sanitizer:
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
sanitizer: [asan, tsan, ubsan]
42+
runs-on: ubuntu-22.04
3943
steps:
40-
- uses: actions/checkout@v4
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v3
4146
with:
42-
submodules: recursive
43-
- name: Build, test, and upload coverage
44-
run: other/docker/coverage/run
45-
46-
generate-events:
47-
runs-on: ubuntu-latest
48-
steps:
47+
driver: docker
4948
- uses: actions/checkout@v4
5049
with:
5150
submodules: recursive
52-
- name: Run generate_event_c
53-
run: |
54-
other/event_tooling/run
55-
git diff --exit-code
51+
- name: Run sanitizer
52+
run: other/docker/circleci/run "${{ matrix.sanitizer }}"
5653

57-
cimplefmt:
58-
runs-on: ubuntu-latest
54+
coverage-linux:
55+
runs-on: ubuntu-22.04
5956
steps:
6057
- uses: actions/checkout@v4
6158
with:
6259
submodules: recursive
63-
- name: Run cimplefmt
64-
run: other/docker/cimplefmt/run -u $(find tox* -name "*.[ch]")
60+
- name: Build, test, and upload coverage
61+
run: other/docker/coverage/run
6562

6663
build-android:
67-
runs-on: ubuntu-latest
64+
runs-on: ubuntu-22.04
6865
steps:
6966
- uses: actions/checkout@v4
7067
with:
@@ -111,7 +108,7 @@ jobs:
111108
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6 --build-config Debug
112109
113110
build-netbsd:
114-
runs-on: ubuntu-latest
111+
runs-on: ubuntu-22.04
115112
steps:
116113
- uses: actions/checkout@v4
117114
with:
@@ -146,7 +143,7 @@ jobs:
146143
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6
147144
148145
build-freebsd:
149-
runs-on: ubuntu-latest
146+
runs-on: ubuntu-22.04
150147
steps:
151148
- uses: actions/checkout@v4
152149
with:
@@ -183,7 +180,7 @@ jobs:
183180
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6
184181
185182
mypy:
186-
runs-on: ubuntu-latest
183+
runs-on: ubuntu-22.04
187184
steps:
188185
- uses: actions/checkout@v4
189186
with:

other/docker/circleci/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
################################################
22
# cmake-asan
3-
FROM ubuntu:20.04
3+
FROM ubuntu:24.04
44

55
RUN apt-get update && \
66
DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
77
clang \
88
cmake \
9+
libclang-rt-dev \
910
libconfig-dev \
1011
libgmock-dev \
1112
libgtest-dev \
1213
libopus-dev \
1314
libsodium-dev \
1415
libvpx-dev \
15-
llvm-dev \
1616
ninja-build \
1717
pkg-config \
1818
&& apt-get clean \
@@ -22,8 +22,8 @@ COPY entrypoint.sh /
2222
RUN ["chmod", "755", "/entrypoint.sh"]
2323

2424
WORKDIR /home/builder
25-
RUN groupadd -r -g 1000 builder \
26-
&& useradd --no-log-init -r -g builder -u 1000 builder \
25+
RUN groupadd -r -g 987 builder \
26+
&& useradd --no-log-init -r -g builder -u 987 builder \
2727
&& chown builder:builder /home/builder
2828
USER builder
2929

other/docker/circleci/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/sh
22

3-
set -eu
3+
set -eux
44

55
SANITIZER="${1:-asan}"
66

77
cp -a /c-toxcore .
88
cd c-toxcore
9-
.circleci/cmake-"$SANITIZER"
9+
.circleci/cmake-"$SANITIZER" || (cat /home/builder/c-toxcore/_build/CMakeFiles/CMakeError.log && false)

other/docker/circleci/run

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/bin/sh
22

3+
set -eux
4+
35
SANITIZER="${1:-asan}"
46

7+
if [ -t 0 ]; then
8+
TTY=true
9+
else
10+
TTY=false
11+
fi
12+
513
docker build -t toxchat/c-toxcore:circleci other/docker/circleci
6-
docker run --name toxcore-circleci --rm -it -v "$PWD:/c-toxcore" toxchat/c-toxcore:circleci "$SANITIZER"
14+
docker run --name toxcore-circleci --rm --interactive="$TTY" --tty="$TTY" --volume "$PWD:/c-toxcore" toxchat/c-toxcore:circleci "$SANITIZER"

0 commit comments

Comments
 (0)