Skip to content

Commit

Permalink
Only build valgrind if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed Dec 2, 2024
1 parent 1150a89 commit 36908fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ RUN pip3 install compiledb || pip3 install compiledb --break-system-packages
RUN gem install bundler --no-doc

# Valgrind on our docker image is too old to handle compressed debug symbols or some such.
WORKDIR /tmp
RUN wget https://sourceware.org/pub/valgrind/valgrind-3.24.0.tar.bz2 && \
ARG NEED_VALGRIND=false
RUN if [ "$NEED_VALGRIND" = "true" ]; then \
cd /tmp && \
wget https://sourceware.org/pub/valgrind/valgrind-3.24.0.tar.bz2 && \
tar xvf valgrind-3.24.0.tar.bz2 && \
cd valgrind-3.24.0 && \
./configure && \
make -j 4 && \
make install
make install; \
fi

ENV LC_ALL=C.UTF-8
ENV LLVM_CONFIG=/usr/lib/llvm-14/bin/llvm-config
Expand Down
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ task :docker_build_clang_release do
'--build-arg CXX=clang++ ' \
'--build-arg NAT_CXX_FLAGS=-DNAT_GC_GUARD ' \
'--build-arg NAT_BUILD_MODE=release ' \
"--build-arg NEED_VALGRIND=#{ENV.fetch('NEED_VALGRIND', 'false')} " \
'.'
end

Expand Down Expand Up @@ -391,7 +392,9 @@ task docker_test_all_ruby_spec_nightly: :docker_build_clang do
"natalie_clang_#{ruby_version_string} test_all_ruby_spec_nightly"
end

task docker_test_perf: :docker_build_clang_release do
task :docker_test_perf do
ENV['NEED_VALGRIND'] = 'true'
Rake::Task['docker_build_clang_release'].invoke
sh "docker run #{docker_run_flags} " \
"-e STATS_API_SECRET=#{(ENV['STATS_API_SECRET'] || '').inspect} " \
"-e GIT_SHA=#{(ENV['LAST_COMMIT_SHA'] || '').inspect} " \
Expand Down

0 comments on commit 36908fe

Please sign in to comment.