From 2b66109a63a0f4df98b4f031fbc14bd1bc680648 Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Sat, 21 Dec 2024 19:27:40 -0800 Subject: [PATCH] fix: linking error building antithesis-bot (#776) --- Dockerfile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index df5dc3fc..57306b86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,17 +8,18 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y \ - curl \ + binutils \ build-essential \ - libssl-dev \ - pkg-config \ cmake \ - perl \ + curl \ gcc \ - linux-headers-generic \ + libclang-dev \ libclang1 \ + libssl-dev \ + linux-headers-generic \ llvm-dev \ - libclang-dev \ + perl \ + pkg-config \ && rm -rf /var/lib/apt/lists/* # Base builder stage with Rust installation @@ -94,11 +95,13 @@ COPY ./libvoidstar.so /usr/lib/libvoidstar.so # Assumes libvoidstar.so is in /usr/lib ENV LIBVOIDSTAR_PATH=/usr/lib ENV LD_LIBRARY_PATH=/usr/lib + ENV RUSTFLAGS="-Ccodegen-units=1 \ -Cpasses=sancov-module \ -Cllvm-args=-sanitizer-coverage-level=3 \ -Cllvm-args=-sanitizer-coverage-trace-pc-guard \ -Clink-args=-Wl,--build-id \ + -Clink-args=-Wl,-z,nostart-stop-gc \ -L/usr/lib \ -lvoidstar" @@ -113,10 +116,10 @@ RUN --mount=type=cache,target=${CARGO_HOME}/registry \ cp /antithesis-target/debug/tag /app/tag # Verify instrumentation was successful -#RUN nm target/debug/hyperion-proxy | grep "sanitizer_cov_trace_pc_guard" && \ -# ldd target/debug/hyperion-proxy | grep "libvoidstar" && \ -# nm target/debug/tag | grep "sanitizer_cov_trace_pc_guard" && \ -# ldd target/debug/tag | grep "libvoidstar" +RUN nm target/debug/hyperion-proxy | grep "sanitizer_cov_trace_pc_guard" && \ + ldd target/debug/hyperion-proxy | grep "libvoidstar" && \ + nm target/debug/tag | grep "sanitizer_cov_trace_pc_guard" && \ + ldd target/debug/tag | grep "libvoidstar" # Release builder FROM builder-base AS build-release @@ -124,7 +127,7 @@ FROM builder-base AS build-release RUN --mount=type=cache,target=${CARGO_HOME}/registry \ --mount=type=cache,target=${CARGO_HOME}/git \ --mount=type=cache,target=/app/target \ - cargo build --profile release-full --frozen && \ + cargo build --profile release-full --frozen --workspace --exclude antithesis-bot && \ mkdir -p /app/build && \ cp target/release-full/hyperion-proxy /app/build/ && \ cp target/release-full/tag /app/build/ && \