forked from Green-Sky/tomato
Green Sky
8eb4892b49
6d634674a9 cleanup: Remove old type-ordered event getters. d1d48d1dfc feat: add ngc events 994ffecc6b refactor: Make event dispatch ordered by receive time. 812f931d5f fix: Make sure there's enough space for CONSUME1 in fuzzers. 50f1b30fa9 test: Add fuzz tests to the coverage run. df76f5cf47 chore: Move from gcov to llvm source-based coverage. 072e3beb3f fix: issues with packet broadcast error reporting 6b6718e4d2 cleanup: Make group packet entry creation less error-prone 5b9c420ce1 refactor: packet broadcast functions now return errors af4cb31028 refactor: Use `operator==` for equality tests of `Node_format`. 9592d590cf refactor(test): Slightly nicer C++ interface to tox Random. c66e10fb7a refactor: Minor refactoring of get_close_nodes functions. ebc9643862 fix: don't pass garbage data buffer to packet send functions 32b68cffca cleanup: Some more test cleanups, removing overly smart code. 0426624dcb refactor: Assign malloc return to a local variable first. afc38f2458 test: Add more unit tests for `add_to_list`. 05ce5c1ab9 test: Add "infer" CI check to github, remove from circle. REVERT: 8f0d505f9a feat: add ngc events REVERT: 9b8216e70c refactor: Make event dispatch ordered by receive time. git-subtree-dir: external/toxcore/c-toxcore git-subtree-split: 6d634674a929edb0ab70689dcbcb195b3547be13
86 lines
3.1 KiB
Docker
86 lines
3.1 KiB
Docker
FROM toxchat/c-toxcore:sources AS src
|
|
FROM ubuntu:20.04 AS build
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main" >> /etc/apt/sources.list \
|
|
&& curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc \
|
|
&& apt-get update && \
|
|
DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
|
|
clang-17 \
|
|
cmake \
|
|
git \
|
|
golang-1.18 \
|
|
libclang-rt-17-dev \
|
|
libconfig-dev \
|
|
libgmock-dev \
|
|
libgtest-dev \
|
|
libopus-dev \
|
|
libsodium-dev \
|
|
libunwind-17-dev \
|
|
libvpx-dev \
|
|
lld-17 \
|
|
llvm-17-dev \
|
|
make \
|
|
ninja-build \
|
|
pkg-config \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
RUN ["curl", "-s", "https://codecov.io/bash", "-o", "/usr/local/bin/codecov"]
|
|
RUN ["chmod", "+x", "/usr/local/bin/codecov"]
|
|
|
|
ENV CC=clang-17 \
|
|
CXX=clang++-17 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PATH=$PATH:/usr/lib/go-1.18/bin
|
|
|
|
COPY --from=src /src/ /work/
|
|
|
|
WORKDIR /work
|
|
RUN git clone --depth=1 https://github.com/TokTok/toktok-fuzzer /work/testing/fuzzing/toktok-fuzzer
|
|
RUN source .github/scripts/flags-coverage.sh \
|
|
&& go version \
|
|
&& (cd other/proxy && go get github.com/things-go/go-socks5 && go build proxy_server.go) \
|
|
&& cmake -B_build -H. -GNinja \
|
|
-DCMAKE_C_FLAGS="$C_FLAGS" \
|
|
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
|
|
-DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS -fuse-ld=lld" \
|
|
-DCMAKE_UNITY_BUILD=ON \
|
|
-DENABLE_SHARED=OFF \
|
|
-DMIN_LOGGER_LEVEL=TRACE \
|
|
-DMUST_BUILD_TOXAV=ON \
|
|
-DNON_HERMETIC_TESTS=OFF \
|
|
-DSTRICT_ABI=ON \
|
|
-DAUTOTEST=ON \
|
|
-DPROXY_TEST=ON \
|
|
-DBUILD_FUZZ_TESTS=ON \
|
|
-DUSE_IPV6=OFF \
|
|
-DTEST_TIMEOUT_SECONDS=40 \
|
|
&& cmake --build _build --parallel 8 --target install
|
|
|
|
WORKDIR /work/_build
|
|
RUN /work/other/proxy/proxy_server \
|
|
& (ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6 || \
|
|
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6)
|
|
|
|
WORKDIR /work/mallocfail
|
|
RUN ["git", "clone", "--depth=1", "https://github.com/TokTok/mallocfail", "/work/mallocfail"]
|
|
RUN clang-17 -fuse-ld=lld -fPIC -shared -O2 -g3 -Wall -I/usr/lib/llvm-17/include -L/usr/lib/llvm-17/lib -Ideps/uthash -Ideps/sha3 deps/*/*.c src/*.c -o mallocfail.so -ldl -lunwind \
|
|
&& install mallocfail.so /usr/local/lib/mallocfail.so
|
|
|
|
WORKDIR /work/_build
|
|
COPY other/docker/coverage/run_mallocfail /usr/local/bin/
|
|
RUN ["run_mallocfail", "--ctest=1", "--jobs=8"]
|
|
RUN llvm-profdata-17 merge -sparse $(find . -name "*.profraw") -o toxcore.profdata
|
|
RUN llvm-cov-17 show -format=text -instr-profile=toxcore.profdata -sources $(cmake --build . --target help | grep -o '[^:]*_test:' | grep -o '[^:]*' | xargs -n1 find . -type f -name | awk '{print "-object "$1}') > coverage.txt
|
|
RUN llvm-cov-17 show -format=html -instr-profile=toxcore.profdata -sources $(cmake --build . --target help | grep -o '[^:]*_test:' | grep -o '[^:]*' | xargs -n1 find . -type f -name | awk '{print "-object "$1}') -output-dir=html
|
|
|
|
WORKDIR /work
|