FROM ubuntu:rolling WORKDIR /tmp ENV HOME=/tmp RUN chmod -R 777 /tmp # Install apt dependencies RUN apt-get update RUN apt-get upgrade -y RUN TZ=America/Los_Angeles DEBIAN_FRONTEND=noninteractive apt-get install -y \ build-essential \ ccache \ clang \ cmake \ curl \ doxygen \ file \ gcovr \ git \ gperf \ graphviz \ libc6-dbg \ ninja-build \ pre-commit \ python3-requests \ zstd # Install recent valgrind from source RUN curl -Ls https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2 -o valgrind.tar.bz2 && \ echo "8536c031dbe078d342f121fa881a9ecd205cb5a78e639005ad570011bdb9f3c6 valgrind.tar.bz2" > valgrind-sha.txt && \ sha256sum --quiet -c valgrind-sha.txt && \ mkdir valgrind && \ tar --strip-components 1 --no-same-owner --no-same-permissions --directory valgrind -xjf valgrind.tar.bz2 && \ cd valgrind && \ ./configure --enable-only64bit --enable-lto && \ make && \ make install && \ cd .. && \ rm -rf /tmp/* # Set after building valgrind, which doesn't build with clang for some reason ENV CC=clang ENV CXX=clang++ # Install recent flatbuffers from source RUN curl -Ls https://github.com/google/flatbuffers/archive/refs/tags/v23.3.3.tar.gz -o flatbuffers.tar.gz && \ echo "8aff985da30aaab37edf8e5b02fda33ed4cbdd962699a8e2af98fdef306f4e4d flatbuffers.tar.gz" > flatbuffers-sha.txt && \ sha256sum --quiet -c flatbuffers-sha.txt && \ mkdir flatbuffers && \ tar --strip-components 1 --no-same-owner --no-same-permissions --directory flatbuffers -xf flatbuffers.tar.gz && \ cd flatbuffers && \ cmake -S. -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && \ ninja -C build install && \ rm -rf /tmp/* # Build msan-instrumented libc++ (llvmorg-16.0.0) RUN curl -Ls https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-project-16.0.0.src.tar.xz -o llvm-project.tar.gz && \ echo "9a56d906a2c81f16f06efc493a646d497c53c2f4f28f0cb1f3c8da7f74350254 llvm-project.tar.gz" > llvm-project-sha.txt && \ sha256sum --quiet -c llvm-project-sha.txt && \ mkdir llvm-project && \ tar --strip-components 1 --no-same-owner --no-same-permissions --directory llvm-project -xf llvm-project.tar.gz && \ cmake -Sllvm-project/runtimes -B build -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_INSTALL_PREFIX=/opt/llvm-msan \ -DLLVM_USE_SANITIZER=MemoryWithOrigins && \ ninja -C build cxx cxxabi && \ ninja -C build install-cxx install-cxxabi && \ rm -rf /tmp/* # Install bloaty from source RUN curl -Ls https://github.com/google/bloaty/releases/download/v1.1/bloaty-1.1.tar.bz2 -o bloaty.tar.bz2 && \ echo "a308d8369d5812aba45982e55e7c3db2ea4780b7496a5455792fb3dcba9abd6f bloaty.tar.bz2" > bloaty-sha.txt && \ sha256sum --quiet -c bloaty-sha.txt && \ mkdir bloaty && \ tar --strip-components 1 --no-same-owner --no-same-permissions --directory bloaty -xf bloaty.tar.bz2 && \ cd bloaty && \ cmake -S. -B build -G Ninja && \ ninja -C build install && \ rm -rf /tmp/* RUN apt-get update RUN apt-get upgrade -y RUN TZ=America/Los_Angeles DEBIAN_FRONTEND=noninteractive apt-get install -y texlive-full # Try to have all the pre-commit hooks we'll need already initialized COPY .pre-commit-config.yaml /tmp/ RUN git init && pre-commit install-hooks