-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.valgrind
More file actions
70 lines (59 loc) · 1.74 KB
/
Dockerfile.valgrind
File metadata and controls
70 lines (59 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM hexpm/elixir:1.18.4-erlang-27.3.4.4-ubuntu-noble-20251001
# Install build tools, valgrind, and ClickHouse dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
valgrind \
liblz4-dev \
libzstd-dev \
libssl-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install hex and rebar
RUN mix local.hex --force && \
mix local.rebar --force
# Copy mix files first for dependency caching
COPY mix.exs mix.lock ./
RUN mix deps.get
# Copy the entire project
COPY . .
# Clean any macOS build artifacts
RUN rm -rf native/natch_fine/_build priv/*.so _build
# Update tests to use CLICKHOUSE_HOST environment variable
RUN find test -name "*.exs" -type f -exec sed -i 's/host: "localhost"/host: System.get_env("CLICKHOUSE_HOST", "localhost")/g' {} \;
# Clone clickhouse-cpp and update CMakeLists.txt path
RUN mkdir -p /clickhouse-cpp && \
cd /clickhouse-cpp && \
git clone --depth 1 https://github.com/ClickHouse/clickhouse-cpp.git . && \
sed -i 's|/Users/brendon/work/clickhouse-cpp|/clickhouse-cpp|g' /app/native/natch_fine/CMakeLists.txt
# Compile the project
ENV MIX_ENV=test
RUN mix compile
# Set up valgrind suppressions for BEAM/Erlang known issues
RUN echo "{\n\
<beam_alloc>\n\
Memcheck:Leak\n\
...\n\
fun:beam_alloc\n\
}\n\
{\n\
<erts_alloc>\n\
Memcheck:Leak\n\
...\n\
fun:erts_alloc*\n\
}\n\
{\n\
<erts_realloc>\n\
Memcheck:Leak\n\
...\n\
fun:erts_realloc*\n\
}\n\
{\n\
<openssl_malloc>\n\
Memcheck:Leak\n\
...\n\
obj:*/libcrypto.so*\n\
}" > /tmp/beam.supp
CMD ["sh", "-c", "valgrind --leak-check=full --show-leak-kinds=definite --suppressions=/tmp/beam.supp --track-origins=yes --verbose mix test --exclude integration 2>&1"]