Skip to content

Commit

Permalink
fix: linking error building antithesis-bot (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka authored Dec 22, 2024
1 parent ad9eea5 commit 2b66109
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand All @@ -113,18 +116,18 @@ 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

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/ && \
Expand Down

0 comments on commit 2b66109

Please sign in to comment.