Skip to content

Commit

Permalink
Merge commit '9ddeea3d06045c8ae38cd2d6eed0fc2891c6e146'
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Dec 15, 2023
2 parents 7495a50 + 9ddeea3 commit b95f049
Show file tree
Hide file tree
Showing 78 changed files with 880 additions and 403 deletions.
1 change: 1 addition & 0 deletions external/toxcore/c-toxcore/.circleci/cmake-ubsan
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CACHEDIR="$HOME/cache"

. ".github/scripts/flags-$CC.sh"
add_flag -Werror
add_flag -D_DEBUG
add_flag -fdiagnostics-color=always
add_flag -fno-omit-frame-pointer
add_flag -fno-sanitize-recover=all
Expand Down
15 changes: 12 additions & 3 deletions external/toxcore/c-toxcore/.cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ bazel-opt_task:
- /src/workspace/tools/inject-repo c-toxcore
test_all_script:
- cd /src/workspace && bazel test -k
--config=ci
--build_tag_filters=-haskell
--test_tag_filters=-haskell
--
Expand All @@ -26,7 +25,6 @@ bazel-dbg_task:
- /src/workspace/tools/inject-repo c-toxcore
test_all_script:
- cd /src/workspace && bazel test -k
--config=ci
--build_tag_filters=-haskell
--test_tag_filters=-haskell
--
Expand All @@ -43,8 +41,19 @@ cimple_task:
- /src/workspace/tools/inject-repo c-toxcore
test_all_script:
- cd /src/workspace && bazel test -k
--config=ci
--build_tag_filters=haskell
--test_tag_filters=haskell
--
//c-toxcore/...

freebsd_task:
container:
image: toxchat/freebsd:latest
cpu: 2
memory: 4G
kvm: true
configure_script:
- git submodule update --init --recursive
- cd .. && mv cirrus-ci-build /work/c-toxcore && mkdir cirrus-ci-build
test_all_script:
- cd /work/c-toxcore && .github/scripts/cmake-freebsd
2 changes: 2 additions & 0 deletions external/toxcore/c-toxcore/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/_build
/_install
55 changes: 55 additions & 0 deletions external/toxcore/c-toxcore/.github/scripts/cmake-alpine-s390x
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
# Copyright (C) 2018-2023 nurupo

# Toxcore building

set -eux

cd .. # /work
. cmake-alpine-run.sh

# === Get VM ready to build the code ===

start_vm

RUN apk add cmake g++ ninja

mv c-toxcore /

# Copy over toxcore code from host to qemu
scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P "$SSH_PORT" -r /c-toxcore root@localhost:~

cd /c-toxcore
. ".github/scripts/flags-gcc.sh"

# Make compilation error on a warning
add_flag -Werror

# - disabling toxav because vpx doesn't work on s390x.
# - disabling bootstrap daemons because we don't need them for testing (saving time).
# - disabling shared libraries because it saves a lot of time on building PIC objects.
# - enable unity build because it saves a lot of time as well (fewer objects to build).
RUN "cmake -B_build -Hc-toxcore -GNinja \
-DCMAKE_C_FLAGS='$C_FLAGS' \
-DCMAKE_CXX_FLAGS='$CXX_FLAGS' \
-DCMAKE_EXE_LINKER_FLAGS='$LD_FLAGS' \
-DCMAKE_SHARED_LINKER_FLAGS='$LD_FLAGS' \
-DCMAKE_INSTALL_PREFIX:PATH='_install' \
-DCMAKE_UNITY_BUILD=ON \
-DMIN_LOGGER_LEVEL=TRACE \
-DNON_HERMETIC_TESTS=ON \
-DENABLE_SHARED=OFF \
-DBUILD_TOXAV=OFF \
-DDHT_BOOTSTRAP=OFF \
-DBOOTSTRAP_DAEMON=OFF \
-DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=90 \
-DUSE_IPV6=OFF \
-DAUTOTEST=ON"

RUN 'cmake --build _build --parallel 2 --target install -- -k 0'
RUN 'cd _build && ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:1 --timeout 90 || true' &

# Give the tests 5 minutes to run. Sometimes, the per-test timeout doesn't
# work, so we put a global timeout here for everything.
sleep 300
58 changes: 58 additions & 0 deletions external/toxcore/c-toxcore/.github/scripts/cmake-freebsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
# Copyright (C) 2018-2023 nurupo

# Toxcore building

set -eux

cd .. # /work
. cmake-freebsd-run.sh

# === Get VM ready to build the code ===

# Unpack image only if it's compressed.
if [ -f "$IMAGE_NAME.gz" ]; then
gunzip "$IMAGE_NAME.gz"
fi

mv c-toxcore /

start_vm

# Copy over toxcore code from host to qemu
scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P "$SSH_PORT" -r /c-toxcore root@localhost:~

RUN ls -lh

cd /c-toxcore
. '.github/scripts/flags-clang.sh'

add_ld_flag -Wl,-z,defs

# Make compilation error on a warning.
add_flag -Werror

# This triggers on FreeBSD's clang.
add_flag -Wno-format
add_flag -Wno-unsafe-buffer-usage

RUN "cmake -B_build -Hc-toxcore \
-DCMAKE_C_FLAGS='$C_FLAGS' \
-DCMAKE_CXX_FLAGS='$CXX_FLAGS' \
-DCMAKE_EXE_LINKER_FLAGS='$LD_FLAGS' \
-DCMAKE_SHARED_LINKER_FLAGS='$LD_FLAGS' \
-DCMAKE_INSTALL_PREFIX:PATH='_install' \
-DMIN_LOGGER_LEVEL=TRACE \
-DMUST_BUILD_TOXAV=ON \
-DNON_HERMETIC_TESTS=ON \
-DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=120 \
-DUSE_IPV6=OFF \
-DAUTOTEST=ON"

# We created the VM with the same number of cores as the host, so the host-ran `nproc` here is fine.
RUN 'cmake --build _build --parallel "$NPROC" --target install -- -k'
RUN 'cd _build && ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:2 --timeout 120 || true'

# Gracefully shut down the VM.
stop_vm
52 changes: 0 additions & 52 deletions external/toxcore/c-toxcore/.github/scripts/cmake-freebsd-stage2

This file was deleted.

2 changes: 0 additions & 2 deletions external/toxcore/c-toxcore/.github/scripts/flags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ add_flag -O3 -march=native

# Warn on non-ISO C.
add_c_flag -pedantic
add_c_flag -std=c99
add_cxx_flag -std=c++11

add_flag -g3
add_flag -ftrapv
30 changes: 23 additions & 7 deletions external/toxcore/c-toxcore/.github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,52 @@ branches:
protection:
required_status_checks:
contexts:
- "bazel-asan"
- "bazel-dbg"
- "bazel-opt"
- "bazel-tsan"
- "build-alpine-s390x"
- "build-android"
- "build-compcert"
- "build-macos"
- "build-nacl"
- "build-tcc"
- "build-win32"
- "build-win64"
- "CodeFactor"
- "common / buildifier"
- "coverage-linux"
- "ci/circleci: asan"
- "ci/circleci: bazel-asan"
- "ci/circleci: bazel-msan"
- "ci/circleci: bazel-tsan"
- "ci/circleci: clang-analyze"
- "ci/circleci: clang-tidy"
- "ci/circleci: cpplint"
- "ci/circleci: infer"
- "ci/circleci: msan"
- "ci/circleci: static-analysis"
- "ci/circleci: tsan"
- "ci/circleci: ubsan"
- "cimple"
- "cimplefmt"
- "CodeFactor"
- "code-review/reviewable"
- "continuous-integration/appveyor/pr"
- "common / buildifier"
- "coverage-linux"
- "docker-bootstrap-node"
- "docker-bootstrap-node-websocket"
- "docker-clusterfuzz"
- "docker-esp32"
- "docker-fuzzer"
- "docker-toxcore-js"
- "docker-win32"
- "docker-win64"
- "doxygen"
- "freebsd"
- "Hound"
- "misra"
- "mypy"
- "program-analysis"
- "sonar-scan"
- "tokstyle"
- "TokTok.c-toxcore"
- "TokTok.c-toxcore (windows_msvc_conan shared)"
- "TokTok.c-toxcore (windows_msvc_conan static)"

# Labels specific to c-toxcore.
labels:
Expand Down
Loading

0 comments on commit b95f049

Please sign in to comment.